core-deployments/examples/example-deployment.yaml

97 lines
1.9 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:
2023-04-23 04:34:05 +02:00
# Use for Basic auth:
#nginx.org/basic-auth-secret: example-basic-auth-secret
# Use the following annotation if the backend only speaks HTTPS (fill out the service name accordingly):
#nginx.org/ssl-services: "example-service"
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
2023-04-23 04:34:05 +02:00
# Use for Basic auth:
#---
#kind: Secret
#metadata:
# name: example-basic-auth-secret
# namespace: example
#apiVersion: v1
#type: nginx.org/htpasswd
#stringData:
# htpasswd: |
#test:$apr1$2XMU6EMv$f1MJ7zxqTS079YsB7Z.CX/