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
# kubectl get events --all-namespaces --sort-by=.metadata.creationTimestamp | |
NAMESPACE LAST SEEN TYPE REASON OBJECT MESSAGE | |
default 40m Normal Pulling pod/busybox Pulling image "busybox" | |
default 40m Normal Created pod/busybox Created container busy | |
default 40m Normal Started pod/busybox Started container busy | |
default 60m Warning NodeNotReady pod/busybox Node is not ready | |
kube-system 60m Warning NodeNotReady pod/kube-proxy-qgq98 Node is not ready | |
default 60m Normal NodeNotReady node/kubernetes-node03 Node kubernetes-node03 status is now: NodeNotReady | |
kube-system 60m Warning NodeNotReady pod/weave-net-md4dr Node is not ready | |
default 62m Normal NodeHasNoDiskPressure node/ku |
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 shell -a "kubectl get nodes" -i inventory.yml | |
k8s | CHANGED | rc=0 >> | |
NAME STATUS ROLES AGE VERSION | |
kubernetes-cluster Ready control-plane 21h v1.24.1 | |
kubernetes-node01 Ready <none> 21h v1.24.1 | |
kubernetes-node02 Ready <none> 20h v1.24.1 | |
kubernetes-node03 Ready <none> 21h v1.24.1 |
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 kubernetes -m ping -i inventory.yml | |
k8s | SUCCESS => { | |
"ansible_facts": { | |
"discovered_interpreter_python": "/usr/bin/python" | |
}, | |
"changed": false, | |
"ping": "pong" | |
} | |
node3 | SUCCESS => { | |
"ansible_facts": { |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: grafana | |
name: grafana | |
namespace: devops-monitoring | |
spec: | |
progressDeadlineSeconds: 600 | |
replicas: 1 |
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
# kubectl get services -n devops-monitoring grafana | |
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | |
grafana NodePort 10.97.192.171 <none> 3000:30127/TCP 8m22s |
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
# kubectl -n devops-monitoring expose deployment grafana --type="NodePort" --port 3000 | |
service/grafana exposed |
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
# kubectl get deployments.apps -n devops-monitoring | |
NAME READY UP-TO-DATE AVAILABLE AGE | |
grafana 1/1 1 1 11h |
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
# kubectl get namespaces | |
NAME STATUS AGE | |
default Active 10d | |
devops Active 38h | |
devops-monitoring Active 11h | |
infrastruture Active 37h | |
kube-node-lease Active 10d | |
kube-public Active 10d | |
kube-system Active 10d |
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
# kubectl create deployment grafana -n devops-monitoring --image=docker.io/grafana/grafana:latest | |
deployment.apps/grafana created |
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
# kubectl create namespace devops-monitoring | |
namespace/devops-monitoring created |