<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aishwary Prakash</title>
    <description>The latest articles on DEV Community by Aishwary Prakash (@devopstune).</description>
    <link>https://dev.to/devopstune</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1047625%2F008db210-bda1-44e6-b5b9-23f31b34906b.jpg</url>
      <title>DEV Community: Aishwary Prakash</title>
      <link>https://dev.to/devopstune</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devopstune"/>
    <language>en</language>
    <item>
      <title>DevOps Interview: Replica sets vs Daemon sets</title>
      <dc:creator>Aishwary Prakash</dc:creator>
      <pubDate>Sun, 10 Dec 2023 18:04:21 +0000</pubDate>
      <link>https://dev.to/devopstune/devops-interview-replica-sets-vs-daemon-sets-2bo7</link>
      <guid>https://dev.to/devopstune/devops-interview-replica-sets-vs-daemon-sets-2bo7</guid>
      <description>&lt;p&gt;Replica sets and Daemon sets are controllers in Kubernetes used to manage the lifecycle of Pods. They are used to manage Pods.&lt;/p&gt;

&lt;p&gt;Let's check the differences between them.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Replica sets ensure that a certain number of copies should be running on nodes. Daemon sets ensure exactly one copy running on all or certain nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replica sets can be scaled up or down by assigning "replicas" field in the manifest file. Daemon sets scales automatically when the node number changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replica sets are used for stateless applications to maintain a certain number of instances of the application. Daemon sets are used for deploying backend services like monitoring agents, logging agents etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Let's see the manifest file for both.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Replica sets-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; apiVersion: apps/v1
 kind: ReplicaSet
 metadata:
   name: &amp;lt;any name&amp;gt;
 spec:
   replicas: &amp;lt;any number&amp;gt;
   selector:
     matchLabels:
       app: &amp;lt;any name&amp;gt; # any label based on your need
   template:
     metadata:
       labels:
         app: &amp;lt;webserver&amp;gt;
     spec:
       containers:
       - name: &amp;lt;any name&amp;gt;
         image: nginx:latest
         ports:
         - containerPort: 80

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Daemon sets-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; apiVersion: apps/v1
 kind: DaemonSet
 metadata:
   name: &amp;lt;any name&amp;gt;
 spec:
   selector:
     matchLabels:
       app: &amp;lt; any name &amp;gt;  # any label based on your need
   template:
     metadata:
       labels:
         app: &amp;lt; any name&amp;gt;
     spec:
       containers:
       - name: &amp;lt;any name&amp;gt;
         image: fluentd:latest
         volumeMounts:
         - name: &amp;lt; your volume name&amp;gt;
           mountPath: /var/log   # any path directory on host 
       volumes:
       - name: &amp;lt; your volume name&amp;gt;
         hostPath:
           path: /var/log  # mounted volume on this path on host
node

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example of Replica sets - any web application with certain replicas etc.&lt;br&gt;
Example of Daemon sets - agent deployed to collect logs from nodes.&lt;/p&gt;

&lt;p&gt;Still confused !!&lt;/p&gt;

&lt;p&gt;No need to worry. Let’s take daily life example for both.&lt;/p&gt;

&lt;p&gt;Replica sets-&lt;/p&gt;

&lt;p&gt;In a restaurant, the waiters (replicas) form a ReplicaSet. The manager, acting as the controller, ensures enough waiters are available to serve customers efficiently. If a waiter is absent, the manager replaces them with another waiter to maintain the desired number of serving staff.&lt;/p&gt;

&lt;p&gt;Daemon sets-&lt;/p&gt;

&lt;p&gt;In a city with a fleet of garbage trucks, each truck (pod) is assigned a specific area (node) to collect trash. The fleet manager, acting as the DaemonSet, ensures a truck is always present in every area (node) for efficient waste management.&lt;/p&gt;

&lt;p&gt;That’s all. Pat yourself on the back. :)&lt;/p&gt;

&lt;p&gt;Hope you enjoyed it. Don’t forget to like it.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>sitereliabilityengineering</category>
      <category>kubernetes</category>
      <category>replicasets</category>
    </item>
    <item>
      <title>DevOps Interview: kubectl apply vs kubectl create</title>
      <dc:creator>Aishwary Prakash</dc:creator>
      <pubDate>Sun, 26 Nov 2023 03:16:36 +0000</pubDate>
      <link>https://dev.to/devopstune/devops-interview-kubectl-apply-vs-kubectl-create-2pde</link>
      <guid>https://dev.to/devopstune/devops-interview-kubectl-apply-vs-kubectl-create-2pde</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FQtZpe4---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ccmgt31t5ezviejcj4m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FQtZpe4---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ccmgt31t5ezviejcj4m1.png" alt="Kubernetes" width="800" height="436"&gt;&lt;/a&gt;&lt;br&gt;
