50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: hello-gin
|
|
spec:
|
|
revisionHistoryLimit: 1 # prevent Kube from keeping last 20 revisions of ReplicaSets
|
|
# siin on deploymenti tase
|
|
replicas: 3
|
|
selector:
|
|
matchLabels:
|
|
app: hello-gin
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: hello-gin
|
|
customerName: cocacola
|
|
spec:
|
|
securityContext: # podi tase
|
|
fsGroup: 2000
|
|
runAsGroup: 3000
|
|
runAsUser: 1000
|
|
enableServiceLinks: false
|
|
imagePullSecrets:
|
|
- name: regcred
|
|
containers:
|
|
- name: hello-gin
|
|
image: harbor.codemowers.eu/{{ .Values.username }}/hello-gin:latest
|
|
resources:
|
|
requests: # Kube scheduleri jaoks, need peaks olema miinimumid
|
|
cpu: 2m # rate(container_cpu_usage_seconds_total{container="hello-gin"}[1m])
|
|
memory: 15Mi # container_memory_usage_bytes{container="hello-gin"}
|
|
limits:
|
|
cpu: 200m # CPU throttling
|
|
memory: 100Mi # OOM-kill tapab
|
|
securityContext: # container tase
|
|
readOnlyRootFilesystem: true
|
|
env:
|
|
- name: LOG_LEVEL
|
|
value: {{ .Values.logLevel }}
|
|
- name: USERNAME
|
|
value: {{ .Values.username }}
|
|
- name: MY_POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
ports:
|
|
- containerPort: 8000
|
|
name: http
|