Sitemap
Anudee

Anudee

Interview Questions

19 min readOct 12, 2024

--

1. GKE Workload Identity.

2. How many subnets are created in GKE by default ?

Google Kubernetes Engine (GKE) Standard clusters reserve a /24 subnet range for each node by default. This allows up to 110 Pods per node, but can be configured to support up to 256 Pods per node with a /23 range.

Here’s a breakdown of GKE’s default Pod IP address range and maximum Pods per node:

• Standard clusters By default, reserve a /24 subnet range per node, allowing up to 110 Pods per node. However, they can be configured to support up to 256 Pods per node with a /23 range.

• Autopilot clusters Choose a maximum Pods per node from a range of 8–256 based on the expected workload Pod density. Autopilot uses a /26 subnet that corresponds to 64 addresses, and this subnet setting can’t be changed.

GKE creates each node with a /25 alias IP address range, providing 128 Pod IPv4 addresses per node. Kubernetes assigns each node a range of IP addresses, a CIDR block, so that each Pod can have a unique IP address. The size of the CIDR block corresponds to the maximum number of Pods per node.

GKE’s networking model doesn’t allow IP addresses to be reused across the network

3. How GKE Configured and Authenticated with Service Account?

IAM, API gateway, Cloud Operations suite, Inventory and Billing.

Q) We need your help to rotate key for our production GCP services account. Here is the JIRA — https://jira.aexp.com/jira/browse/CENGBD-6318

Gcp iac, gcp titan

Gcp onboarding

What is does 2/2 represent in K8s pod?

How terraform scans the security? → uses Terrascan

How terraform scans the code analysis, security, validate syntax, security policy ?

How terraform modules are scanned if there are ports or ips or passwords exposed ?

Difference between single and multi branch pipeline?

If a junior created environment manually and you want to make use of that environment, how do you make use of it?

Trivy scan how it works?

Trivy works by comparing the components of a target against a database of known vulnerabilities, and then providing a detailed report of its findings

Container Vs Pod?

Is there any node pool setup in gke environment?

If Jenkins is down with 404 error, even after multiple restarts it’s not up. How to fix it?

B-G Vs Canary?

How to check if jdk is running or not? #java -version will let us know if the JDK is running

How to copy a file into multiple servers? — scp

The major difference between these tools is how they copy files.

scp basically reads the source file and writes it to the destination. It performs a plain linear copy, locally, or over a network.

rsync also copies files locally or over a network. But it employs a special delta transfer algorithm and a few optimizations to make the operation a lot faster. Consider the call.

rsync A host:B

• rsync will check files sizes and modification timestamps of both A and B, and skip any further processing if they match.

• If the destination file B already exists, the delta transfer algorithm will make sure only differences between A and B are sent over the wire.

• rsync will write data to a temporary file T, and then replace the destination file B with T to make the update look “atomic” to processes that might be using B.

Another difference between them concerns invocation. rsync has a plethora of command line options, allowing the user to fine tune its behavior. It supports complex filter rules, runs in batch mode, daemon mode, etc. scp has only a few switches.

In summary, use scp for your day to day tasks. Commands that you type once in a while on your interactive shell. It’s simpler to use, and in those cases rsync optimizations won’t help much.

For recurring tasks, like cron jobs, use rsync. As mentioned, on multiple invocations it will take advantage of data already transferred, performing very quickly and saving on resources. It is an excellent tool to keep two directories synchronized over a network.

Also, when dealing with large files, use rsync with the -P option. If the transfer is interrupted, you can resume it where it stopped by reissuing the command. See Sid Kshatriya’s answer.

Finally, note that rsync:// the protocol is similar to plain HTTP: unencrypted and no integrity checks. Be sure to always use rsync via SSH (as in the examples from the question above), not via the rsync protocol, unless you really know what you’re doing. scp will always use SSH as underlying transport mechanism which has both integrity and confidentiality guarantees, so that is another difference between the two utilities.

How to expose ports in docker cli?

How to skip one stage and move to other stage of a file in Jenkins?

