netmaker/kube/netclient-daemonset.yaml

59 lines
1.3 KiB
YAML
Raw Normal View History

2021-07-16 03:14:48 +08:00
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: netclient
labels:
app: netclient
spec:
selector:
matchLabels:
app: netclient
replicas: 1
template:
metadata:
labels:
app: netclient
spec:
hostNetwork: true
containers:
- name: netclient
2021-08-20 04:52:24 +08:00
image: gravitl/netclient:v0.7.2
2021-07-16 03:14:48 +08:00
command: ['bash', '-c', "netclient checkin -n $NETWORK; sleep $SLEEP"]
env:
- name: ACCESS_TOKEN
value: "XXXX"
- name: NETWORK
2021-08-20 04:52:24 +08:00
value: "YYYY"
2021-07-16 03:14:48 +08:00
- name: SLEEP
value: 30
volumeMounts:
- mountPath: /etc/netclient
name: etc-netclient
- mountPath: /usr/bin/wg
name: wg
securityContext:
privileged: true
initContainers:
- name: netclient-join
2021-08-20 04:52:24 +08:00
image: gravitl/netclient:v0.7.2
2021-07-16 03:14:48 +08:00
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