-
Notifications
You must be signed in to change notification settings - Fork 26
/
kubernetes.yml
171 lines (169 loc) · 3.19 KB
/
kubernetes.yml
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#example-service
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-service
spec:
selector:
matchLabels:
app: example-service
replicas: 2
template:
metadata:
labels:
app: example-service
spec:
containers:
- name: example-service
image: micronaut-kubernetes-example-service
imagePullPolicy: "Never"
volumeMounts:
- name: secrets
mountPath: "/etc/example-service/secrets"
readOnly: true
env:
- name: JAVA_TOOL_OPTIONS
value: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5004"
ports:
- name: http
containerPort: 8081
- name: "jvm-debug"
containerPort: 5004
volumes:
- name: secrets
secret:
secretName: mounted-secret
defaultMode: 256
---
apiVersion: v1
kind: Service
metadata:
name: example-service
labels:
foo: bar
spec:
selector:
app: example-service
type: LoadBalancer
ports:
- protocol: "TCP"
port: 8081
targetPort: 8081
#example-client
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-client
spec:
selector:
matchLabels:
app: example-client
template:
metadata:
labels:
app: example-client
spec:
containers:
- name: example-client
image: micronaut-kubernetes-example-client
imagePullPolicy: "Never"
env:
- name: JAVA_TOOL_OPTIONS
value: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
ports:
- name: http
containerPort: 8082
- name: "jvm-debug"
containerPort: 5005
---
apiVersion: v1
kind: Service
metadata:
name: example-client
spec:
selector:
app: example-client
type: LoadBalancer
ports:
- protocol: "TCP"
port: 8082
targetPort: 8082
#secure-deployment
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: secure-deployment
spec:
selector:
matchLabels:
app: secure-deployment
replicas: 1
template:
metadata:
labels:
app: secure-deployment
spec:
containers:
- name: secure-deployment
image: nginx
ports:
- containerPort: 80
---
#tag::port-name[]
apiVersion: v1
kind: Service
metadata:
name: secure-service-port-name
spec:
selector:
app: secure-deployment
type: NodePort
ports:
- port: 1234
protocol: TCP
name: https
#end::port-name[]
---
#tag::port-number[]
apiVersion: v1
kind: Service
metadata:
name: secure-service-port-number
spec:
selector:
app: secure-deployment
type: NodePort
ports:
- port: 443
protocol: TCP
#end::port-number[]
---
#tag::labels[]
apiVersion: v1
kind: Service
metadata:
name: secure-service-labels
labels:
secure: "true"
spec:
selector:
app: secure-deployment
type: NodePort
ports:
- port: 1234
protocol: TCP
#end::labels[]
---
apiVersion: v1
kind: Service
metadata:
name: non-secure-service
spec:
selector:
app: secure-deployment
type: NodePort
ports:
- port: 1234
protocol: TCP