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" -i inventory.yml | |
k8s | CHANGED | rc=0 >> | |
LAST SEEN TYPE REASON OBJECT MESSAGE | |
23m Normal Pulling pod/busybox Pulling image "busybox" | |
23m Normal Created pod/busybox Created container busy | |
23m Normal Started pod/busybox Started container busy | |
23m Normal Pulled pod/busybox Successfully pulled image "busybox" in 1.441018829s |
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 cluster-info" -i inventory.yml | |
k8s | CHANGED | rc=0 >> | |
Kubernetes control plane is running at https://192.168.1.123:6443 | |
CoreDNS is running at https://192.168.1.123:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy | |
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. |
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 -o wide" -i inventory.yml | |
k8s | CHANGED | rc=0 >> | |
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME | |
kubernetes-cluster Ready control-plane 3d1h v1.24.2 192.168.1.132 <none> CentOS Linux 7 (Core) 3.10.0-1160.66.1.el7.x86_64 containerd://1.6.6 | |
kubernetes-node01 Ready <none> 3d1h v1.24.1 192.168.1.122 <none> CentOS Linux 7 (Core) 3.10.0-1160.66.1.el7.x86_64 containerd://1.6.6 | |
kubernetes-node02 Ready <none> 3d1h v1.24.1 192.168.1.123 <none> CentOS Linux 7 (Core) 3.10.0-1160.66.1.el7.x86_64 containerd://1.6.6 | |
kubernetes-node03 Ready <none> 3d1h v1.24.1 192.168.1.125 <none> CentOS Linux 7 (Core) 3.10.0-1160.66.1.el7.x86_64 containerd://1.6.6 |
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 nodes -o wide | |
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME | |
kubernetes-cluster Ready control-plane 3d1h v1.24.2 192.168.1.129 <none> CentOS Linux 7 (Core) 3.10.0-1160.66.1.el7.x86_64 containerd://1.6.6 | |
kubernetes-node01 Ready <none> 3d1h v1.24.1 192.168.1.132 <none> CentOS Linux 7 (Core) 3.10.0-1160.66.1.el7.x86_64 containerd://1.6.6 | |
kubernetes-node02 Ready <none> 3d1h v1.24.1 192.168.1.123 <none> CentOS Linux 7 (Core) 3.10.0-1160.66.1.el7.x86_64 containerd://1.6.6 | |
kubernetes-node03 Ready <none> 3d1h v1.24.1 192.168.1.122 <none> CentOS Linux 7 (Core) 3.10.0-1160.66.1.el7.x86_64 containerd://1.6.6 |
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 componentstatuses | |
Warning: v1 ComponentStatus is deprecated in v1.19+ | |
NAME STATUS MESSAGE ERROR | |
scheduler Healthy ok | |
controller-manager Healthy ok | |
etcd-0 Healthy {"health":"true","reason":""} |
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 cluster-info | |
Kubernetes control plane is running at https://192.168.1.129:6443 | |
CoreDNS is running at https://192.168.1.129:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy | |
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. |
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 2d23h v1.24.2 | |
kubernetes-node01 Ready <none> 2d23h v1.24.1 | |
kubernetes-node02 Ready <none> 2d23h v1.24.1 | |
kubernetes-node03 Ready <none> 2d23h 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
# kubectl get events --all-namespaces --sort-by=.metadata.creationTimestamp | |
NAMESPACE LAST SEEN TYPE REASON OBJECT MESSAGE | |
default 59m Normal Pulling pod/busybox Pulling image "busybox" | |
default 59m Normal Created pod/busybox Created container busy | |
default 59m Normal Started pod/busybox Started container busy | |
default 59m Normal Pulled pod/busybox Successfully pulled image "busybox" in 1.606189033s | |
kube-system 4m55s Warning Unhealthy pod/kube-apiserver-kubernetes-cluster Liveness probe failed: HTTP probe failed with statuscode: 500 | |
kube-system 62s Warning Unhealthy pod/kube-apiserver-kubernetes-cluster Readiness probe failed: HTTP probe failed |
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 54m Normal Pulling pod/busybox Pulling image "busybox" | |
default 54m Normal Created pod/busybox Created container busy | |
default 54m Normal Started pod/busybox Started container busy | |
default 54m Normal Pulled pod/busybox Successfully pulled image "busybox" in 1.606189033s | |
kube-system 63s Warning Unhealthy pod/kube-apiserver-kubernetes-cluster Liveness probe failed: HTTP probe failed with statuscode: 500 | |
kube-system 61s Warning Unhealthy pod/kube-apiserver-kubernetes-cluster Readiness probe failed: HTTP probe failed with statuscode: 500 | |
kube-system 75s Warning Unhealthy pod/etcd-kubernetes-cluster |
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 -- | |
--allow-missing-template-keys --client-key --kustomize --password --server-print --token | |
--as --cluster --label-columns --profile --show-kind --user | |
--as-group --context --log-flush-frequency --profile-output --show-labels --username | |
--as-uid --field-selector --match-server-version --raw --show-managed-fields --v | |
--cache-dir --filename --namespace --recursive --sort-by --vmodule | |
--certificate-authority --ignore-not-found --no-headers --request-timeout --subresource --warnings-as |