— > https://medium.com/@Lopay/how-to-skip-stages-in-jenkins-scripted-pipeline-f653e54d835d

Use imperative-when

Write a Docker file?

Explain ***** in cron job?

Explain Branching strategy?

Explain GitHub action workflow? (No one asked)

Explain SCA in layman terms?

Cut delimeter?

How to write a custom docker file?

K8s commands to see if ingress service is not able to expose the application , even the pods are running fine.

K8s prechecks before an upgrade?

K8s key vault and secrets?

Types of service accounts?

A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs.

Types of service accounts

In Google Cloud, there are several different types of service accounts:

• User-managed service accounts: Service accounts that you create and manage. These service accounts are often used as identities for workloads.

• Default service accounts: User-managed service accounts that are created automatically when you enable certain Google Cloud services. You are responsible for managing these service accounts.

• Service agents: Service accounts that are created and managed by Google Cloud, and that allow services to access resources on your behalf.

https://cloud.google.com/iam/docs/service-account-overview?source=post_page-----188e01ebd819--------------------------------

How GKE is configured and authenticated with service account?

— > Workload Identity

Q) How terraform integrates with storage?

Q) SCA — Static code Analyser ?

A static code analyzer, also known as a linter or static code analysis tool, is a program that automatically reviews source code to identify potential issues without executing the code

Q) What is SonarQube in simple words?

SonarQube is a Code Quality Assurance tool that collects and analyzes source code, and provides reports for the code quality of your project. It combines static and dynamic analysis tools and enables quality to be measured continually over time.

Q) When secrets are stored in terraform?

Secrets in Terraform can be stored in a secure external storage service, such as HashiCorp Vault or AWS Secrets Manager, instead of directly in the Terraform code or environment variables. These services offer features like access control, auditing, and automatic rotation of secrets.

Terraform Cloud & Enterprise also offers built-in secure storage and management of secrets within the Terraform code. It integrates with the existing workflow and uses the workspace to manage variables and state files.

Q) How many subnets are created for gke?

Google Kubernetes Engine (GKE) Standard clusters reserve a /24 subnet range for each node by default. This subnet range allows up to 110 Pods per node. However, the maximum number of Pods per node can be configured to allow up to 256 Pods per node. The size of the CIDR block assigned to each node by Kubernetes corresponds to the maximum number of Pods per node

in Autopilot clusters, the cluster uses a /26 subnet that corresponds to 64 addresses, and this subnet setting cannot be changed

Q) Any idea on cloud sql?

Q) Explain about terraform backends?

https://medium.com/@surangajayalath299/what-is-terraform-backend-how-used-it-ea5b36f08396

Q) Alias in terraform?

A) What if I need to launch my resources in multiple regions within a single configuration file then Alias variable does this functionality.

https://jaffarshaik.medium.com/alias-and-data-sources-in-terraform-16fb57cdf67e

Q) Maven command to do the test?

Q) How we define code coverage in maven?

Q) Helm .tpl file?

.tpl are called partials and an extension for templates.

Q) What are Terraform templates?

Terraform templates are configuration files that define and describe the infrastructure resources required for a particular application or environment using a declarative configuration language called Hashicorp Configuration Language (HCL).

These templates have a “.tf” extension, and they enable users to code infrastructure, ensuring consistent and reproducible deployments.

Q) _helpers.tpl file need?

https://levelup.gitconnected.com/helm-named-templates-de2efc3875d0

• But files whose name begins with an underscore (_) are assumed to not have a manifest inside. These files are not rendered to Kubernetes object definitions, but are available everywhere within other chart templates for use.

These files are used to store partials and helpers. In fact, when we first created mychart, we saw a file called _helpers.tpl. That file is the default location for template partials.

Explain workload identity?

Q) What is Workload Identity?

In Google Kubernetes Engine (GKE), Workload Identity is a method that allows your applications running on GKE to authenticate to Google Cloud services without needing to manage service account keys. It simplifies the process of assigning and managing identities for your workloads, enhancing security and reducing the complexity of key management.

