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:
|
2022-11-10 19:50:38 +01:00
|
|
|
name: example-ingress
|
|
|
|
namespace: example
|
2023-06-19 00:50:20 +02:00
|
|
|
#annotations:
|
2024-02-17 18:36:09 +01:00
|
|
|
# Use for Basic auth:
|
|
|
|
# traefik.ingress.kubernetes.io/router.middlewares: default-basic-auth@kubernetescrd
|
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
|