diff --git a/k8s/netclient/netclient-daemonset.yaml b/k8s/netclient/netclient-daemonset.yaml index 00740763..2c2c07fd 100644 --- a/k8s/netclient/netclient-daemonset.yaml +++ b/k8s/netclient/netclient-daemonset.yaml @@ -17,42 +17,17 @@ spec: hostNetwork: true containers: - name: netclient - image: gravitl/netclient:v0.7.2 - command: ['bash', '-c', "netclient checkin -n $NETWORK; sleep $SLEEP"] + image: gravitl/netclient:v0.14.5 env: - - name: ACCESS_TOKEN - value: "XXXX" - - name: NETWORK - value: "YYYY" - - name: SLEEP - value: 30 + - name: TOKEN + value: "TOKEN_VALUE" volumeMounts: - mountPath: /etc/netclient name: etc-netclient - - mountPath: /usr/bin/wg - name: wg - securityContext: - privileged: true - initContainers: - - name: netclient-join - image: gravitl/netclient:v0.7.2 - command: ['bash', '-c', "netclient join -t $ACCESS_TOKEN --daemon off"] - env: - - name: ACCESS_TOKEN - value: "XXXX" - volumeMounts: - - mountPath: /etc/netclient - name: etc-netclient - - mountPath: /usr/bin/wg - name: wg securityContext: privileged: true volumes: - hostPath: path: /etc/netclient type: DirectoryOrCreate - name: etc-netclient - - hostPath: - path: /usr/bin/wg - type: File - name: wg + name: etc-netclient \ No newline at end of file diff --git a/k8s/netclient/netclient-template-doks-uspace.yaml b/k8s/netclient/netclient-template-doks-uspace.yaml deleted file mode 100644 index 1d81b001..00000000 --- a/k8s/netclient/netclient-template-doks-uspace.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: netclient-1 - labels: - app: netclient-1 -spec: - selector: - matchLabels: - app: netclient-1 - template: - metadata: - labels: - app: netclient-1 - spec: - hostNetwork: true - containers: - - name: netclient-1 - image: gravitl/netclient:0.9.2-doks-uspace - env: - - name: NETCLIENT_ROAMING - value: "no" - - name: NETCLIENT_PORT - value: "51821" - - name: NETCLIENT_IS_STATIC - value: "yes" - - name: NETCLIENT_ENDPOINT - valueFrom: - fieldRef: - fieldPath: status.hostIP - - name: TOKEN - value: "" - volumeMounts: - - mountPath: /etc/netclient - name: etc-netclient - securityContext: - privileged: true - volumes: - - hostPath: - path: /etc/netclient - type: DirectoryOrCreate - name: etc-netclient - diff --git a/k8s/netclient/netclient-template-doks.yaml b/k8s/netclient/netclient-template-doks.yaml deleted file mode 100644 index 24cb49e2..00000000 --- a/k8s/netclient/netclient-template-doks.yaml +++ /dev/null @@ -1,93 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: netclient-1 - labels: - app: netclient-1 -spec: - selector: - matchLabels: - app: netclient-1 - template: - metadata: - labels: - app: netclient-1 - spec: - hostNetwork: true - containers: - - name: netclient-1 - image: gravitl/netclient:0.9.2-doks - env: - - name: NETCLIENT_ROAMING - value: "no" - - name: NETCLIENT_PORT - value: "51821" - - name: NETCLIENT_IS_STATIC - value: "yes" - - name: NETCLIENT_ENDPOINT - valueFrom: - fieldRef: - fieldPath: status.hostIP - - name: TOKEN - value: "" - volumeMounts: - - mountPath: /etc/netclient - name: etc-netclient - - mountPath: /usr/bin/wg - name: wg - securityContext: - privileged: true - volumes: - - hostPath: - path: /etc/netclient - type: DirectoryOrCreate - name: etc-netclient - - hostPath: - path: /usr/bin/wg - type: File - name: wg ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: wireguard-controller - labels: - app: wireguard-controller -spec: - selector: - matchLabels: - app: wireguard-controller - template: - metadata: - labels: - app: wireguard-controller - spec: - hostNetwork: true - containers: - - image: gravitl/netclient:0.9.2-doks - imagePullPolicy: IfNotPresent - name: wg-installer - command: ['bash', '-c'] - args: - - while [ 1 ]; - do if ! command -v wg &> /dev/null; - then echo "wireguard not installed, installing"; - echo 'deb http://deb.debian.org/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/buster-backports.list; - apt update; - sudo apt -y install linux-headers-$(uname --kernel-release); - apt -y install wireguard wireguard-tools; - else echo "wireguard installed"; - sleep 300; - fi; - done - securityContext: - privileged: true - volumeMounts: - - name: rootfolder - mountPath: / - volumes: - - hostPath: - path: / - type: "" - name: rootfolder - diff --git a/k8s/netclient/netclient-template.yaml b/k8s/netclient/netclient-template.yaml deleted file mode 100644 index c44bffae..00000000 --- a/k8s/netclient/netclient-template.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: netclient - labels: - app: netclient -spec: - selector: - matchLabels: - app: netclient - template: - metadata: - labels: - app: netclient - spec: - hostNetwork: true - containers: - - name: netclient - image: gravitl/netclient:v0.5.11 - command: ['bash', '-c', "/root/netclient join -t $ACCESS_TOKEN --daemon off --name $(echo $NODE_NAME| sed -e s/.$NETWORK//); while true; do /root/netclient checkin --dns on -n $NETWORK; sleep $SLEEP; done"] - env: - - name: ACCESS_TOKEN - value: "ACCESS_TOKEN_VALUE" - - name: NETWORK - value: "microk8s" - - name: SLEEP - value: "30" - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - volumeMounts: - - mountPath: /etc/netclient - name: etc-netclient - - mountPath: /usr/bin/wg - name: wg - - mountPath: /var/run/dbus/system_bus_socket - name: systemd-bus-socket - securityContext: - privileged: true - volumes: - - hostPath: - path: /etc/netclient - type: DirectoryOrCreate - name: etc-netclient - - hostPath: - path: /usr/bin/wg - type: File - name: wg - - hostPath: - path: /usr/bin/resolvectl - type: File - name: resolvectl - - hostPath: - path: /var/run/dbus/system_bus_socket - type: "" - name: systemd-bus-socket diff --git a/k8s/netclient/netclient.yaml b/k8s/netclient/netclient.yaml new file mode 100644 index 00000000..e77a9dac --- /dev/null +++ b/k8s/netclient/netclient.yaml @@ -0,0 +1,44 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: netclient + labels: + app: netclient +spec: + selector: + matchLabels: + app: netclient + replicas: 1 + template: + metadata: + labels: + app: netclient + spec: + hostNetwork: true + # affinity: + # nodeAffinity: + # preferredDuringSchedulingIgnoredDuringExecution: + # - weight: 1 + # preference: + # matchExpressions: + # - key: + # operator: In + # values: + # - "" + containers: + - name: netclient + image: gravitl/netclient:v0.14.5 + env: + - name: TOKEN + value: "TOKEN_VALUE" + volumeMounts: + - mountPath: /etc/netclient + name: etc-netclient + securityContext: + privileged: true + volumes: + - hostPath: + path: /etc/netclient + type: DirectoryOrCreate + name: etc-netclient \ No newline at end of file diff --git a/k8s/netmaker-server.yaml b/k8s/netmaker-server.yaml index acd23c95..7376ca96 100644 --- a/k8s/netmaker-server.yaml +++ b/k8s/netmaker-server.yaml @@ -78,7 +78,7 @@ spec: - name: MQ_PORT value: "31883" - name: MQ_SERVER_PORT - value: "8883" + value: "1883" - name: PLATFORM value: "Kubernetes" - name: VERBOSITY