How Does Workload Identity Work?

In GKE, the concept is similar. Instead of giving each application a key (which could be stolen or lost), Workload Identity allows your applications to use Kubernetes service accounts to get access to Google Cloud resources securely. Here’s how it works in simple terms:

• Kubernetes Service Account (KSA): Each application (or pod) in your GKE cluster can be associated with a Kubernetes Service Account.

• Google Service Account (GSA): This is a Google Cloud identity that has permissions to access specific Google Cloud resources, like Pub/Sub, Cloud Storage, or BigQuery.

• Binding KSA to GSA: You bind the Kubernetes Service Account to the Google Service Account. This means when the application uses the KSA, it automatically gets the permissions of the GSA.

Steps to Implement Workload Identity

Let’s walk through the process of setting up Workload Identity step-by-step.

1. Enable the Workload Identity Feature

First, ensure that Workload Identity is enabled on your GKE cluster. This can be done during cluster creation or on an existing cluster.

gcloud container clusters update <CLUSTER_NAME> \

— workload-pool=<PROJECT_ID>.svc.id.goog

Replace <CLUSTER_NAME> with your GKE cluster’s name and <PROJECT_ID> with your Google Cloud project ID.

2. Create a Google Service Account (GSA)

Create a GSA that your workload will use to access Google Cloud services

gcloud iam service-accounts create <GSA_NAME> \

— display-name “Google Service Account for Workload Identity”

Grant the necessary roles to the GSA to access the required Google Cloud services.

gcloud projects add-iam-policy-binding <PROJECT_ID> \

— member=”serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com” \

— role=”roles/<REQUIRED_ROLE>”

Replace <GSA_NAME>, <PROJECT_ID>, and <REQUIRED_ROLE> with your service account name, project ID, and the role required for your service, respectively.

3. Create a Kubernetes Service Account (KSA)

Create a KSA in your Kubernetes cluster that will be associated with your application.

kubectl create serviceaccount <KSA_NAME> — namespace <NAMESPACE>

Replace <KSA_NAME> with your desired Kubernetes service account name and <NAMESPACE> with the namespace where your application is deployed.

4. Bind the KSA to the GSA

To bind the KSA to the GSA, you need to create an IAM policy binding that grants the KSA the permissions of the GSA.

gcloud iam service-accounts add-iam-policy-binding <GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com \

— role roles/iam.workloadIdentityUser \

— member “serviceAccount:<PROJECT_ID>.svc.id.goog[<NAMESPACE>/<KSA_NAME>]”

Replace <GSA_NAME>, <PROJECT_ID>, <NAMESPACE>, and <KSA_NAME> with the appropriate values.

5. Annotate the KSA with the GSA

Annotate the KSA to link it with the GSA.

kubectl annotate serviceaccount <KSA_NAME> \

— namespace <NAMESPACE> \

iam.gke.io/gcp-service-account=<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com

6. Deploy Your Application

Deploy your application, ensuring it uses the annotated KSA. Here is an example deployment YAML file:

apiVersion: apps/v1

kind: Deployment

metadata:

name: my-app

namespace: <NAMESPACE>

spec:

replicas: 1

selector:

matchLabels:

app: my-app

template:

metadata:

labels:

app: my-app

spec:

serviceAccountName: <KSA_NAME>

containers:

- name: my-app-container

image: gcr.io/<PROJECT_ID>/my-app-image

…

Replace <NAMESPACE>, <KSA_NAME>, <PROJECT_ID>, and my-app-image with your specific values.

https://spacelift.io/blog/docker-entrypoint-vs-cmd → CMD vs Entrypoint

https://spacelift.io/blog/dockerfile → Explain Docker file?

Q) Difference between private google and private service? Private Google Access is a simpler way to access Google APIs and services from a VPC network without using an external IP address. Private Service Connect is a more flexible way to access Google APIs and services from a VPC network using your own internal IP addresses

Q) How secrets are stored?

https://spacelift.io/blog/terraform-secrets

