-
Notifications
You must be signed in to change notification settings - Fork 74
/
deploy_secure_template.yaml
95 lines (94 loc) · 2.41 KB
/
deploy_secure_template.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
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: v1
kind: Service
metadata:
name: bookstore
spec:
ports:
- name: endpoints-http
port: 80
protocol: TCP
targetPort: 8080
- name: endpoints-status
port: 8090
protocol: TCP
targetPort: 8090
selector:
app: bookstore
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookstore
spec:
replicas: 1
selector:
matchLabels:
app: bookstore
template:
metadata:
labels:
app: bookstore
spec:
volumes:
- emptyDir:
medium: Memory
name: var-log-for-nginx
- emptyDir:
medium: Memory
name: var-cache-for-nginx
- emptyDir:
medium: Memory
name: home-for-nginx
- name: sa-file
secret:
secretName: sa-file
containers:
# [START esp]
- name: esp
image: $ESP_IMAGE
args: [
"--http_port=8080",
"--backend=127.0.0.1:8081",
"--service=${ENDPOINT_SERVICE}",
"--rollout_strategy=managed",
"--service_account_key=/etc/safile/service_account_key.json",
]
# [END esp]
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8090
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /var/log
name: var-log-for-nginx
readOnly: false
- mountPath: /var/cache
name: var-cache-for-nginx
readOnly: false
- mountPath: /home/nginx
name: home-for-nginx
readOnly: false
- mountPath: /etc/safile
name: sa-file
readOnly: true
- name: bookstore
image: $BACKEND_IMAGE
ports:
- containerPort: 8081