To ace your 𝐢𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰𝐬 for a DevOps Engineer role ,following Linux related Hardware commands, Data information, Process mgmt., files mgmt, search patterns and packages commands you should be aware of:
𝟏: 𝐇𝐀𝐑𝐃𝐖𝐀𝐑𝐄 𝐈𝐍𝐅𝐎𝐑𝐌𝐀𝐓𝐈𝐎𝐍:
-cat /proc/cpuinfo # Display CPU information
-cat /proc/meminfo # Display memory information
-free -h # Display free and used memory ( -hfor human readable, -mfor MB, -gfor GB.)
-lspci -tv # Display PCI devices
-lsusb -tv # Display USB devices
-dmidecode # Display DMI/SMBIOS (hardware info) from the BIOS
-hdparm -i /dev/sda # Show info about disk sda
-hdparm -tT /dev/sda # Perform a read speed test on disk sda
𝟐. 𝐌𝐀𝐍𝐈𝐏𝐔𝐋𝐀𝐓𝐈𝐍𝐆 𝐃𝐀𝐓𝐀 :
-awk # Pattern scanning and processing language
-perl # Data manipulation language
-cmp # Compare the contents of two files
-paste # Merge file data
-sed # Stream text editor
-cut # Cut out selected fields of each line of a file
-sort # Sort file data
-diff # Differential file comparator
-split # Split file into smaller files
-expand, unexpand # Expand tabs to spaces, and vice versa
𝟑. 𝐏𝐑𝐎𝐂𝐄𝐒𝐒 𝐌𝐀𝐍𝐀𝐆𝐄𝐌𝐄𝐍𝐓:
ps # Display your currently running processes
ps -ef # Display all the currently running processes on the system.
ps -ef | grep processname # Display process information for processname
top # Display and manage the top processes
htop # Interactive process viewer (top alternative)
kill pid # Kill process with process ID of pid
killall processname # Kill all processes named processname
program & # Start programin the background
bg # Display stopped or background jobs
fg # Brings the most recent background job to foreground
fg n # Brings job nto the foreground
𝟒. 𝐀𝐑𝐂𝐇𝐈𝐕𝐄𝐒 (𝐓𝐀𝐑 𝐅𝐈𝐋𝐄𝐒) :
-tar cf archive.tar directory # Create tar named archive .tar containing dir.
-tar xf archive.tar # Extract the contents from archive.tar. tar czf
-archive.tar.gz director # Create a gzip compressed tar file name archive.tar
-tar xzf archive.tar.gz # Extract a gzip compressed tar file.
-tar cjf archive.tar.bz2 directory # Create a tar file with bzip2 compression
-tar xjf archive.tar.bz2 # Extract a bzip2 compressed tar file.
𝟓. 𝐈𝐍𝐒𝐓𝐀𝐋𝐋𝐈𝐍𝐆 𝐏𝐀𝐂𝐊𝐀𝐆𝐄𝐒:
yum search keyword # Search for a package by keyword.
yum install package # Install package.
yum info package # Display desc and summary information about package.
rpm -i package.rpm # Install package from local file named package.rpm
yum remove package # Remove/uninstall package
tar zxvf sourcecode.tar.gz # Install software from source code.
𝟔. 𝐒𝐄𝐀𝐑𝐂𝐇 :
grep pattern file # Search for pattern in file
grep -r pattern directory # Search recursively for patternin directory
locate name # Find files and directories by name
find /home/john -name 'prefix*' # Find files in /home/john that start with "prefix".
find /home -size +100M # Find files larger than 100MB in /home
😎 𝐅𝐨𝐥𝐥𝐨𝐰 @prodevopsguy 𝐟𝐨𝐫 𝐦𝐨𝐫𝐞 𝐬𝐮𝐜𝐡 𝐜𝐨𝐧𝐭𝐞𝐧𝐭 𝐚𝐫𝐨𝐮𝐧𝐝 𝐜𝐥𝐨𝐮𝐝 & 𝐃𝐞𝐯𝐎𝐩𝐬!!! // 𝐉𝐨𝐢𝐧 𝐟𝐨𝐫 𝐃𝐞𝐯𝐎𝐩𝐬 𝐃𝐎𝐂𝐬: @devopsdocs
𝟏: 𝐇𝐀𝐑𝐃𝐖𝐀𝐑𝐄 𝐈𝐍𝐅𝐎𝐑𝐌𝐀𝐓𝐈𝐎𝐍:
-cat /proc/cpuinfo # Display CPU information
-cat /proc/meminfo # Display memory information
-free -h # Display free and used memory ( -hfor human readable, -mfor MB, -gfor GB.)
-lspci -tv # Display PCI devices
-lsusb -tv # Display USB devices
-dmidecode # Display DMI/SMBIOS (hardware info) from the BIOS
-hdparm -i /dev/sda # Show info about disk sda
-hdparm -tT /dev/sda # Perform a read speed test on disk sda
𝟐. 𝐌𝐀𝐍𝐈𝐏𝐔𝐋𝐀𝐓𝐈𝐍𝐆 𝐃𝐀𝐓𝐀 :
-awk # Pattern scanning and processing language
-perl # Data manipulation language
-cmp # Compare the contents of two files
-paste # Merge file data
-sed # Stream text editor
-cut # Cut out selected fields of each line of a file
-sort # Sort file data
-diff # Differential file comparator
-split # Split file into smaller files
-expand, unexpand # Expand tabs to spaces, and vice versa
𝟑. 𝐏𝐑𝐎𝐂𝐄𝐒𝐒 𝐌𝐀𝐍𝐀𝐆𝐄𝐌𝐄𝐍𝐓:
ps # Display your currently running processes
ps -ef # Display all the currently running processes on the system.
ps -ef | grep processname # Display process information for processname
top # Display and manage the top processes
htop # Interactive process viewer (top alternative)
kill pid # Kill process with process ID of pid
killall processname # Kill all processes named processname
program & # Start programin the background
bg # Display stopped or background jobs
fg # Brings the most recent background job to foreground
fg n # Brings job nto the foreground
𝟒. 𝐀𝐑𝐂𝐇𝐈𝐕𝐄𝐒 (𝐓𝐀𝐑 𝐅𝐈𝐋𝐄𝐒) :
-tar cf archive.tar directory # Create tar named archive .tar containing dir.
-tar xf archive.tar # Extract the contents from archive.tar. tar czf
-archive.tar.gz director # Create a gzip compressed tar file name archive.tar
-tar xzf archive.tar.gz # Extract a gzip compressed tar file.
-tar cjf archive.tar.bz2 directory # Create a tar file with bzip2 compression
-tar xjf archive.tar.bz2 # Extract a bzip2 compressed tar file.
𝟓. 𝐈𝐍𝐒𝐓𝐀𝐋𝐋𝐈𝐍𝐆 𝐏𝐀𝐂𝐊𝐀𝐆𝐄𝐒:
yum search keyword # Search for a package by keyword.
yum install package # Install package.
yum info package # Display desc and summary information about package.
rpm -i package.rpm # Install package from local file named package.rpm
yum remove package # Remove/uninstall package
tar zxvf sourcecode.tar.gz # Install software from source code.
𝟔. 𝐒𝐄𝐀𝐑𝐂𝐇 :
grep pattern file # Search for pattern in file
grep -r pattern directory # Search recursively for patternin directory
locate name # Find files and directories by name
find /home/john -name 'prefix*' # Find files in /home/john that start with "prefix".
find /home -size +100M # Find files larger than 100MB in /home
Please open Telegram to view this post
VIEW IN TELEGRAM
- Optimizes the overall size of the Docker image
- Removes the burden of creating multiple Dockerfiles for different stages
- Easy to debug a particular build stage
- Able to use the previous stage as a new stage in the new environment
- Ability to use the cached image to make the overall process quicker
- Reduces the risk of vulnerabilities found as the image size becomes smaller with multi-stage builds
Please open Telegram to view this post
VIEW IN TELEGRAM
In Kubernetes, readiness and liveness probes are mechanisms used to ensure that applications running inside containers are healthy and able to handle traffic properly. They are essential for maintaining the reliability and availability of applications in a Kubernetes cluster.
📢 Readiness Probe:
🎤 The readiness probe is used to determine when a container is ready to start accepting traffic. It is crucial for ensuring that services don't send requests to a container until it's ready to handle them effectively.
🎤 If the readiness probe fails (returns a non-successful HTTP status code or times out), Kubernetes marks the container as not ready, and it won't receive any traffic until the probe succeeds.
🎤 The readiness probe can be configured to use HTTP endpoints, TCP sockets, or custom scripts to determine the readiness of the container.
📢 Liveness Probe:
🎤 The liveness probe is used to check if a container is still running properly. It helps Kubernetes determine whether a container should be restarted if it's unresponsive or in a failed state.
🎤 Unlike the readiness probe, which determines if the container is ready to serve traffic, the liveness probe checks if the container is still functioning correctly after it has started.
🎤 If the liveness probe fails (returns a non-successful HTTP status code or times out), Kubernetes restarts the container to try to recover it.
⚠️ Both the readiness and liveness probes are configured to perform an HTTP GET request to the /healthz endpoint on port 8080 of the container.
😎 𝐅𝐨𝐥𝐥𝐨𝐰 @prodevopsguy 𝐟𝐨𝐫 𝐦𝐨𝐫𝐞 𝐬𝐮𝐜𝐡 𝐜𝐨𝐧𝐭𝐞𝐧𝐭 𝐚𝐫𝐨𝐮𝐧𝐝 𝐜𝐥𝐨𝐮𝐝 & 𝐃𝐞𝐯𝐎𝐩𝐬!!! // 𝐉𝐨𝐢𝐧 𝐟𝐨𝐫 𝐃𝐞𝐯𝐎𝐩𝐬 𝐃𝐎𝐂𝐬: @devopsdocs
➡️ The readiness probe will start 5 seconds after the container starts and will be performed every 10 seconds thereafter.
➡️ The liveness probe will start 10 seconds after the container starts and will be performed every 15 seconds thereafter.
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1711513802253.gif
494.5 KB
It's a versatile skill that can take you far, and it's known for being one of the easiest programming languages to learn and understand.
Here's a roadmap to help you master Python:
Please open Telegram to view this post
VIEW IN TELEGRAM
A container runtime in Kubernetes is the software component responsible for managing the lifecycle of individual containers within a pod. It's the engine that executes the commands and manages the processes within the container environment.
- containerd
- CRI-O
- Docker Engine
- Mirantis Container Runtime
Please open Telegram to view this post
VIEW IN TELEGRAM
1708566251550.gif
7.3 MB
- Utilize multiple stages to reduce the size of the final image.
- Keep the final image lean by copying only necessary artifacts from previous stages.
- Combine multiple RUN commands using && to minimize the number of layers.
- Clean up unnecessary files and dependencies within the same RUN command.
- Exclude unnecessary files and directories from the build context using .dockerignore.
- This reduces the size of the build context and speeds up the build process.
- Place frequently changing dependencies lower in the Dockerfile to leverage Docker's layer caching mechanism.
- Avoid unnecessary package installations that could bloat the image size.
- Specify precise version tags for base images to ensure consistency and avoid unexpected updates.
- Pinning versions mitigates the risk of breaking changes introduced by newer versions.
- Use smaller base images like Alpine Linux where possible to reduce the overall size of the image.
- Remove unnecessary dependencies and files from the final image to make it as lightweight as possible.
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1711541181170.gif
521.6 KB
Unleash the power of multiple clouds for optimal application performance, resilience, and security!
This reference architecture showcases a secure and resilient way to integrate Azure and AWS in a multi-cloud environment for:
Please open Telegram to view this post
VIEW IN TELEGRAM
[ 𝐊𝐮𝐛𝐞𝐫𝐧𝐞𝐭𝐞𝐬 𝐯𝐞𝐫𝐬𝐢𝐨𝐧 𝐯𝟏.𝟐𝟏 𝐬𝐡𝐢𝐟𝐭𝐞𝐝 𝐟𝐫𝐨𝐦 𝐏𝐨𝐝𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲𝐏𝐨𝐥𝐢𝐜𝐲 𝐭𝐨 𝐭𝐡𝐞 𝐧𝐞𝐰 𝐏𝐨𝐝 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐀𝐝𝐦𝐢𝐬𝐬𝐢𝐨𝐧 𝐜𝐨𝐧𝐭𝐫𝐨𝐥𝐬 ]
𝐏𝐨𝐝 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐀𝐝𝐦𝐢𝐬𝐬𝐢𝐨𝐧 is a feature introduced in Kubernetes to enforce clear and consistent isolation levels for Pods. It builds upon the Kubernetes Pod Security Standards, guidelines that govern how Pods behave and interact with other resources.
By applying security restrictions at the Kubernetes namespace level when Pods are created, 𝐏𝐨𝐝 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐀𝐝𝐦𝐢𝐬𝐬𝐢𝐨𝐧 provides a mechanism to ensure that Pods operate with only the necessary permissions. This enhances security and aligns with broader best practices in software deployment, minimizing the risk of unauthorized access or compromised resources.
The importance of 𝐏𝐨𝐝 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐀𝐝𝐦𝐢𝐬𝐬𝐢𝐨𝐧 lies in its ability to make security a fundamental and integral part of the Kubernetes ecosystem. Rather than treating security as an afterthought, 𝐏𝐨𝐝 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐀𝐝𝐦𝐢𝐬𝐬𝐢𝐨𝐧 ensures that it is part of the design and operation of every Pod.
Kubernetes version 1.21 significantly shifted from PodSecurityPolicy (PSP) to Pod Security Admission. While PSP intended to enforce security settings on Pods, it was deprecated due to its complexity and lack of flexibility.
Pod Security Admission introduces a more streamlined approach, utilizing labels to define admission control modes at the namespace level. These labels dictate the action the control plane takes if a potential violation is detected, such as rejection (enforce), audit annotation (audit), or user-facing warning (warn).
Please open Telegram to view this post
VIEW IN TELEGRAM
Palak Bhawsar
CI/CD pipeline for Terraform Project
In this article, we will be creating an automated CI/CD pipeline for a Terraform project, with a focus on adhering to security and coding best practices. The pipeline will be designed to trigger automatically upon code push to GitHub, and will encomp...
Follow
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
data "aws_ami" "example" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
}
owners = ["099720109477"] # Canonical
}In the above example :
On the other hand, a resource block in Terraform is used to define the infrastructure components that Terraform manages.
Please open Telegram to view this post
VIEW IN TELEGRAM
Follow
Please open Telegram to view this post
VIEW IN TELEGRAM
Kubernetes has revolutionized the way we deploy and manage containerized applications, but understanding its architecture can sometimes feel like navigating a complex labyrinth. Fear not! I've simplified it into bite-sized pieces for you.
Nodes: Think of them as the workers and managers in your application orchestra.
Pods: Your application's smallest building blocks, neatly packed containers.
Services: Gateways to your applications, ensuring seamless communication.
Controllers: The brains behind the operation, ensuring everything runs smoothly.
etcd: The reliable memory bank, storing all cluster data securely.
API Server, Scheduler, Controller Manager: The command center, orchestrating every move.
Please open Telegram to view this post
VIEW IN TELEGRAM
When Containers Talk: Decoding the Secret Language of Docker Networking.
Please open Telegram to view this post
VIEW IN TELEGRAM
1706503170946.gif
240.4 KB
Pod lifecycle hooks, such as preStart and preStop, are features within Kubernetes that allow you to specify commands that should be executed at specific points in a container's lifecycle. Think of it like a subsystem that is monitoring and managing the task that you specify for these lifecycle stages.
➡️ postStart: Executed after a container has started. It can be used for tasks that need to be performed once the container is up and running. Initialization and Configuration, Dependency check, Health Checks are some common usecases that are configured here.
➡️ preStop: Executed just before a container is terminated. It provides an opportunity to perform cleanup tasks or gracefully shut down the application before the container stops. Graceful Shutdown, Connection Draining, Notification of Termination are all the things that can be configured here.
If your application needs customization for different environments like dev,stage, production, then you should definitely check these hooks out.
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1711756965854.gif
778.5 KB
Here are six cutting-edge software deployment strategies every engineer should have in their toolkit:
Mastering these strategies empowers DevOps engineers to streamline processes, enhance reliability, and deliver value to users efficiently. Keep learning, keep innovating!
Please open Telegram to view this post
VIEW IN TELEGRAM