Q) What is multistage build?

run the netstat command to check the listener, (netstat -lntp)

https://medium.com/@sanoj.sudo/what-is-pod-in-kubernetes-or-k8s-516cce9f2cf7

What is the difference between toset and tolist?

The toset() function converts a value to a set, that is an unordered collection of unique values, while tolist() converts a value to a list, preserving the order of elements.

A list in Terraform is a collection type that represents an ordered sequence of elements. Lists are used to store and manage a series of values, and the order in which elements are defined in the list is maintained. Elements in a list can be of various types, such as strings, numbers, or other complex data structures.

https://spacelift.io/blog/terraform-functions-expressions-loops → Terraform Functions

Compute and Hosting, How server less is important and Container. Storage, Networking, Database, biodata, AI/ML

Some of the basic Git commands I would suggest trying are:

git clone [repository]: Creates a copy of a remote repository on your local machine.

git status: Shows the status of changes as untracked, modified, or staged.

git pull: Fetches changes from a remote repository and merges them into the current branch.

git branch: Lists all branches in the repository.

git checkout [branch]: Switches to a different branch.

git merge [branch]: Merges changes from a specified branch into the current branch.

Google Cloud use a SDN solution, that’s why all instances only point to the default gateway. The gateway perform routing based on your VPC route configuration.

You can read this docs to understand more on how VPC route packets.

For your second question, as the nested VM use an internal IP, you have a few options here:

1. Setup port forwarding from your host instance to your VM

2. Add a routing table entry for that IP to point to your VM, then add a forwarding rule in your VM. This setup is used in GKE.

3. Use Alias IP, which is similar to the above setup, but automated.

4. You can add multiple network interfaces then config your hypervisor to mount one of them into the VM. (make sure to check that your usage fit into the limitations)

EPAM:-

1. Write two modules create dependency between them and also create a backend?

2. Lookup {a=“ay”, b=“bee”} a is what?

lookup Function

lookup retrieves the value of a single element from a map, given its key. If the given key does not exist, the given default value is returned instead.

lookup(map, key, default)

For historical reasons, the default parameter is actually optional. However, omitting default is deprecated since v0.7 because that would then be equivalent to the native index syntax, map[key].

Examples

> lookup({a=”ay”, b=”bee”}, “a”, “what?”)

ay

> lookup({a=”ay”, b=”bee”}, “c”, “what?”)

what?

3. Write a shell script and make sure to read /var/log/httpd.log and print the status code 503 and make sure how many times it got printed from the file

127.0.0.1 frank

127.0.0.1 abc

4. How to make sure a pod is placed only onto a single node.

5. What happens when a master node is down and how the applications runs

6. Firewall stateful or stateless?

7. Binary authorisation in GKE

8. TCP vs UDP.

9. Shared vpc benefits?

10. MIG Vs UMIG.

11. Differences between For_each and Count in terraform

12. Branching strategy, how rollback and release takes place.

13. Differences between Scripted Vs Declarative pipeline.

14. Explain Docker layers?

15. Docker file explain?

Get Anudee’s stories in your inbox

Join Medium for free to get updates from this writer.

16. How to assign a specific pod to a specific node only?

17. How to save GCP billing costs?

18. Service agents in GCP?

19. Policies in GCP?

20. How to prevent DDOS on Replication?

21. Explain GCP architecture of your current environment?

22. I don’t want to create the resources with Public ip and want to create it only in Private Ips? “https://www.tenable.com/policies/cloud-security/AC_GCP_0282”

23. How can we get the cloud logs of custom gcs bucker?

24. How to configure logs for a GCS Bucket?

25. How to reduce cost for a GCP services?

26. Best practices to follow inorder to make sure cost of gcp platform is less?

27. How to connect on-premise network to GCP Network?

28. Delete a file in gcs bucket which are more than 50 days older ?

29. I am not able to do the SSH in GCE, how can I fix it ?

30. I have a requirement, my workload pods are running in k8s, I want to access the GCS storage and I want to get access to a single pod. How can I do that?

