What is Ansible Ansible is a configuration management, deployment and orchestration tool. Features of Ansible Simple: Simple to install and setup Built on top of Python: Provides lot of python functionality. SSH for Secure Connection Agentless Platform independent Push Based unlike Puppet and Chef Install and Setup: Install Ansible via pip install ansible Generate SSH-Key on Master node using ssh-keygen -t rsa Goto /root/.ssh and copy id_rsa.pub key to all other nodes and Run ssh-copy-id <Destination IP Address> By default, Ansible configuration file is located under /etc/ansible/ansible.cfg and inventory file is pointed to /etc/ansible/hosts ansible --version shows the version of ansible is using and the configuration file it is pointing to. We can create our own inventory file filename - inventory.ini [web_servers] web01 web02 [db_servers] db01 db02 Create a ansible.cfg file under working directory or edit the default configuration under /etc/ansible and update
Kubernetes Logging /var/log/containers ==> default log location on nodes. Last two log files are retained on the node. In order to aggregate logs from varies sources like pods, containers , nodes, control plane and events we use fluentd and elastic search for searching and grafana for visualization. Logging Architecture - Nodes: Kubectl logs $POD_NAME ==> accessing pod logs Kubectl logs $POD_NAME -c $CONTAINER_NAME ==> specific container inside a pod. Kubectl logs $POD_NAME --all-containers Kubectl logs $POD_NAME --all-containers --follow ==> real time logs Kubectl logs --selector app=backend --all-containers When an api server is down then in that case we cannot use kubectl get logs instead we can log in to a node and directly run docker logs $CONTAINER_NAME What if docker is not available? tail -f /var/log/containers/$CONTAINER_NAME$CONTAINER_ID Logging Architecture - Control Plane: Get a list of control plane pods using a selector kubectl get pods --namespace kube-syst