core-deployments/examples/example-deployment.yaml

90 lines
1.7 KiB
YAML
Raw Normal View History

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
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: letsencrypt-prod
acme.cert-manager.io/http01-edit-in-place: "true"
ingress.kubernetes.io/ssl-redirect: "false"
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
tls:
- hosts:
- example.apps.yolokube.de
secretName: example-cert