Files
hello-gin/templates/deployment.yaml
2024-08-22 14:54:06 +03:00

49 lines
1.4 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
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: USERNAME
value: {{ .Values.username }}
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
ports:
- containerPort: 8000
name: http
- containerPort: 8080
name: metrics