comparison multikube.py @ 113:c520672d0930

closer to multi-node k3s working, but still doesn't quite network right
author drewp@bigasterisk.com
date Sat, 20 Aug 2022 22:35:31 -0700
parents 301869fa0ed6
children 375515ab60ba
comparison
equal deleted inserted replaced
112:301869fa0ed6 113:c520672d0930
105 install_skaffold() 105 install_skaffold()
106 files.link(path='/usr/local/bin/kubectl', target='/usr/local/bin/k3s') 106 files.link(path='/usr/local/bin/kubectl', target='/usr/local/bin/k3s')
107 files.directory(path='/home/drewp/.kube', user='drewp', group='drewp') 107 files.directory(path='/home/drewp/.kube', user='drewp', group='drewp')
108 # .zshrc has: export KUBECONFIG=/etc/rancher/k3s/k3s.yaml 108 # .zshrc has: export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
109 109
110 # assumes our pyinfra process is running on server_node
111 if host.name != server_node: 110 if host.name != server_node:
112 files.put(src='/tmp/k3s-yaml', dest='/etc/rancher/k3s/k3s.yaml') 111 files.put(src='/tmp/k3s-yaml', dest='/etc/rancher/k3s/k3s.yaml')
113 112
114 files.file(path='/etc/rancher/k3s/k3s.yaml', user='root', group='drewp', mode='640') 113 files.file(path='/etc/rancher/k3s/k3s.yaml', user='root', group='drewp', mode='640')
115 server.shell(f"kubectl config set-cluster default --server=https://{server_ip}:6443 --kubeconfig=/etc/rancher/k3s/k3s.yaml") 114 server.shell(f"kubectl config set-cluster default --server=https://{server_ip}:6443 --kubeconfig=/etc/rancher/k3s/k3s.yaml")