netmaker/kube/netclient-template.yaml

58 lines
1.5 KiB
YAML
Raw Normal View History

2021-07-16 03:27:34 +08:00
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
2021-07-16 03:36:37 +08:00
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"]
2021-07-16 03:27:34 +08:00
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