2022-11-10 19:50:38 +01:00
|
|
|
### do not deploy
|
|
|
|
### you can copy and paste this, rename all occurences of "example"
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Namespace
|
|
|
|
metadata:
|
|
|
|
name: example
|
2022-09-09 15:09:29 +02:00
|
|
|
---
|
2023-02-01 01:33:16 +01:00
|
|
|
apiVersion: v1
|
|
|
|
kind: PersistentVolumeClaim
|
|
|
|
metadata:
|
|
|
|
name: example-pvc
|
|
|
|
namespace: example
|
|
|
|
spec:
|
|
|
|
accessModes:
|
|
|
|
- ReadWriteOnce
|
|
|
|
volumeMode: Filesystem
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 8Gi
|
|
|
|
---
|
2022-09-09 15:09:29 +02:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
2022-11-10 19:50:38 +01:00
|
|
|
name: example-deployment
|
|
|
|
namespace: example
|
2022-09-09 15:09:29 +02:00
|
|
|
labels:
|
2022-11-10 19:50:38 +01:00
|
|
|
app: example
|
2022-09-09 15:09:29 +02:00
|
|
|
spec:
|
|
|
|
replicas: 3
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2022-11-10 19:50:38 +01:00
|
|
|
app: example
|
2022-09-09 15:09:29 +02:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2022-11-10 19:50:38 +01:00
|
|
|
app: example
|
2022-09-09 15:09:29 +02:00
|
|
|
spec:
|
|
|
|
containers:
|
2022-11-10 19:50:38 +01:00
|
|
|
- name: example
|
2022-09-09 15:09:29 +02:00
|
|
|
image: testcontainers/helloworld
|
|
|
|
ports:
|
|
|
|
- containerPort: 8080
|
2023-02-01 01:33:16 +01:00
|
|
|
volumeMounts:
|
|
|
|
- mountPath: "/var/www/html"
|
|
|
|
name: example-volume
|
|
|
|
volumes:
|
|
|
|
- name: example-volume
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: example-pvc
|
2022-09-09 15:09:29 +02:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2022-11-10 19:50:38 +01:00
|
|
|
name: example-service
|
|
|
|
namespace: example
|
2022-09-09 15:09:29 +02:00
|
|
|
spec:
|
|
|
|
selector:
|
2022-11-10 19:50:38 +01:00
|
|
|
app: example
|
2022-09-09 15:09:29 +02:00
|
|
|
ports:
|
|
|
|
- protocol: TCP
|
|
|
|
port: 80
|
|
|
|
targetPort: 8080
|
|
|
|
---
|
|
|
|
apiVersion: networking.k8s.io/v1
|
|
|
|
kind: Ingress
|
|
|
|
metadata:
|
2024-05-28 17:42:47 +02:00
|
|
|
annotations:
|
|
|
|
kubernetes.io/tls-acme: "true"
|
2024-05-28 17:51:00 +02:00
|
|
|
# Use for Basic auth:
|
|
|
|
# traefik.ingress.kubernetes.io/router.middlewares: traefik-basic-auth@kubernetescrd
|
2024-09-29 14:10:34 +02:00
|
|
|
# Use for authentik SSO:
|
|
|
|
# traefik.ingress.kubernetes.io/router.middlewares: authentik-authentik@kubernetescrd
|
2022-11-10 19:50:38 +01:00
|
|
|
name: example-ingress
|
|
|
|
namespace: example
|
2022-09-09 15:09:29 +02:00
|
|
|
spec:
|
|
|
|
rules:
|
2022-11-10 19:50:38 +01:00
|
|
|
- host: "example.apps.yolokube.de"
|
2022-09-09 15:09:29 +02:00
|
|
|
http:
|
|
|
|
paths:
|
|
|
|
- pathType: Prefix
|
|
|
|
path: "/"
|
|
|
|
backend:
|
|
|
|
service:
|
2022-11-10 19:50:38 +01:00
|
|
|
name: example-service
|
2022-09-09 15:09:29 +02:00
|
|
|
port:
|
2022-11-10 19:50:38 +01:00
|
|
|
number: 80
|
2024-05-28 17:42:47 +02:00
|
|
|
tls:
|
|
|
|
- hosts:
|
|
|
|
- example.apps.yolokube.de
|
|
|
|
secretName: example-tls-key
|