Both kubectl create and kubectl apply are commands used to manage resources in a Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s check the differences!!&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;“create” is an imperative command meaning it requires you to specify all the details of the resource you want to create, including its name, labels, selectors, and other configuration options.&lt;br&gt;
“apply” is a declarative command meaning it compares the desired state of a resource to its current state and makes the necessary changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The “create” command will fail if resources are already present. But, “apply” will update the existing resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“kubectl create” is not idempotent, running it multiple times will create multiple instances of the resource.&lt;br&gt;
“kubectl apply” is idempotent, meaning that you can run it multiple times without affecting the resource’s state.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“kubectl create “can be used to create resources from manifest files or command-line.&lt;br&gt;
“kubectl apply” can only be used to apply resources from manifest files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Syntax:&lt;br&gt;
kubectl create -f your_manifest_file_name.yaml&lt;br&gt;
kubectl apply -f your_manifest_file_name.yaml&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>devops</category>
      <category>sitereliabilityengineering</category>
      <category>kubernetes</category>
      <category>kubect</category>
    </item>
    <item>
      <title>DevOps Interview: Terraform Workspace &amp; commands</title>
      <dc:creator>Aishwary Prakash</dc:creator>
      <pubDate>Thu, 23 Nov 2023 13:36:01 +0000</pubDate>
      <link>https://dev.to/devopstune/devops-interview-terraform-workspace-commands-2m66</link>
      <guid>https://dev.to/devopstune/devops-interview-terraform-workspace-commands-2m66</guid>
      <description>&lt;p&gt;&lt;strong&gt;Terraform Workspace:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Workspace is a feature provided by Terraform to help you isolate your Terraform configurations and state files. It allows you to manage multiple sets of infrastructure resources independently, each with its own distinct configuration and state. This is useful when working with different environments such as development, staging, and production environments or projects. It helps you to isolate changes and prevent conflicts.&lt;br&gt;
Each workspace will have a separate state file. If you don’t specify the workspace, Terraform automatically creates a default workspace named “default”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;so, let’s see the benefits of using Workspace.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Isolation&lt;/strong&gt; — Workspaces enable you to manage separate environments, such as development, staging, and production without affecting one another environments.This way you can have different configuration files and state files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Collaboration&lt;/strong&gt; — Workspace gives team members a chance to work simultaneously on different environments without interfering with each other’s configurations.&lt;br&gt;
&lt;strong&gt;3. Testing&lt;/strong&gt; — Workspace helps the team to test configuration in dev or staging before applying in the prod environment. This reduces the risk of introducing errors&lt;br&gt;
into pro.&lt;br&gt;
&lt;strong&gt;4. Version control&lt;/strong&gt; — It means if you want to keep different versions of configuration then we can use Workspace to keep track of versions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s see the commands to manage Workspace-&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. terraform workspace new :&lt;/strong&gt; It will create new workspace.&lt;br&gt;
e.g.- terraform workspace new prod&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. terraform workspace select :&lt;/strong&gt; if you want to jump to an existing workspace.&lt;br&gt;
e.g. — terraform workspace select prod&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; we also have “ terraform workspace switch  “ command for changing workspace. But there is a bit of a difference between “select” and “switch”.&lt;br&gt;
terraform workspace select is used to set the currently active workspace without changing the state file, but terraform workspace switch is&lt;br&gt;
set to the currently active workspace and changes the state file that is being used.&lt;br&gt;
It means in the case of “terraform workspace select” , any changes you make to your configuration will still be applied to the state file for the&lt;br&gt;
previously selected workspace. For “terraform workspace switch”, any changes you make to your configuration will be applied to the state file for newly selected workspace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. terraform workspace list:&lt;/strong&gt; It will list all available workspaces.&lt;br&gt;
e.g. — terraform workspace lists&lt;br&gt;
output: dev&lt;br&gt;
prod&lt;br&gt;
staging&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. terraform workspace delete :&lt;/strong&gt; It will delete particular Workspace.&lt;br&gt;
e.g. — terraform workspace deletes dev&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. terraform workspace show:&lt;/strong&gt; This command shows the name of the currently selected workspace. It will show the workspace in which currently you are.&lt;br&gt;
e.g. — terraform workspace show&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. terraform workspace current:&lt;/strong&gt; This command displays the current workspace’s name and path. It provides more detailed information about the currently&lt;br&gt;
selected workspace.&lt;br&gt;
e.g. — terraform workspace current&lt;/p&gt;

