changing mq values

This commit is contained in:
afeiszli 2022-07-07 15:54:52 -04:00
parent 65a004d93b
commit 46f7797df8
6 changed files with 49 additions and 223 deletions

View file

@ -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

View file

@ -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: "<token>"
volumeMounts:
- mountPath: /etc/netclient
name: etc-netclient
securityContext:
privileged: true
volumes:
- hostPath:
path: /etc/netclient
type: DirectoryOrCreate
name: etc-netclient

View file

@ -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: "<token>"
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

View file

@ -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

View file

@ -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: <node label>
# operator: In
# values:
# - "<node label value>"
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

View file

@ -78,7 +78,7 @@ spec:
- name: MQ_PORT
value: "31883"
- name: MQ_SERVER_PORT
value: "8883"
value: "1883"
- name: PLATFORM
value: "Kubernetes"
- name: VERBOSITY