Skip to content

Commit 4a6749b

Browse files
ci: add auth pod
1 parent ce7e2bc commit 4a6749b

2 files changed

Lines changed: 117 additions & 0 deletions

File tree

k8s/auth.yaml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: auth
5+
spec:
6+
replicas: 1
7+
revisionHistoryLimit: 2
8+
selector:
9+
matchLabels:
10+
app: auth
11+
strategy:
12+
type: Recreate
13+
template:
14+
metadata:
15+
labels:
16+
app: auth
17+
spec:
18+
securityContext:
19+
runAsNonRoot: true
20+
containers:
21+
# -----------------------------------------------------
22+
# ScoutAPM Container
23+
# -----------------------------------------------------
24+
- name: scoutapm
25+
image: "scoutapp/scoutapm:version-1.4.0"
26+
imagePullPolicy: IfNotPresent
27+
# Replace command with one that will shut down on a TERM signal
28+
# The ./core-agent start command line is from the scoutapm docker image
29+
command:
30+
- "sh"
31+
- "-c"
32+
- >-
33+
trap './core-agent shutdown --tcp 0.0.0.0:6590' TERM;
34+
./core-agent start --daemonize false --log-level debug --tcp 0.0.0.0:6590 &
35+
wait $!
36+
livenessProbe:
37+
exec:
38+
command:
39+
- "sh"
40+
- "-c"
41+
- "./core-agent probe --tcp 0.0.0.0:6590 | grep -q 'Agent found'"
42+
securityContext:
43+
readOnlyRootFilesystem: true
44+
runAsUser: 65534 # "nobody" user by default
45+
runAsGroup: 65534 # "nogroup" group by default
46+
# -----------------------------------------------------
47+
# Datatracker Container
48+
# -----------------------------------------------------
49+
- name: datatracker
50+
image: "ghcr.io/ietf-tools/datatracker:$APP_IMAGE_TAG"
51+
imagePullPolicy: Always
52+
ports:
53+
- containerPort: 8000
54+
name: http
55+
protocol: TCP
56+
volumeMounts:
57+
- name: dt-vol
58+
mountPath: /a
59+
- name: dt-tmp
60+
mountPath: /tmp
61+
- name: dt-home
62+
mountPath: /home/datatracker
63+
- name: dt-xml2rfc-cache
64+
mountPath: /var/cache/xml2rfc
65+
- name: dt-cfg
66+
mountPath: /workspace/ietf/settings_local.py
67+
subPath: settings_local.py
68+
env:
69+
- name: "CONTAINER_ROLE"
70+
value: "datatracker"
71+
# ensures the pod gets recreated on every deploy:
72+
- name: "DEPLOY_UID"
73+
value: "$DEPLOY_UID"
74+
envFrom:
75+
- configMapRef:
76+
name: django-config
77+
securityContext:
78+
allowPrivilegeEscalation: false
79+
capabilities:
80+
drop:
81+
- ALL
82+
readOnlyRootFilesystem: true
83+
runAsUser: 1000
84+
runAsGroup: 1000
85+
volumes:
86+
# To be overriden with the actual shared volume
87+
- name: dt-vol
88+
- name: dt-tmp
89+
emptyDir:
90+
sizeLimit: "2Gi"
91+
- name: dt-xml2rfc-cache
92+
emptyDir:
93+
sizeLimit: "2Gi"
94+
- name: dt-home
95+
emptyDir:
96+
sizeLimit: "2Gi"
97+
- name: dt-cfg
98+
configMap:
99+
name: files-cfgmap
100+
dnsPolicy: ClusterFirst
101+
restartPolicy: Always
102+
terminationGracePeriodSeconds: 60
103+
---
104+
apiVersion: v1
105+
kind: Service
106+
metadata:
107+
name: auth
108+
spec:
109+
type: ClusterIP
110+
ports:
111+
- port: 8080
112+
targetPort: http
113+
protocol: TCP
114+
name: http
115+
selector:
116+
app: auth

k8s/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ configMapGenerator:
55
files:
66
- settings_local.py
77
resources:
8+
- auth.yaml
89
- beat.yaml
910
- celery.yaml
1011
- datatracker.yaml

0 commit comments

Comments
 (0)