Cleanups
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
---
|
||||
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:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/arch
|
||||
operator: In
|
||||
values:
|
||||
- amd64
|
||||
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
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: hello-gin
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: shared
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
external-dns.alpha.kubernetes.io/target: traefik.codemowers.ee
|
||||
spec:
|
||||
rules:
|
||||
- host: hello-{{ .Values.username }}.codemowers.ee
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/api/v1/gin"
|
||||
backend:
|
||||
service:
|
||||
name: hello-gin
|
||||
port:
|
||||
name: http
|
||||
tls:
|
||||
- hosts:
|
||||
- "*.codemowers.ee"
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: hello-gin
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: hello-gin
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: prometheus
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: default
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/instance: shared
|
||||
app.kubernetes.io/name: traefik
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PodMonitor
|
||||
metadata:
|
||||
name: hello-gin
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: hello-gin
|
||||
podMetricsEndpoints:
|
||||
- targetPort: 8000
|
||||
podTargetLabels:
|
||||
- customerName
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: hello-gin
|
||||
spec:
|
||||
groups:
|
||||
- name: hello-gin
|
||||
rules:
|
||||
- alert: GinIsOutOfBottle
|
||||
expr: gin_avg_latency > 5
|
||||
for: 2m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: Gin average response latency is high (>5sec)
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hello-gin
|
||||
labels:
|
||||
app: hello-gin
|
||||
spec:
|
||||
selector:
|
||||
app: hello-gin
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8000
|
||||
name: http
|
||||
Reference in New Issue
Block a user