Add dependency container image;(WIP)Update image reference
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
fcb05e2e12
commit
0c8272c9e4
@ -0,0 +1,53 @@
|
||||
files:
|
||||
- [...]
|
||||
- content: |
|
||||
#!/bin/bash
|
||||
vmtoolsd --cmd 'info-get guestinfo.ovfEnv' > /tmp/ovfenv
|
||||
|
||||
IPAddress=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.address" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv)
|
||||
SubnetMask=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.netmask" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv)
|
||||
Gateway=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.route.0.gateway" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv)
|
||||
DNS=$(sed -n 's/.*Property oe:key="guestinfo.dns.servers" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv)
|
||||
MACAddress=$(sed -n 's/.*ve:Adapter ve:mac="\([^"]*\).*/\1/p' /tmp/ovfenv)
|
||||
|
||||
mask2cidr() {
|
||||
c=0
|
||||
x=0$( printf '%o' $${1//./ } )
|
||||
|
||||
while [ $x -gt 0 ]; do
|
||||
let c+=$((x%2)) 'x>>=1'
|
||||
done
|
||||
|
||||
echo $c
|
||||
}
|
||||
|
||||
Prefix=$(mask2cidr $SubnetMask)
|
||||
|
||||
cat > /etc/netplan/01-netcfg.yaml <<EOF
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
id0:
|
||||
set-name: eth0
|
||||
match:
|
||||
macaddress: $MACAddress
|
||||
addresses:
|
||||
- $IPAddress/$Prefix
|
||||
gateway4: $Gateway
|
||||
nameservers:
|
||||
addresses : [$DNS]
|
||||
EOF
|
||||
rm /etc/netplan/50*.yaml
|
||||
|
||||
sudo netplan apply
|
||||
owner: root:root
|
||||
path: /root/network.sh
|
||||
- content: |
|
||||
network: {config: disabled}
|
||||
owner: root:root
|
||||
path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
|
||||
|
||||
preKubeadmCommands:
|
||||
- [...]
|
||||
- bash /root/network.sh
|
@ -35,3 +35,18 @@
|
||||
--config ./clusterctl.yaml \
|
||||
--kubeconfig {{ kubeconfig.path }}
|
||||
chdir: /opt/metacluster/cluster-api
|
||||
|
||||
# - name: Update image references to use local registry
|
||||
# # This should ASAP be changed to be idempotent!
|
||||
# # ansible.builtin.lineinfile:
|
||||
# # path: "{{ item.root + '/' + item.path }}"
|
||||
# # regexp: (.*image:[ "]+)(.*)
|
||||
# # line: \g<1>registry.{{ vapp['metacluster.fqdn'] }}/library/\g<2>
|
||||
# # loop: "{{ lookup('community.general.filetree', '/opt/metacluster/cluster-api') }}"
|
||||
# # when:
|
||||
# # - item.path | match('.yaml')
|
||||
# # - not (item.path | search("clusterctl.yaml|metadata.yaml"))
|
||||
# ansible.builtin.shell:
|
||||
# cmd: >-
|
||||
# find . -type f | xargs -I {} sed -r 's|(image:[ "]+)|\1registry.{{ vapp['metacluster.fqdn'] }}/library/|' -i {}
|
||||
# chdir: /opt/metacluster/cluster-api
|
||||
|
@ -222,6 +222,8 @@ dependencies:
|
||||
- quay.io/k8scsi/csi-node-driver-registrar:v2.0.1
|
||||
- quay.io/k8scsi/csi-provisioner:v2.0.0
|
||||
- quay.io/k8scsi/livenessprobe:v2.1.0
|
||||
# This seems to be a hardcoded containerd dependency (see '/etc/containerd/config.toml' on a provisioned node)
|
||||
- k8s.gcr.io/pause:3.6
|
||||
|
||||
static_binaries:
|
||||
- filename: clusterctl
|
||||
|
Loading…
Reference in New Issue
Block a user