https://stackoverflow.com/questions/63664800/how-to-access-files-in-google-cloud-storage-through-gke-pod

1. Can you give me a brief idea on how to design a 3 tier architecture in a replication , start with Networking things , how will you place the subnets, where you place which tier in the GCP end , which subnet basically?

2. How will you make a Highly available and Highly scalable?

3. How to schedule a pod on to Nodes?

4. Explain about startup probe?

5. https://medium.com/google-cloud/top-13-google-cloud-reference-architectures-c8a697546505

6. Explain Ingress?

7. Explain headless services?

8. Types of K8s services?

9. Explain how to prevent Zero Downtime deployment in Kubernetes?

10. Run Vs Entrypoint.

11. How to write a Terraform Module on GCP ?

Billing admin and Billing users will come to know about budgets alerts via email. beyond emails and automate action u should consider using quotas and programmatic budget notifications.

12. how to create a 3 tier architecture with a networking, subnets?

14. How will you make the Highly available and Highly Scalable?

15. I want to deploy an application with no downtime?

Here are four common strategies for achieving zero downtime deployment:

• Blue-Green Deployment. Blue-Green Deployment involves maintaining two identical production environments, with one serving as the primary (blue) and the other as the standby (green). …

• Canary Deployment. …

• Rolling Deployment. …

• Rolling Update Deployment.

16. I am facing 503 error, How will you fix it?

17. Difference between IGW and NAT Gateway?

18. TCP vs UDP.

19. Explain the architecture of a current application?

20. What are Docker Layers?

21. Entrypoint Vs RUN?

22. How can we decrease size of a docker image?

23. Best practices for writing a docker file?

24. Docker cache?

K8s:-

*****

1. Services with in Kubernetes

