forked from snyk-labs/docker-goof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb_deployment.yaml
113 lines (113 loc) · 2.17 KB
/
web_deployment.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
109
110
111
112
113
apiVersion: apps/v1
kind: Deployment
metadata:
name: 'web'
spec:
replicas: 1
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- image: "piesecurity/apache-struts2-cve-2017-5638:latest"
imagePullPolicy: Always
name: web
securityContext:
# runAsUser: 1000
privileged: true
ports:
- name: http
containerPort: 8080
protocol: TCP
serviceAccountName: web-service-account
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: 'web'
labels:
app: web
spec:
type: "NodePort"
ports:
- name: http
port: 80
nodePort: 30004
protocol: TCP
targetPort: 8080
selector:
app: "web"
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: web-service-account
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: web-role
rules:
- apiGroups:
- ""
resources:
- secrets
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: web-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: web-role
subjects:
- kind: ServiceAccount
name: web-service-account
---
apiVersion: v1
kind: Secret
metadata:
name: connectionstrings
data:
sql: U2VydmVyPW15c3Fsc2VydmVyO0RhdGFiYXNlPWRiO1VzZXIgSWQ9YWRtaW47UGFzc3dvcmQ9UEBzc3dvcmQ7
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-service-account
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-clusterrolebinding
subjects:
- kind: ServiceAccount
name: admin-service-account
namespace: default
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Secret
metadata:
name: admin-service-account-token
annotations:
kubernetes.io/service-account.name: admin-service-account
type: kubernetes.io/service-account-token
---
apiVersion: v1
kind: Secret
metadata:
name: web-service-account-token
annotations:
kubernetes.io/service-account.name: web-service-account
type: kubernetes.io/service-account-token