CSS corp interview:
1.How will u recover lost pemkey?
2. How will u attach s3 bucker to ec2 instances?
3.How will u attach storage when storage is filled?
4. What are the storage types in Kubernetes?
5.What are the network types in Kubernetes?
6. How will u connect to ec2 when ssh is disabled? Or what are the ways to connect to ec2 when ssh is
disabled?
7.What is the port No for sqldb?
8. What is the port No for postgresdb?
9.Tell me about the Kubernetes architecture?
10. How will u expose the internet to docker application?
11.How do you handle build failures and troubleshoot issues in your build and release process?
12.What is the command to see all running & stopped containers in docker?
13.What is the use of systems manager in AWs?
1.How will u recover lost pemkey?
Create backup of ami for existing server & by using of ami create new instance with new keypair
Bcz if u lost key pair we cannot recover
Ref1
https://www.linkedin.com/pulse/how-do-i-recover-windows-ec2-instance-pem-file-lost-cloud-in/
2. . How will u attach s3 bucker to ec2 instances?
Ref1 iam role(public acces)
1.create iam s3 fulll access role
2,then attach iam role to ec2 server
3.install aws cli in linux server & then use coommad aws s3 ls
Get list of all the buckets
Ref2
Iam user (access key &secret key)
1.use this command aws configure in linux server
Provide region
Access
Secret key
Format =json or yaml
2.install aws cli in linux server & then use coommad aws s3 ls
Get list of all the buckets
Private access( ec2 to s3)
Use for the s3 endpoint gateway & it is direct connection nat server to s3 &It is reduce nat charges &
check below link
https://www.youtube.com/watch?v=CIME4XLVIyU&t=4s
3.How will u attach storage when storage is filled?
we have three type of storages in aws
s3
iam role attach to server
ebs
https://www.youtube.com/watch?v=6OY4wVVv9Ew
efs
https://docs.aws.amazon.com/efs/latest/ug/wt1-test.html
https://www.google.com/search?
q=efs+mount+on+ec2&sca_esv=597969321&rlz=1C1GCEA_enIN1071IN1071&tbm=vid&sxsrf=ACQVn
0-
s8unTRL0mqBSAN4rtUfZha4N24w:1705106695824&source=lnms&sa=X&ved=2ahUKEwiDoqK3kdm
DAxWuSWwGHeoRCP4Q_AUoAnoECAEQBA&biw=1280&bih=585&dpr=1.5#fpstate=ive&vld=cid:2a
415046,vid:Aux37Nwe5nc,st:0
elastic file system it is centralized file system &
example: master slave configuration of Jenkins server
What are the storage types in Kubernetes?
https://kubernetes.io/docs/concepts/storage/storage-classes/
https://kubernetes.io/docs/concepts/storage/volumes/
Empty dir
Pv
Pvc
Secret
Config map
For a Pod that defines an emptyDir volume, the volume is created when the Pod is
assigned to a node. As the name says, the emptyDir volume is initially empty. All
containers in the Pod can read and write the same files in the emptyDir volume, though
that volume can be mounted at the same or different paths in each container. When a
Pod is removed from a node for any reason, the data in the emptyDir is deleted
permanently.
A Kubernetes emptyDir volume is a directory that exists on the local
node's filesystem with no contents. These volumes are stored either
on the node's backing disk storage or memory. This type of volume
is typically used as a local cache or a means to share data between
different containers of a POD
https://kubernetes.io/docs/concepts/storage/persistent-volumes/
Secret
https://kubernetes.io/docs/concepts/configuration/secret/
Configmap:
https://kubernetes.io/docs/concepts/configuration/configmap/
There are four different ways that you can use a ConfigMap to configure a
container inside a Pod:
1. Inside a container command and args
2. Environment variables for a container
3. Add a file in read-only volume, for the application to read
4. Write code to run inside the Pod that uses the Kubernetes API to read a
ConfigMap
5.What are the network types in Kubernetes?
Pod to pod
The network plugin is configured to assign IP addresses to Pods.
The kube-apiserver is configured to assign IP addresses to Services.
The kubelet or the cloud-controller-manager is configured to assign IP
addresses to Nodes.
Wt is n/w plugin
Services:
https://home.robusta.dev/blog/kubernetes-service-vs-loadbalancer-vs-ingress
4.Headless service
https://stackoverflow.com/questions/50891104/how-does-statefulset-and-headless-service-works-k8s
Use case
https://medium.com/@akansh27/statefulset-3274f71a6942
5. How will u connect to ec2 when ssh is disabled? Or what are the ways to connect to ec2 when ssh
is disabled?
We cant login if u disable ssh
We got timeout error
Then enable port in 22 port inbound rule in security group and save it
Then we ca able to login
7.What is the port No for sqldb?
8. What is the port No for postgresdb?
9. Tell me about the Kubernetes architecture?
https://kubernetes.io/docs/concepts/overview/components/
kube-apiserver
The API server is a component of the Kubernetes control plane that exposes the
Kubernetes API. The API server is the front end for the Kubernetes control plane.
The main implementation of a Kubernetes API server is kube-apiserver. kube-
apiserver is designed to scale horizontally—that is, it scales by deploying more
instances. You can run several instances of kube-apiserver and balance traffic
between those instances.
etcd
Consistent and highly-available key value store used as Kubernetes' backing
store for all cluster data.
If your Kubernetes cluster uses etcd as its backing store, make sure you have
a back up plan for the data.
kube-scheduler
Control plane component that watches for newly created Pods with no
assigned node, and selects a node for them to run on.
Factors taken into account for scheduling decisions include: individual and
collective resource requirements, hardware/software/policy constraints, affinity
and anti-affinity specifications, data locality, inter-workload interference, and
deadlines
kube-controller-manager
Control plane component that runs controller processes.
Logically, each controller is a separate process, but to reduce complexity, they
are all compiled into a single binary and run in a single process.
There are many different types of controllers. Some examples of them are:
Node controller: Responsible for noticing and responding when nodes go down.
Job controller: Watches for Job objects that represent one-off tasks, then creates
Pods to run those tasks to completion.
EndpointSlice controller: Populates EndpointSlice objects (to provide a link
between Services and Pods).
ServiceAccount controller: Create default ServiceAccounts for new namespaces.
Type of controller:
Node controller: For checking the cloud provider to determine if a node
has been deleted in the cloud after it stops responding
Route controller: For setting up routes in the underlying cloud
infrastructure
Service controller: For creating, updating and deleting cloud provider load
balancers
How will u expose the internet to docker application?
Which network driver should be used with Docker Swarm?
Overlay networks
Overlay networks are best when you need containers running on different Docker
hosts to communicate, or when multiple applications work together using Swarm
services.
How do you handle build failures and troubleshoot issues in your build and release process?
https://learn.microsoft.com/en-us/azure/devops/pipelines/troubleshooting/troubleshooting?view=azure-
devops
https://vercel.com/docs/deployments/troubleshoot-a-build
.What is the command to see all running & stopped containers in docker?
13.What is the use of systems manager in AWs?
AWS Systems Manager provides configuration management, which
helps you maintain consistent configuration of your Amazon EC2 or
on-premises instances. With Systems Manager, you can control
configuration details such as server configurations, anti-virus
definitions, firewall settings, and more.