devops interview
devops interview
Why not store locally?: Storing the statefile locally can cause issues
when working in teams, and it lacks centralized access, which makes
collaboration difficult. It's also prone to being lost or corrupted.
4. Push the images to a Docker Registry (e.g., Docker Hub, AWS ECR).
USER: Runs the application as the nobody user for better security.
9. What are the things you have set up in K8s? What are
the core controllers of K8s? Diff between Deployment &
ReplicaSet? Diff between Deployment & DaemonSet
Core controllers:
Difference:
Taints and Tolerations: Nodes with taints prevent pods from being
scheduled unless the pods have matching tolerations.
pythonCopyEdittry:
a = 10 / 0
except ZeroDivisionError as e:
print(f"Error: {e}")
finally:
print("This will always execute")
19. In bash, what are the common commands you will use?
Common bash commands include:
ls: List files
For fetching IP addresses from log files, a script could look like this:
bashCopyEditfor file in *.log; do
grep -oP '\d+\.\d+\.\d+\.\d+' "$file" >> ips.txt
done
This will extract all IP addresses from .log files into a new file ips.txt.