Skip to content
This repository has been archived by the owner on Aug 19, 2021. It is now read-only.

Explore

mawinkler edited this page Jan 23, 2020 · 5 revisions

SSH to the instances

If you want to ssh to instances with a public ip simply do

ssh <Instance IP>

while being logged on to your Ansible server as the user ansible.

To ssh to a private instance you need to use the jumphost as a ssh proxy. The command for this is

ssh -o ProxyCommand="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -W %h:%p ansible@< Public Jumphost IP >" ansible@< Private Instance IP >

Remember:

  • SSH user is always ansible
  • Workload user is either root (RedHat) or ubuntu (Ubuntu)

Query Kubernetes

SSH to the kubernetes master and switch to user ubuntu.

ssh <Kubernetes Master Public IP>
sudo su - ubuntu

Afterwards you have admin privileges on the cluster.

Some basic queries:

kubectl get nodes
watch 'kubectl get pods --all-namespaces -o wide'
watch 'kubectl get pods -n smartcheck -o wide && echo && kubectl get services -n smartcheck -o wide'
kubectl get pods --all-namespaces -o wide --show-labels && \
    echo && kubectl get services --all-namespaces -o wide && \
    echo && kubectl get nodes
kubectl -n jenkins get pod --no-headers -o custom-columns=":metadata.name" | grep jenkins
Clone this wiki locally