Mercurial > code > home > repos > infra
changeset 112:301869fa0ed6
rename
author | drewp@bigasterisk.com |
---|---|
date | Sat, 20 Aug 2022 22:34:59 -0700 |
parents | 340d778a1682 |
children | c520672d0930 |
files | kube.py multikube.py templates/kube/config-agent.yaml.j2 |
diffstat | 3 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/kube.py Sat Aug 20 14:12:05 2022 -0700 +++ b/kube.py Sat Aug 20 22:34:59 2022 -0700 @@ -7,7 +7,7 @@ is_pi = host.get_fact(LinuxDistribution)['name'] in ['Debian', 'Raspbian GNU/Linux'] -master_ip = "10.5.0.1" +server_ip = "10.5.0.1" server_node = 'bang' nodes = ['slash', 'dash'] #, 'dash', 'frontbed', 'garage'] admin_from = ['bang', 'slash', 'dash'] @@ -83,7 +83,7 @@ files.template( src=f'templates/kube/{which_conf}', dest='/etc/k3s_config.yaml', - master_ip=master_ip, + server_ip=server_ip, token=token, wg_ip=host.host_data['wireguard_address'], ) @@ -119,4 +119,4 @@ user='root', group='drewp', mode='640') - server.shell(f"kubectl config set-cluster default --server=https://{master_ip}:6443 --kubeconfig=/etc/rancher/k3s/k3s.yaml") + server.shell(f"kubectl config set-cluster default --server=https://{server_ip}:6443 --kubeconfig=/etc/rancher/k3s/k3s.yaml")
--- a/multikube.py Sat Aug 20 14:12:05 2022 -0700 +++ b/multikube.py Sat Aug 20 22:34:59 2022 -0700 @@ -8,7 +8,7 @@ is_pi = host.get_fact(LinuxDistribution)['name'] in ['Debian', 'Raspbian GNU/Linux'] -from multikube_config import server_node, master_ip,nodes, admin_from, k3s_version, skaffold_version +from multikube_config import server_node, server_ip, nodes, admin_from, k3s_version, skaffold_version def download_k3s(): tail = 'k3s' if host.get_fact(Arch) == 'x86_64' else 'k3s-armhf' @@ -71,7 +71,7 @@ files.template( src=f'templates/kube/{which_conf}', dest='/etc/k3s_config.yaml', - master_ip=master_ip, + server_ip=server_ip, token=token, wg_ip=host.host_data['mk_addr'],#wireguard_address'], ) @@ -87,6 +87,7 @@ files.get(src='/var/lib/rancher/k3s/server/node-token', dest='/tmp/k3s-token') files.get(src='/etc/rancher/k3s/k3s.yaml', dest='/tmp/k3s-yaml') + if host.name in nodes + [server_node]: host_prep() files.directory(path='/etc/rancher/k3s') @@ -111,4 +112,4 @@ files.put(src='/tmp/k3s-yaml', dest='/etc/rancher/k3s/k3s.yaml') files.file(path='/etc/rancher/k3s/k3s.yaml', user='root', group='drewp', mode='640') - server.shell(f"kubectl config set-cluster default --server=https://{master_ip}:6443 --kubeconfig=/etc/rancher/k3s/k3s.yaml") + server.shell(f"kubectl config set-cluster default --server=https://{server_ip}:6443 --kubeconfig=/etc/rancher/k3s/k3s.yaml")