forked from sebastian-colomar/phpinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kube-compose-deploy-echo.yaml
72 lines (72 loc) · 1.99 KB
/
kube-compose-deploy-echo.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
#########################################################################
# Copyright (C) 2020 Sebastian Francisco Colomar Bauza #
# SPDX-License-Identifier: GPL-2.0-only #
#########################################################################
# docker service create --detach --entrypoint php --name phpinfo --publish 8080 --user nobody:nogroup --volume ${PWD}/src/index.php:/src/index.php:ro --workdir /src/ docker.io/library/php:alpine -f index.php -S 0.0.0.0:8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: phpinfo-deploy-echo
spec:
replicas: 2
selector:
matchLabels:
app: phpinfo-deploy-echo
template:
# HERE COMES THE MANIFEST OF THE POD
metadata:
# BUT WE REMOVE THE ORIGINAL NAME OF THE POD
#name: phpinfo-rc-echo
labels:
app: phpinfo-deploy-echo
spec:
containers:
- name: phpinfo-container
args:
- -f
- index.php
- -S
- 0.0.0.0:8080
command:
- php
image: docker.io/library/php:alpine
securityContext:
runAsGroup: 65534
runAsUser: 65534
volumeMounts:
- name: phpinfo-volume
mountPath: /src/
readOnly: true
workingDir: /src/
initContainers:
- name: phpinfo-init-container
args:
- echo '<?php phpinfo();?>' 1> index.php
command:
- sh
- -c
image: docker.io/library/busybox:latest
volumeMounts:
- name: phpinfo-volume
mountPath: /src/
readOnly: false
workingDir: /src/
volumes:
- name: phpinfo-volume
emptyDir:
medium: Memory
sizeLimit: 1Mi
---
apiVersion: v1
kind: Service
metadata:
name: phpinfo-deploy-echo
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: phpinfo-deploy-echo
type: NodePort
---