&lt;p&gt;Let’s see some high-level commands…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. terraform workspace lock:&lt;/strong&gt; it locks the state for the currently selected workspace. This prevents other users from making changes to the state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. terraform workspace unlock:&lt;/strong&gt; it unlocks the state for the currently selected workspace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. terraform workspace import  :&lt;/strong&gt; it imports a workspace from a source, such as a remote Terraform Cloud workspace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. terraform workspace export  :&lt;/strong&gt; it exports a workspace to a destination, such as a local directory.&lt;/p&gt;

&lt;p&gt;That’s all. Pat yourself on the back. :)&lt;/p&gt;

&lt;p&gt;Hope you enjoyed it. Don’t forget to like it.&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>devops</category>
      <category>sitereliabilityengineering</category>
      <category>workspace</category>
    </item>
    <item>
      <title>DevOps Interview: Ansible Vaults Commands and Usuage</title>
      <dc:creator>Aishwary Prakash</dc:creator>
      <pubDate>Sun, 19 Nov 2023 03:45:53 +0000</pubDate>
      <link>https://dev.to/devopstune/devops-interview-ansible-vaults-commands-and-usuage-462h</link>
      <guid>https://dev.to/devopstune/devops-interview-ansible-vaults-commands-and-usuage-462h</guid>
      <description>&lt;p&gt;Ansible Vault is one of the most powerful features provided by Ansible. It is very useful when we are dealing with secrets, credentials, SSH keys or any other sensitive information in our playbook or role.&lt;/p&gt;

&lt;p&gt;Let’s say you want to add credentials to your playbook for some purpose and you don’t want your password to be present in plain text. Here, you can use Ansible Vault to mask your original password. The main advantage is that this will not be visible to other users.&lt;br&gt;
We will see how we can implement this. Hope, you got some idea about “Why we need Ansible Vault?”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encrypting file using Ansible Vault command:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can use “ansible-vault” command to create encrypted files.&lt;/p&gt;

&lt;p&gt;e.g.-ansible-vault create your_name_of_playbook.yml&lt;/p&gt;

&lt;p&gt;When you run the above command, it will ask you to provide a password which will be used later to decrypt this file. This will create a new file and open it in a default text editor. Here, you can enter the secrets that you want to encrypt. After adding contents, save and close. You can see contents are encrypted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Editing the encrypted file:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;we can modify the contents of the encrypted file using “ansible-vault edit “ command. Let’s use one example.&lt;/p&gt;

&lt;p&gt;e.g.- ansible-vault edit your_name_of_playbook.yml&lt;/p&gt;

&lt;p&gt;When you run this command, it will ask for the vault password that you have given when encrypting this file. Enter the correct vault password, it will then decrypt the file temporarily for modification of contents. Save and exit the editor. After closing the editor, it will automatically re-encrypt the file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encrypting existing files:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can also encrypt existing files using “ansible-vault encrypt” command.&lt;/p&gt;

&lt;p&gt;e.g.- ansible-vault encrypt your_name_of_playbook.yml&lt;/p&gt;

&lt;p&gt;It will ask you to set a new vault password which will be used while decrypting the file.&lt;/p&gt;

&lt;p&gt;Note: you can also encrypt multiple files at once.&lt;br&gt;
ansible-vault encrypt file1.yml file2.yml file3.yml&lt;/p&gt;

&lt;p&gt;Now, if you want to decrypt the file, replace “encrypt” with “decrypt” and the rest part will be the same.&lt;br&gt;
e.g.- ansible-vault decrypt your_name_of_playbook.yml&lt;/p&gt;

&lt;p&gt;Here, it will ask for the same vault password that you have given while encrypting.&lt;/p&gt;

&lt;p&gt;So far we discussed, how to encrypt, decrypt, and create files. Now, &lt;strong&gt;what if we want to change “vault password”&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;are you excited to know about it? !!! :)&lt;/p&gt;

