Kubernetes CKA certification
543 subscribers
8 photos
14 files
182 links
kubernetes certification training
Download Telegram
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Suppose you have 3 containers running and out of these, you wish to access one of them. How do you access a running container?
The following command lets us access a running container:

$ docker exec -it <container id> bash
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

How to start, stop and kill a container?

The following command is used to start a docker container:
$ docker start <container_id>

and the following for stopping a running container:
$ docker stop <container_id>

kill a container with the following command:
$ docker kill <container_id>
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

How do you create a docker container from an image?
Pull an image from docker repository with the above command and run it to create a container. Use the following command:

$ docker run -it -d <image_name>
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Authentication and authorization in Amazon EKS
Amazon EKS uses IAM to provide authentication to your Kubernetes cluster.
When you use kubectl to interact with Amazon EKS under the hood it uses the aws eks get-token command, available in version 1.18.49 or later of the AWS CLI, or the AWS IAM Authenticator for Kubernetes to fetch an authentication token, which is passed along in the Authorization header of an HTTP request sent to the Kubernetes API server.
Link: https://aws.amazon.com/blogs/containers/kubernetes-rbac-and-iam-integration-in-amazon-eks-using-a-java-based-kubernetes-operator/
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Resource in RBAC:
A pod, service, or secret that the entity wants to access using the certain operations.
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Role in RBAC:
Used to define rules for the actions the entity can take on various resources.
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Role binding in RBAC:
This attaches (binds) a role to an entity, stating that the set of rules define the actions permitted by the attached entity on the specified resources.
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Entity in RBAC:
A group, user, or service account (an identity representing an application that wants to execute certain operations (actions) and requires permissions to do so).
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

When to Use Multiple Namespaces in Kubernetes?
Namespaces are intended for use in environments with many users spread across multiple teams, or projects. For clusters with a few to tens of users, you should not need to create or think about namespaces at all. Start using namespaces when you need the features they provide.

Namespaces provide a scope for names. Names of resources need to be unique within a namespace, but not across namespaces. Namespaces cannot be nested inside one another and each Kubernetes resource can only be in one namespace.
AWS DEVOPS πŸ€— Cloud Training ☁️

Click on the link below to join our whatsapp group
https://chat.whatsapp.com/FPLsEqXJfPuHeLST0d4CIg

AWS DEVOPS
DATE: 9-Mar-2022
TIME: 7PM IST


We provide free session also to boost up your knowledge here.


#AWS #DEVOPS #PROJECT #TRAINING
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Working with Namespaces
Viewing namespaces - kubectl get namespace
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Kubernetes starts with four initial namespaces:
default: The default namespace for objects with no other namespace
kube-system: The namespace for objects created by the Kubernetes system
kube-public: This namespace is created automatically and is readable by all users (including those not authenticated). This namespace is mostly reserved for cluster usage, in case that some resources should be visible and readable publicly throughout the whole cluster. The public aspect of this namespace is only a convention, not a requirement.
kube-node-lease: This namespace holds Lease objects associated with each node. Node leases allow the kubelet to send heartbeats so that the control plane can detect node failure.
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Namespaces and DNS
When you create a Service, it creates a corresponding DNS entry.
This entry is of the form <service-name>.<namespace-name>.svc.cluster.local, which means that if a container only uses <service-name>, it will resolve to the service which is local to a namespace.
This is useful for using the same configuration across multiple namespaces such as Development, Staging and Production. If you want to reach across namespaces, you need to use the fully qualified domain name (FQDN).
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Not All Objects are in a Namespace
Most Kubernetes resources (e.g. pods, services, replication controllers, and others) are in some namespaces. However namespace resources are not themselves in a namespace. And low-level resources, such as nodes and persistentVolumes, are not in any namespace.

To see which Kubernetes resources are and aren't in a namespace:

# In a namespace
kubectl api-resources --namespaced=true

# Not in a namespace
kubectl api-resources --namespaced=false
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

What is Jobs Kubernetes?
A Job creates one or more Pods and will continue to retry execution of the Pods until a specified number of them successfully terminate.
As pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the task (ie, Job) is complete.
Deleting a Job will clean up the Pods it created.
Suspending a Job will delete its active Pods until the Job is resumed again.
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

Running an example Job in Kubernetes
apiVersion: batch/v1
kind: Job
metadata:
name: pi
spec:
template:
spec:
containers:
- name: pi
image: perl
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
restartPolicy: Never
backoffLimit: 4

You can run the example with this command:

kubectl apply -f https://kubernetes.io/examples/controllers/job.yaml
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

How to Clean up finished jobs automatically
Finished Jobs are usually no longer needed in the system.
Keeping them around in the system will put pressure on the API server.
If the Jobs are managed directly by a higher level controller, such as CronJobs, the Jobs can be cleaned up by CronJobs based on the specified capacity-based cleanup policy.
πŸ’₯πŸ’₯ Today's Technotes πŸ’₯πŸ’₯

what is Bare Pods in Kubernetes?
When the node that a Pod is running on reboots or fails, the pod is terminated and will not be restarted. However, a Job will create new Pods to replace terminated ones. For this reason, we recommend that you use a Job rather than a bare Pod, even if your application requires only a single Pod