forked from sebastian-colomar/phpinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkube-compose-po-cm.yaml
61 lines (61 loc) · 1.48 KB
/
kube-compose-po-cm.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
#########################################################################
# Copyright (C) 2020 Sebastian Francisco Colomar Bauza #
# SPDX-License-Identifier: GPL-2.0-only #
#########################################################################
# docker run --detach --entrypoint php --name phpinfo --publish 8080 --user nobody:nobody --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: v1
kind: ConfigMap
metadata:
name: phpinfo-cm
data:
index.php: <?php phpinfo();?>
---
apiVersion: v1
kind: Pod
metadata:
name: phpinfo-po-cm
labels:
app: phpinfo-po-cm
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/index.php
readOnly: true
subPath: index.php
workingDir: /src/
volumes:
- name: phpinfo-volume
configMap:
defaultMode: 0444
items:
- key: index.php
mode: 0444
path: index.php
name: phpinfo-cm
---
apiVersion: v1
kind: Service
metadata:
name: phpinfo-po-cm
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: phpinfo-po-cm
type: NodePort
---