test(nginx-external-auth): bring up to code standards

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-10-29 14:36:06 -04:00
parent 3dab060bfa
commit cc45c5c135
5 changed files with 59 additions and 61 deletions
+33 -35
View File
@@ -12,39 +12,37 @@ spec:
app: nginx-external-auth app: nginx-external-auth
spec: spec:
volumes: volumes:
- name: config
configMap:
name: nginx-cfg
containers:
- name: www
image: nginx:alpine
resources:
limits:
memory: "128Mi"
cpu: "500m"
requests:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 80
volumeMounts:
- name: config - name: config
mountPath: /etc/nginx/conf.d configMap:
readOnly: true name: nginx-cfg
- name: anubis containers:
image: ttl.sh/techaro/anubis-external-auth:latest - name: www
imagePullPolicy: Always image: nginx:alpine
resources: resources:
limits: limits:
cpu: 500m memory: "128Mi"
memory: 128Mi cpu: "500m"
requests: requests:
cpu: 250m memory: "128Mi"
memory: 128Mi cpu: "500m"
env: ports:
- name: TARGET - containerPort: 80
value: " " volumeMounts:
- name: REDIRECT_DOMAINS - name: config
value: nginx.local.cetacean.club mountPath: /etc/nginx/conf.d
readOnly: true
- name: anubis
image: ttl.sh/techaro/anubis:latest
imagePullPolicy: Always
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 250m
memory: 128Mi
env:
- name: TARGET
value: " "
- name: REDIRECT_DOMAINS
value: nginx.local.cetacean.club
+13 -13
View File
@@ -9,17 +9,17 @@ metadata:
spec: spec:
ingressClassName: traefik ingressClassName: traefik
tls: tls:
- hosts: - hosts:
- nginx.local.cetacean.club - nginx.local.cetacean.club
secretName: nginx-local-cetacean-club-public-tls secretName: nginx-local-cetacean-club-public-tls
rules: rules:
- host: nginx.local.cetacean.club - host: nginx.local.cetacean.club
http: http:
paths: paths:
- pathType: Prefix - pathType: Prefix
path: "/" path: "/"
backend: backend:
service: service:
name: nginx-external-auth name: nginx-external-auth
port: port:
name: http name: http
+1 -1
View File
@@ -7,4 +7,4 @@ configMapGenerator:
- name: nginx-cfg - name: nginx-cfg
behavior: create behavior: create
files: files:
- ./conf.d/default.conf - ./conf.d/default.conf
+4 -4
View File
@@ -6,8 +6,8 @@ spec:
selector: selector:
app: nginx-external-auth app: nginx-external-auth
ports: ports:
- name: http - name: http
protocol: TCP protocol: TCP
port: 80 port: 80
targetPort: 80 targetPort: 80
type: ClusterIP type: ClusterIP
+8 -8
View File
@@ -4,20 +4,20 @@ set -euo pipefail
# Build container image # Build container image
( (
cd ../.. \ cd ../.. &&
&& npm ci \ npm ci &&
&& npm run container -- \ npm run container -- \
--docker-repo ttl.sh/techaro/anubis-external-auth \ --docker-repo ttl.sh/techaro/anubis \
--docker-tags ttl.sh/techaro/anubis-external-auth:latest --docker-tags ttl.sh/techaro/anubis:latest
) )
kubectl apply -k . kubectl apply -k .
echo "open https://nginx.local.cetacean.club, press control c when done" echo "open https://nginx.local.cetacean.club, press control c when done"
control_c() { control_c() {
kubectl delete -k . kubectl delete -k .
exit exit
} }
trap control_c SIGINT trap control_c SIGINT
sleep infinity sleep infinity