This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# helm repo update | |
Hang tight while we grab the latest from your chart repositories... | |
...Successfully got an update from the "prometheus-community" chart repository | |
...Successfully got an update from the "grafana" chart repository | |
Update Complete. ⎈Happy Helming!⎈ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# helm repo list | |
NAME URL | |
prometheus-community https://prometheus-community.github.io/helm-charts | |
grafana https://grafana.github.io/helm-charts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
helm repo add grafana https://grafana.github.io/helm-charts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helm completion bash > /etc/bash_completion.d/helm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# helm help | |
The Kubernetes package manager | |
Common actions for Helm: | |
- helm search: search for charts | |
- helm pull: download a chart to your local directory to view | |
- helm install: upload the chart to Kubernetes | |
- helm list: list releases of charts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | |
$ chmod 700 get_helm.sh | |
$ ./get_helm.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gather_facts: false | |
tasks: | |
- name: Checking the Kubernetes Nodes | |
shell: | |
kubectl get nodes | |
register: results | |
- name: Print the Kubernetes Nodes | |
debug: | |
msg: "{{ results.stdout.split('\n') }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Author: Amaury Borges Souza | |
# Description: Kubernetes Cluster Health Check | |
# Usage: ansible-playbook kubernetes_health_check.yml -i inventory.yml | |
# Ansible_version: ansible 2.10.8 | |
# License: GNU General Public License | |
- name: Kubernetes Cluster Health Check | |
hosts: k8s | |
become: true | |
gather_facts: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ansible k8s -m command -a "kubectl get componentstatuses" -i inventory.yml | |
k8s | CHANGED | rc=0 >> | |
NAME STATUS MESSAGE ERROR | |
controller-manager Healthy ok | |
scheduler Healthy ok | |
etcd-0 Healthy {"health":"true","reason":""} Warning: v1 ComponentStatus is deprecated in v1.19+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ansible k8s -m command -a " kubectl get events --all-namespaces --sort-by=.metadata.creationTimestamp" -i inventory.yml | |
k8s | CHANGED | rc=0 >> | |
NAMESPACE LAST SEEN TYPE REASON OBJECT MESSAGE | |
default 42m Normal Pulling pod/busybox Pulling image "busybox" | |
default 42m Normal Created pod/busybox Created container busy | |
default 42m Normal Started pod/busybox Started container busy | |
default 42m Normal Pulled pod/busybox Successfully pulled image "busybox" in 1.441018829s | |
kube-system 12m Normal ScalingReplicaSet deployment/metrics-server Scaled up replica set metrics-server-678f4bf65b to 1 | |
kube-system 12m Normal SuccessfulCreate replicaset/metrics-server-678f4bf65b Created pod: metrics-server-67 |