part5(day at work) Flashcards
In ansible playbook, there is a section which could fail on certain nodes, But we don’t want the playbook to stop because of this. How do we solve this problem ?
- To prevent an Ansible playbook from stopping when a task fails on certain nodes, use the ignore_errors: yes directive in the task where failure is expected.
How do you make changes to a git repository ?
- understand why a change is needed
- clone the repo
- create a new branch
- check history of the previous commits ( use blame tab on GitHub or git log on cli)
create a linux script that will push certain logs to S3 automatically, this script should run at a particular time.
- first we need to configure either an IAM role or access and secret keys to access the linux machine depending on what is needed.
- Then write a bash script (starting with #)
- define the path where the logs are located eg /var/log/*
- add aws cli commands (aws cp <origin s3 location
- configure a cronjob to run this script at a particular time.
what is a package in python ?
In Python, a package is a way of organizing and structuring related modules (Python files) into a single directory hierarchy. It allows you to group related code, making it easier to manage and reuse
Tell me about yourself and your day to day task as a DevOps engineer.
- As a DevOps engineer i work in collaboration with multiple other engineers ie developers, SRE, testing, sales. database, network etc
- 09:00 -10:00 check slack handles and update jira
- 10:00-10:30 : daily stand up to update the team on what i did the previous day and what i will do that day.
10:30 - 13:00 : work on jira ticket
13:00: 14:00 : lunch
14:00-16:00; work with developers to see if they need any elevated access to certain environments - 16:00-17:00 : learning new skills that can add value to the team and myself.
is it possible to deploy pods on specific nodes ?
Yes, it is possible to deploy pods on specific nodes in Kubernetes using node selection mechanisms
- node selector : based on key-value labels.
- Node Affinity is a more advanced and flexible way to target specific nodes. It allows you to use expressions and specify soft or hard constraints.
- Taints on nodes and tolerations on pods allow you to repel pods from certain nodes unless the pod explicitly tolerates the taint
- node name: You can directly specify the node name where the pod should run
what is the difference between a webserver and an application server ?
what is the difference between a web server and an application server ?
A web server delivers the stuff you see on a website, like text, images, and styles. It handles requests for basic things (like “show this page”).
An application server does the “thinking” behind the scenes. It runs the logic to process user actions, fetch data from databases, and create the dynamic content you see on the website.
How can we handle secrets in ansible?like username and password if a playbook needs to login to an on premise server ?
- make use of ansible vault to encrypt and decrypt information when needed.
- ansible-vault create
- ansible-vault encrypt [filename]
what is blue green deployment ?
Blue-green deployment is a strategy for releasing software with minimal downtime and risk. It involves maintaining two environments—one (blue) running the current version of the application and the other (green) for the new version