core-deployments/examples/example-deployment.yaml
Aaron Riedel c033d08c3b
All checks were successful
continuous-integration/drone/push Build is passing
example-deployment: move annotations to prevent confusion
2024-05-28 17:51:00 +02:00

89 lines
1.7 KiB
YAML

### do not deploy
### you can copy and paste this, rename all occurences of "example"
---
apiVersion: v1
kind: Namespace
metadata:
name: example
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: example-pvc
namespace: example
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 8Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-deployment
namespace: example
labels:
app: example
spec:
replicas: 3
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
containers:
- name: example
image: testcontainers/helloworld
ports:
- containerPort: 8080
volumeMounts:
- mountPath: "/var/www/html"
name: example-volume
volumes:
- name: example-volume
persistentVolumeClaim:
claimName: example-pvc
---
apiVersion: v1
kind: Service
metadata:
name: example-service
namespace: example
spec:
selector:
app: example
ports:
- protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/tls-acme: "true"
# Use for Basic auth:
# traefik.ingress.kubernetes.io/router.middlewares: traefik-basic-auth@kubernetescrd
name: example-ingress
namespace: example
spec:
rules:
- host: "example.apps.yolokube.de"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: example-service
port:
number: 80
tls:
- hosts:
- example.apps.yolokube.de
secretName: example-tls-key