Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit ab62a4f

Browse files
howto: add k8s example
1 parent e1cb1c9 commit ab62a4f

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ Use following `devcontainer.json` to start:
111111
Unfortunately `devcontainer.json` is not yet supported with VScode Remote-SSH plugin. You can track recent development [here](https://github.com/microsoft/vscode-remote-release/issues/2994).
112112
The easiest way to use avd-all-in-one container with remote SSH is creating a simple alias: `alias avd="sudo docker run --rm -it -v $(pwd):/home/avd/projects/ avdteam/avd-all-in-one"`
113113

114+
115+
### run avd-all-in-one in k8s
116+
117+
[k8s-avd-cvp.yml](k8s-avd-cvp.yml) is an example pod definition for running avd-all-in-one on CloudVision (CentOS), however
118+
it should work on other linux distributions (the CVP env vars won't be needed in that case).
119+
120+
1. Download the docker image: `docker pull avdteam/avd-all-in-one`
121+
2. Create avd group and user: `groupadd -g 1000 avd && useradd avd -u 1000 -g 1000`
122+
3. Create projects in `/home/avd`
123+
4. Deploy the k8s pod: `kubectl apply -f /cvpi/conf/kubernetes/k8s-avd-cvp.yml`
124+
114125
## Known Caveats
115126

116127
### Curly Brackets May Not Work as Expected

k8s-avd-cvp.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: avd
5+
labels:
6+
app: avd
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: avd
12+
template:
13+
metadata:
14+
labels:
15+
app: avd
16+
spec:
17+
hostNetwork: false
18+
securityContext:
19+
runAsUser: 10021
20+
dnsPolicy: ClusterFirst
21+
containers:
22+
- name: avd
23+
image: avdteam/avd-all-in-one:latest
24+
imagePullPolicy: Never
25+
securityContext:
26+
allowPrivilegeEscalation: true
27+
capabilities:
28+
drop:
29+
- all
30+
readOnlyRootFilesystem: false
31+
env:
32+
- name: CVP_MODE
33+
value: $CVP_MODE
34+
- name: CVP_VERSION
35+
value: $CVP_VERSION
36+
- name: PRIMARY_DEVICE_INTF_IP
37+
value: $PRIMARY_DEVICE_INTF_IP
38+
- name: SECONDARY_DEVICE_INTF_IP
39+
value: $SECONDARY_DEVICE_INTF_IP
40+
- name: TERTIARY_DEVICE_INTF_IP
41+
value: $TERTIARY_DEVICE_INTF_IP
42+
- name: PRIMARY_HOST_IP
43+
value: $PRIMARY_HOST_IP
44+
- name: SECONDARY_HOST_IP
45+
value: $SECONDARY_HOST_IP
46+
- name: TERTIARY_HOST_IP
47+
value: $TERTIARY_HOST_IP
48+
- name: PRIMARY_HOSTNAME
49+
value: $PRIMARY_HOSTNAME
50+
- name: SECONDARY_HOSTNAME
51+
value: $SECONDARY_HOSTNAME
52+
- name: TERTIARY_HOSTNAME
53+
value: $TERTIARY_HOSTNAME
54+
- name: AERIS_INGEST_KEY
55+
value: '$AERIS_INGEST_KEY'
56+
- name: CURRENT_NODE_IP
57+
valueFrom:
58+
fieldRef:
59+
fieldPath: status.hostIP
60+
command:
61+
- zsh
62+
- -c
63+
- --
64+
args:
65+
- while true;
66+
- do sleep 3000;
67+
- done;
68+
volumeMounts:
69+
- name: tmpfs
70+
mountPath: /tmp
71+
- name: certs-dir
72+
mountPath: /usr/share/nginx/images
73+
readOnly: true
74+
- name: lib64
75+
mountPath: /usr/lib64
76+
readOnly: true
77+
- name: home-avd
78+
mountPath: /projects
79+
readOnly: false
80+
resources:
81+
limits:
82+
cpu: "3"
83+
memory: "4Gi"
84+
requests:
85+
cpu: "100m"
86+
memory: "100Mi"
87+
terminationGracePeriodSeconds: 10
88+
volumes:
89+
- name: tmpfs
90+
hostPath:
91+
path: /tmp
92+
- name: certs-dir
93+
hostPath:
94+
path: /usr/share/nginx/certs
95+
- name: lib64
96+
hostPath:
97+
path: /usr/lib64
98+
- name: home-avd
99+
hostPath:
100+
path: /home/avd

0 commit comments

Comments
 (0)