&lt;p&gt;In Ansible, Changing the vault password is called “rekeying”. If you guessed the command will start using the word “rekey” then you are correct.&lt;/p&gt;

&lt;p&gt;So, the command is “ansible-vault rekey”.&lt;br&gt;
e.g.- ansible-vault rekey your_name_of_playbook.yml&lt;br&gt;
It will ask for the current vault password. After that, you will give a new vault password as per your choice and re-confirm it. That’s all, you are all set.&lt;/p&gt;

&lt;p&gt;Now, we have created encrypted files and you are using those files in the main playbook. But, how we will use it in our main playbook??&lt;/p&gt;

&lt;p&gt;It is very important to provide a vault password for encrypted files while running the playbook otherwise playbook execution will fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s see the plan:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Pass the vault password:&lt;/strong&gt;&lt;br&gt;
e.g.- ansible-playbook main_playbook.yml — —ask-vault-pass&lt;br&gt;
It will ask for a vault password for an encrypted file used in the main playbook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Pass the file having the vault password in it:&lt;/strong&gt;&lt;br&gt;
e.g.- ansible-playbook main_playbook.yml — -vault-id path_of_vault_password_file&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Pass using vault_password_file:&lt;/strong&gt; for this, you have to mention the path of the vault password containing the file in “ansible.cfg”&lt;br&gt;
[defaults]&lt;br&gt;
vault_password_file = path_of_vault_password_file&lt;/p&gt;

&lt;p&gt;then, you can simply run “ansible-playbook mainplaybook.yml”. It will automatically find the path of the vault password file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note: what’s the difference in methods 2) &amp;amp; 3) ???&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, it’s just a matter of interaction(method 2) and non-interaction(method 3) while executing the playbook.&lt;/p&gt;

&lt;p&gt;I will explain “vault id significance” in the next article.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed it. Don’t forget to like it.&lt;/p&gt;

</description>
      <category>ansible</category>
      <category>ansiblevault</category>
      <category>devops</category>
      <category>sitereliabilityengineering</category>
    </item>
    <item>
      <title>DevOps Interview:Absolute path and Relative path in Linux</title>
      <dc:creator>Aishwary Prakash</dc:creator>
      <pubDate>Fri, 17 Nov 2023 02:48:08 +0000</pubDate>
      <link>https://dev.to/devopstune/devops-interviewabsolute-path-and-relative-path-in-linux-29j6</link>
      <guid>https://dev.to/devopstune/devops-interviewabsolute-path-and-relative-path-in-linux-29j6</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G0WQn7LH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s3wpcd6vgu4qv44chqs0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G0WQn7LH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s3wpcd6vgu4qv44chqs0.png" alt="Image description" width="800" height="539"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Absolute path:&lt;/strong&gt;&lt;br&gt;
Absolute path is the path of any files or folders with respect to root directory (/) of the file system. It is always same.&lt;br&gt;
e.g.- 1. /home/user/ec2-user/samplefile.txt → notice that it’s starting from “/” means root directory.&lt;br&gt;
      2. /etc/passwd&lt;br&gt;
hence, you can say it’s a complete path of any file or folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Relative path:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Relative path is the path of any file or folder with respect to current working directory. As it’s name suggests “Relative” means there is comparison with current working directory.&lt;br&gt;
e.g.- lets say current directory is “/home/user/ec2-user/documents/” (to find the path of current working directory, you can use “pwd” command)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;../../ec2-user/documents/doc1.txt&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;hence, you can say relative path is used to denote files or folders that is present in same directory as the current working directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, you have got idea about both types of path. So, let’s check the differences on different metrics.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Absolute path always strarts from “/” root directory. But, 
relative path doesn’t.&lt;/li&gt;
&lt;li&gt;Absolute path is always same irespective to current directory. 
But, relative path depends on current directory.&lt;/li&gt;
&lt;li&gt;Absolute path is used to access files or folders from anywhere 
in system. But, relative path is used to access from current 
directory.&lt;/li&gt;
&lt;li&gt;Absolut path may be lengthy when there are more 
subdirectories. Relative path is precise and efficient.&lt;/li&gt;
&lt;li&gt;Absolute path is more explicit than relative path. It is easy 
to read absolute path and understand the flow.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hope you enjoyed it!!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>devopsinterview</category>
      <category>sitereliabilityengineer</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
