No description
  • Jsonnet 73.7%
  • Shell 26.3%
Find a file
2022-07-07 16:45:43 +01:00
kube-prometheus Adjusted scaling mechanism to seconds per image 2021-02-26 12:46:07 +00:00
manifests Target latest 2021-10-01 13:39:35 +01:00
grafana-dashboard.json reorg 2021-02-23 15:05:51 +00:00
README.md Adjusted scaling mechanism to seconds per image 2021-02-26 12:46:07 +00:00
renovate.json Add renovate.json 2022-06-26 07:39:21 +00:00

Runbook

Deploy TKC:

kubectl apply -f manifests/tkc.yaml

Apply Pod Security Policy:

kubectl apply -f manifests/setup-k8s/psp.yaml

Create three namespaces:

kubectl create ns argocd
kubectl create ns monitoring
kubectl create ns flower-market

Deploy secret containing Docker Hub token for image pulls:

export UN=usernamehere
export PW=passwordhere
export EMAIL=emailhere

kubectl create secret docker-registry docker-creds \
  --namespace kube-system \
  --docker-username=$UN \
  --docker-password=$PW \
  --docker-email=$EMAIL

Create reg-cred operator to sync imagepullsecrets across namespaces (because, Docker...)

kubectl apply -f https://raw.githubusercontent.com/mylesagray/home-cluster-gitops/master/manifests/registry-creds/manifest.yaml

Create ClusterPullSecret CR

kubectl apply -f manifests/setup-k8s/regcred-crd.yaml

Define custom metric:

# Metric for this app is defined at 
# kube-prometheus/vendor/kube-prometheus/kube-prometheus-custom-metrics.libsonnet Lines 12-30

Build Prometheus:

cd kube-prometheus/
./build.sh

Deploy Prometheus:

kubectl apply -f manifests/setup-k8s/prometheus-rbac.yaml

kubectl apply -f kube-prometheus/manifests/setup

kubectl apply -f kube-prometheus/manifests

Deploy Application:

kubectl apply -f manifests/app

The HPA algorithm to calculate desired scale is:

desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]