-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s.yml
116 lines (112 loc) · 3.67 KB
/
k8s.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: fuzzly-backend
spec:
replicas: 1
selector:
matchLabels:
app: fuzzly-backend
template:
metadata:
labels:
app: fuzzly-backend
spec:
containers:
- name: fuzzly-backend
image: us-central1-docker.pkg.dev/kheinacom/fuzzly-repo/fuzzly-backend@sha256:314b48c1d1928f6f329bbcf138f40e02a5450daca6cb573ae48ee9f16dd605fe
env:
- name: pod_ip
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: pod_name
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: pod_host
value: "*.fuzz.ly"
- name: kh_aes
valueFrom:
secretKeyRef:
name: kh-aes
key: value
- name: kh_ed25519
valueFrom:
secretKeyRef:
name: kh-ed25519
key: value
volumeMounts:
- name: fuzzly-credentials
mountPath: /credentials/
readOnly: true
- name: cert
mountPath: /etc/certs/
readOnly: true
resources:
limits:
cpu: "1"
memory: 4Gi
requests:
cpu: "1"
memory: 2Gi
livenessProbe:
httpGet:
path: /health/liveness
port: 443
scheme: HTTPS
initialDelaySeconds: 15
periodSeconds: 30
readinessProbe:
httpGet:
path: /health/readiness
port: 443
scheme: HTTPS
initialDelaySeconds: 15
periodSeconds: 30
- name: cloud-sql-proxy
# It is recommended to use the latest version of the Cloud SQL Auth Proxy
# Make sure to update on a regular schedule!
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.11.4
args:
# If connecting from a VPC-native GKE cluster, you can use the
# following flag to have the proxy connect over private IP
# - "--private-ip"
# Enable structured logging with LogEntry format:
- "--structured-logs"
# Replace DB_PORT with the port the proxy should listen on
- "--port=5432"
- "kheinacom:us-east1:kheina-1"
# This flag specifies where the service account key can be found
- "--credentials-file=/secrets/service_account.json"
securityContext:
# The default Cloud SQL Auth Proxy image runs as the
# "nonroot" user and group (uid: 65532) by default.
runAsNonRoot: true
volumeMounts:
- name: sqlsa
mountPath: /secrets/
readOnly: true
# Resource configuration depends on an application's requirements. You
# should adjust the following values based on what your application
# needs. For details, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
requests:
# The proxy's memory use scales linearly with the number of active
# connections. Fewer open connections will use less memory. Adjust
# this value based on your application's requirements.
memory: "1Gi"
# The proxy's CPU use scales linearly with the amount of IO between
# the database and the application. Adjust this value based on your
# application's requirements.
cpu: "1"
volumes:
- name: sqlsa
secret:
secretName: sql-service-account
- name: fuzzly-credentials
secret:
secretName: credentials
- name: cert
secret:
secretName: cert