11Kubernetes deployment strategies
22================================
33
4- > In Kubernetes there is few different way to release an application, you have
4+ > In Kubernetes there are a few different ways to release an application, you have
55 to carefully choose the right strategy to make your infrastructure resilient.
66
77- [ recreate] ( recreate/ ) : terminate the old version and release the new one
@@ -32,48 +32,44 @@ Before experimenting, checkout the following resources:
3232## Getting started
3333
3434These examples were created and tested on [ Minikube] ( http://github.com/kubernetes/minikube )
35- running with Kubernetes v1.10.0.
35+ running with Kubernetes v1.25.2 and [ Rancher Desktop] ( https://rancherdesktop.io/ ) running
36+ with Kubernetes 1.23.6.
37+
38+ On MacOS the hypervisor VM does not have external connectivity so docker image pulls
39+ will fail. To resolve this, install another driver such as
40+ [ VirtualBox] ( https://www.virtualbox.org/ ) and add ` --vm-driver virtualbox `
41+ to the command to be able to pull images.
3642
3743```
38- $ minikube start --kubernetes-version v1.10.0 --memory 8192 --cpus 2
44+ $ minikube start --kubernetes-version v1.25.2 --memory 8192 --cpus 2
3945```
4046
41-
4247## Visualizing using Prometheus and Grafana
4348
4449The following steps describe how to setup Prometheus and Grafana to visualize
4550the progress and performance of a deployment.
4651
47- ### Install Helm
52+ ### Install Helm3
4853
49- To install Helm , follow the instructions provided on their
54+ To install Helm3 , follow the instructions provided on their
5055[ website] ( https://github.com/kubernetes/helm/releases ) .
5156
52- ```
53- $ helm init
54- ```
55-
5657### Install Prometheus
5758
5859```
59- $ helm install \
60- --namespace=monitoring \
61- --name=prometheus \
62- --version=7.0.0 \
63- stable/prometheus
60+ $ helm install prometheus prometheus-community/prometheus \
61+ --create-namespace --namespace=monitoring
6462```
6563
6664### Install Grafana
6765
6866```
69- $ helm install \
67+ $ helm install grafana \
7068 --namespace=monitoring \
71- --name=grafana \
72- --version=1.12.0 \
7369 --set=adminUser=admin \
7470 --set=adminPassword=admin \
7571 --set=service.type=NodePort \
76- stable /grafana
72+ grafana /grafana
7773```
7874
7975### Setup Grafana
@@ -95,12 +91,16 @@ Url: http://prometheus-server
9591Access: Server
9692```
9793
98- Create a dashboard with a Graph. Use the following query:
94+ Create a dashboard with a Time series or import
95+ the [ JSON export] ( grafana-dashboard.json ) . Use the following query:
9996
10097```
101- sum(rate(http_requests_total{app="my-app"}[5m ])) by (version)
98+ sum(rate(http_requests_total{app="my-app"}[2m ])) by (version)
10299```
103100
101+ Since we installed Prometheus with default settings, it is using the default scrape
102+ interval of ` 1m ` so the range cannot be lower than that.
103+
104104To have a better overview of the version, add ` {{version}} ` in the legend field.
105105
106106#### Example graph
0 commit comments