<aside>📌 Command-first runbook for customer deployment calls. Replace placeholders before running. For production environments, run changes through the customer-approved change process.
</aside>
Run:
export KUBECONFIG=/path/to/customer-kubeconfig
export KUBE_CONTEXT=<customer-context>
kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" config current-context
kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" get nodes
kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" get namespace monitoring || kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" create namespace monitoring
Run:
git clone --depth=1 --branch <release-branch> <https://github.com/devsentient/monorepo.git> /tmp/monorepo
cd /tmp/monorepo/stack-components/grafana/helm
helm dependency update .
Run:
kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" create secret generic grafana-admin -n monitoring --from-literal=admin-user='admin' --from-literal=admin-password='<strong-password>'
Run:
cat > /tmp/grafana-values.yaml <<'EOF_VALUES'
grafana:
admin:
existingSecret: grafana-admin
persistence:
enabled: true
size: 10Gi
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: <http://prometheus-server.monitoring.svc.cluster.local>
isDefault: true
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: default
folder: Shakudo
type: file
options:
path: /var/lib/grafana/dashboards/default
ingress:
enabled: true
host: grafana.<customer-domain>
EOF_VALUES
Run:
helm --kubeconfig "$KUBECONFIG" --kube-context "$KUBE_CONTEXT" upgrade --install grafana /tmp/monorepo/stack-components/grafana/helm \\
--namespace monitoring \\
--create-namespace \\
--values /tmp/grafana-values.yaml \\
--timeout 15m \\
--wait
Run:
helm --kubeconfig "$KUBECONFIG" --kube-context "$KUBE_CONTEXT" status grafana -n monitoring
kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" get pods,svc,pvc,ingress,virtualservice -n monitoring
kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" get events -n monitoring --sort-by=.lastTimestamp | tail -n 60
kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" logs -n monitoring -l app.kubernetes.io/instance=grafana --tail=100
Run:
kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" port-forward -n monitoring svc/grafana 3000:80
# In another terminal:
curl <http://localhost:3000/api/health>
Run:
helm --kubeconfig "$KUBECONFIG" --kube-context "$KUBE_CONTEXT" history grafana -n monitoring
helm --kubeconfig "$KUBECONFIG" --kube-context "$KUBE_CONTEXT" rollback grafana <REVISION> -n monitoring
kubectl --kubeconfig "$KUBECONFIG" --context "$KUBE_CONTEXT" rollout status deployment/grafana -n monitoring || true