mirror of
https://github.com/mylesagray/a-new-hope-app
synced 2026-02-28 19:42:12 +00:00
No description
- Jsonnet 73.7%
- Shell 26.3%
|
|
||
|---|---|---|
| kube-prometheus | ||
| manifests | ||
| grafana-dashboard.json | ||
| README.md | ||
| renovate.json | ||
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 )]