2. What is a headless service? (https://adil.medium.com/what-is-headless-service-in-kubernetes-6c376d1fc156)

3. Pod disruption budget?

4. I have a k8s manifest file, where it’s working in Devenvironment but not working in UAT, what is the cause of it?

5. Which patterns are there for a container in a pod?

6. How can we place our container with in a pod? (Side car container)

7. Types of patterns? (https://www.wallarm.com/what/top-kubernetes-design-patterns#:~:text=Common%20Kubernetes%20design%20patterns%20include,utilization%20in%20their%20Kubernetes%20environments.)

8. There are 2 pods, pod an and pod b . I want to place them on two different pods i..e pod a on node a and podb on node (https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#:~:text=You%20can%20constrain%20a%20Pod,Pod%20topology%20spread%20constraints)

9. What will happen if Kubernetes master node goes down? (https://stackoverflow.com/questions/39172131/what-happens-when-the-kubernetes-master-fails)

10. What happens when worker node fails?

11. Best practices while writing the k8s manifest file? (https://spacelift.io/blog/kubernetes-best-practices)

12. Difference between Startup probe Vs Liveness Probe?

13. What will happens if startup probe fails and what will happen? (https://stackoverflow.com/questions/65858309/why-do-i-need-3-different-kind-of-probes-in-kubernetes-startupprobe-readinessp)

14. Difference between Ingress and Ingress controller?

15. What will happens when the limit reached for pod? (https://blog.kubecost.com/blog/requests-and-limits/#:~:text=Pods%20will%20be%20CPU%20throttled,spare%20CPU%20resources%20when%20available.&text=CPU%20requests%20are%20set%20in,1%20vCPU%20or%201%20Core.)

16. Compressable and Incompressible resource?

17. Can we ping k8s services ? ( No — https://dev.to/danielepolencic/learn-why-you-cant-ping-a-kubernetes-service-3nlm)

18. Which service we can ping and which service we can’t ping?

19. deschedulers in K8s ?

20. QOS in K8s?

21. https://sysdig.com/blog/kubernetes-limits-requests/

Terraform:-

************

PDE-3733

[Spike] Look into any restrictions which are associated with an enterprise-managed GitHub account

Sprint:- 24.4.16

Do you know if there is a way to divert all traffic through the www version?

So anyone going to pocket-concierge.jp/… would automatically hit www.pocket-concierge.jp/.... instead?

Have a piece of work I am wondering if you can help out with — I want to add health check monitoring for the application — so if pocket-concierge.jp is not returning a 200 status code, AWS will send an alert. Is this something you have experience with?

https://stackoverflow.com/questions/49611725/email-alert-on-aws-for-webservice-health. → Use AWS Lambda, AWS SES, Cloudwatch ..

So it looks something like this. If you add the string of “Jean-Luc Picard”, and then you add .lower() as a method, it’ll return all lowercase characters.

the next one you’re going to learn is .upper(). So .upper() converts a string to all uppercase letters.

These built-in functions are just called by themselves. So if you want to find the length of the name string, you call len()

Whitespace is any character that is printed as blank space. This includes things like spaces, tabs, and even line feeds, which are special characters that move output to a newline.

There are three string methods that you can use to remove this whitespace from a string: .rstrip() removes trailing spaces from the right side of the string, .lstrip() removes preceding spaces from the left side of the string, and .strip() removes whitespaces from both left and right sides, so anything at the beginning or at the end of the string would be removed.

Interestingly, it doesn’t remove spaces from the middle. Let’s try some of this out in the interactive window.

1. We both working on changes, we pulled it from GitHub, but not made any changes. I ran the terraform command. I am able to provision the 10 resources. But when you run the command you got the already exits error. Why and how to troubleshoot it.

Ideally scenario should see no such changes. Terraform backend is missing and it fixes this error.

2. Terraform remote state block just as data block.

3. I want to delete only 10 resources.

Example: terraform destroy -target=”aws_instance.my_server and Multiple resources (one at a time)

terraform destroy -target=”resource_type.resource_name1"

terraform destroy -target=”resource_type.resource_name2"

# … repeat for all 10 resources

• Identify the resources: Find the exact names or addresses of the 10 resources you want to delete from your Terraform state file.

• Run the command:

• Single resource deletion:

terraform destroy -target=”resource_type.resource_name”

4. For_each Vs Count Vs For (in terraform)

1. What is the purpose of the terraform taint command?

2. How do you use loops in Terraform?

3. What is the difference between count and for_each in Terraform?

4. How can you format Terraform configuration files?

5. what is the purpose of the terraform validate command?

6. How do you handle secrets in Terraform?

7. How do you import existing resources into terraform?

8. What is remote state and how do you configure it in terraform?

9. How do you manage different environments in terraform?

10. what are modules in Terraform?

11. what is a state file and why is it important to manage state file in terraform?

12. what is a provider in terraform?

13. what are the main features of terraform?

14. How do you debug terraform configurations?

15. What is the difference between local and remote backends in terraform?

16. what are dynamic blocks in terraform?

17. what is the purpose of the terraform state mv command?

18. what is the terraform registry?

19. How do you generate and view a resource graph in terraform?

20. what are terraform cloud and terraform enterprise?

September 5 to September 9:-

Write all the codes:-

*******************

Terraform Modules

Terraform Resources

Terraform Loops

Terraform Locals

Terraform Datasources

Terraform Templates

Terraform lifecycle

Terraform Workflow

Terraform debug.

Terraform Functions and Loops

Terraform Ternary Operator.

Terraform Troubleshooting.

Terraform Workspaces,

Jenkins:-

********

1. Declarative Vs Scripted pipelines? (https://medium.com/globant/jenkins-pipeline-declarative-vs-scripted-21f8688ee16a)

2. Executors in Jenkins?

— > An executor in Jenkins is a slot that allows tasks to run on an agent or node, like a build server. It’s a thread in the agent, and the number of executors on a node determines how many tasks can run at the same time

3. Various types of pipelines in Jenkins?

— > The four main types of Jenkins pipelines are– Declarative, Scripted, Multibranch, and Shared Library

4. Post build steps in jenkins ?

https://plugins.jenkins.io/postbuild-task/

Github:-

*******

1. I want to switch to Branch b and you don’t want to commit anything, How can I switch ?

https://kodekloud.com/blog/git-switch-vs-checkout/

2. Git fetch Vs Pull ?

3. When we face merge conflicts?

4. I don’t want users to commit anything , until or unless they add the jira id to commit messages.

5. Branching strategy in pocket?

We make a release branch from main at the start of each sprint, and deploy to that. At the close of each sprint, we push the release branch to main which then goes to production.

Hotfixes directly to main are possiblee.

1. How are you managing releases and Rollbacks?

Linux:-

1) I have a 15gb space, but still I am not able to create a file?

2. How to check the exit status of the last command?

3. How to check the open ports in linux?

4. I want to check the DNS records for google.com ?

5. How to check the memory?

6. Default behaviour of a shell script? If there are 10 commands , 5th command failed. Will the shell script still execute for the other commands?

https://stackoverflow.com/questions/2870992/automatic-exit-from-bash-shell-script-on-error

7. Which command you schedule a recurring task

8. Last file of a local log file?

Scripting:-

********

Q) Write a shell script, to read data from log status data and print the status code as 503.

#!/bin/bash

LOG_FILE=”/path/to/your/log/file”

grep “ 503 “ “$LOG_FILE” | awk ‘{print $9}’

Explanation:

• #!/bin/bash: This is the shebang, which specifies that the script should be interpreted using Bash.

• LOG_FILE=”/path/to/your/log/file”: Replace /path/to/your/log/file with the actual path to your log file.

• grep “ 503 “ “$LOG_FILE”: This command searches the log file for lines containing the status code 503.

• awk ‘{print $9}’: This awk command extracts the 9th field (which is typically the status code) from each matching line.

How to use:

• Save the script as a .sh file (e.g., get_503_status.sh).

• Make the script executable: chmod +x get_503_status.sh

• Run the script: ./get_503_status.sh

This will print all the 503 status codes found in the specified log file.

Important considerations:

• Log file format: This script assumes that the log file format is consistent and that the status code is in the 9th field. You may need to adjust the awk command if your log file has a different format.

• Error handling: You can add error handling to check if the log file exists, if grep found any matches, etc.

• I haven’t tested this on a 500 code, but it works on others like 200, 302 and 404.

• response=$(curl — write-out ‘%{http_code}’ — silent — output /dev/null servername)

• Note, format provided for — write-out should be quoted. As suggested by @ibai, add — head to make a HEAD only request. This will save time when the retrieval is successful since the page contents won’t be transmitted.

AWS:-

******

Cloud formation,

Lambda

SQS, SNS,

AWS S3, Akamai CDN .

https://enterprise-confluence.aexp.com/confluence/pages/viewpage.action?pageId=639687508 → VP Notes. “Sarvenaz Myslicki”

https://enterprise-confluence.aexp.com/confluence/display/EAP/Python+Automations+in+eAP → Python Automation

https://linumary.medium.com/learning-terraform-with-real-world-scenarios-part-2-e5749e8e6f8e → TF

https://medium.com/hashicorp-engineering/unleashing-the-power-of-terraform-0-12-f864dd0cec4b → TF

https://medium.com/@bachlmayr/https-medium-com-friends-dont-let-friends-build-landing-zones-12f491e0388f → Explains about Landing zone.

Chart version — 2.16/2.2.0 → HELM

Task:- I want to add health check monitoring for the application — so if pocket-concierge.jp is not returning a 200 status code, AWS will send an alert. (SNS) Is this something you have experience with?

Lounge Buddy AWS Services:-

1) AWS EKS, AWS ELB/NLB/ALB, RDS postgresql, AWS MQ, S3, Public subnet has Load balancer and Private subnet has EKS, .

TLS Certificate

Zero Touch

Argo cd which is GitOps.

Resy Architecture:-

My Major Tasks:-

Github Actions

Teraform

(mix of Openshift, Istio/Gloo, Prometheus, Grafana, Splunk)

AWS services.

Jenkins

--

--