-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdemoapp_volume.yaml
108 lines (108 loc) · 2.79 KB
/
demoapp_volume.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
kind: Service
apiVersion: v1
metadata:
name: demoapp-service
spec:
selector:
app: demoapp
ports:
- port: 80
targetPort: 8080 # Default port of nginx image
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: demoapp-deployment
spec:
selector:
matchLabels:
app: demoapp
replicas: 2 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: demoapp
spec:
containers:
- name: demoapp
image: mtr.devops.telekom.de/mcsps/nginx-non-root:latest
ports:
- containerPort: 8080
resources:
requests:
cpu: 10m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
capabilities: {}
privileged: false
runAsNonRoot: true
stdin: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /usr/share/nginx/html
name: demoapp-volume
initContainers:
- name: install
imagePullPolicy: IfNotPresent
image: mtr.devops.telekom.de/mcsps/nginx-non-root:latest
command: ['sh', '-c']
args: ['echo "<html><body><h1>Greetings from MCSPS</h1></body></html>" > /usr/share/nginx/html/index.html']
volumeMounts:
- mountPath: /usr/share/nginx/html
name: demoapp-volume
nodeSelector:
role: worker
restartPolicy: Always
terminationGracePeriodSeconds: 30
volumes:
- name: demoapp-volume
persistentVolumeClaim:
claimName: demoapp-volume
securityContext:
fsGroup: 0101
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: demoapp-volume
spec:
accessModes:
- ReadWriteOnce
dataSource: null
resources:
requests:
storage: 10Gi
storageClassName: sata
volumeMode: Filesystem
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: demoapp-ingress
annotations:
kubernetes.io/ingress.class: nginx
external-dns.alpha.kubernetes.io/target: # CHANGEME <cluster_name>.mcsps.telekomcloud.com
nginx.ingress.kubernetes.io/rewrite-target: /
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
rules:
- host: # CHANGEME <app_name>.mcsps.telekomcloud.com # change sub domain <demoapp> to something unique
http:
paths:
- backend:
service:
name: demoapp-service
port:
number: 80
path: /
pathType: ImplementationSpecific
tls:
- hosts:
- # CHANGEME <app_name>.mcsps.telekomcloud.com # change sub domain <demoapp> to something unique
secretName: demoapp-tls-secret