1. Creating a Docker Image with Python Using docker library to build an image: python import docker client = docker.from_env() # Dockerfile content dockerfile_content = “”” FROM python:3.9-slim WORKDIR [ … ]
Category: Devops
Python commands for DevOps Phase 1
1. File Operations Read a file: python with open(‘file.txt’, ‘r’) as file: content = file.read() print(content) Write to a file: python with open(‘output.txt’, ‘w’) as file: file.write(‘Hello, DevOps!’) [ … ]
Ansible Interview Questions & Answers
Q1.Install and configure Ansible on the control-node control.realmX.example.com as follows: –> Install the required packages –> Create a static inventory file called /home/admin/ansible/inventory as follows: node1.realmX.example.com is a member of [ … ]
Ansible Project
LAMP Stack Setup and Web Application Deployment with Ansible 1. Playbook to Install and Configure Docker yaml — – name: Install and Configure Docker hosts: all become: yes tasks: – [ … ]
Ansible Phase 3
1. Playbook to Configure NTP (Network Time Protocol) yaml — – name: Configure NTP on Servers hosts: all become: yes tasks: – name: Install ntp package apt: name: ntp state: [ … ]
Ansible Phase 2
Ansible Playbooks 1. Simple Playbook to Install a Package yaml — – name: Install Nginx web server hosts: webservers become: yes tasks: – name: Install nginx package apt: name: nginx [ … ]
Ansible Phase 1
Ansible Definition Ansible is a powerful, open-source automation tool designed to streamline IT tasks such as configuration management, application deployment, and orchestration. Its core strengths are its simplicity, scalability, and [ … ]
Prometheus & Grafana
What is Monitoring? Monitoring is the continuous process of collecting, analyzing, and visualizing system and application metrics to understand the performance, availability, and overall health of your infrastructure. What is [ … ]
Kubernetes scenario-based questions
I. Core Kubernetes Concepts (50 Questions) A. Pods & Containers (10 Questions) 1. CrashLoopBackOff: A critical Pod is repeatedly restarting with CrashLoopBackOff. Describe your step-by-step debugging process. 2. ImagePullBackOff: A [ … ]
Kubernetes
1. Kubernetes Basics: ● Pods: Smallest deployable units in Kubernetes that can hold one or multiple containers. ● Nodes: Worker machines in Kubernetes. ● Clusters: A set of worker machines, [ … ]