Types of communication in Amazon EKS

There are multiple types of communication in Amazon EKS environments. Lines of communication include the following: Interpod communication between containers Communication between pods on the same node or pods on different nodes Ingress connections from outside the cluster In some cases, the default Kubernetes methods are used. In other cases, specifically inter-node communication and ingress methods specific to Amazon EKS are used. Intrapod communication Containers in a pod share a Linux namespace and can communicate with each other using localhost....

September 10, 2022 · 3 min · 430 words · Andrew

How to Install App Mesh on AWS EKS

You can follow the steps below to install App Mesh on AWS EKS (Kubernetes). Step 1 – Prerequisites curl -o pre_upgrade_check.sh https://raw.githubusercontent.com/aws/eks-charts/master/stable/appmesh-controller/upgrade/pre_upgrade_check.sh sh ./pre_upgrade_check.sh Step 2 – Add Helm Repo helm repo add eks https://aws.github.io/eks-charts Step 3 – Add Custom Resource Definitions (CRDs) kubectl apply -k "https://github.com/aws/eks-charts/stable/appmesh-controller/crds?ref=master" Step 4 – Create a Namespace for App Mesh kubectl create ns appmesh-system Step 5 – Set Environment Variables You will need to set a couple of environment variables to make things easier later....

April 26, 2022 · 2 min · 235 words · Andrew

[Solved] Kubernetes Namespace stuck in Terminating state

If you have tried to delete a Kubernetes namespace, and it has been hanging in ‘deleting’ for hours on end, it’s likely that you have dangling resources that have not deleted yet. $ kubectl get ns NAME STATUS AGE apps Active 2d19h default Active 3d8h my-apps Terminating 11h This will prevent the namespace from being removed. How to find resources that need to be deleted You can chain the api-resources verbs along with a kubectl get to find dangling resources:...

April 25, 2022 · 1 min · 188 words · Andrew

[Solved] Error creating: pods “my-service-a-xxx” is forbidden: error looking up service account my-apps/my-service-a: serviceaccount “my-service-a” not found

So you’ve run a deployment and tried to check the pods and there’s nothing there! kubectl get pods Next step is to see what’s happening with the replicaset kubectl get rs Then take the replicaset name and do a describe on it: kubectl describe rs my-service-a-5549cbc6c8 The error Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedCreate 2m10s.. replicaset-controller Error creating: pods "my-service-a-5549cbc6c8-" is forbidden: error looking up service account my-apps/my-service-a: serviceaccount "my-service-a" not found It’s down to a missing Service Account!...

April 24, 2022 · 1 min · 132 words · Andrew

How to Force a Redeploy in Kubernetes

If you need to force a redeploy of a deployment in Kubernetes, then you can use the rollout feature. You may have an image that has been updated, but without changing the tag/version. Step 1 – Optionally update the imagePullPolicy If you have not changed the image version, then check your imagePullPolicy. In your deployment.yaml file: containers: - name: backend image: aoms/mock_backend_python:latest imagePullPolicy: Always Step 2 – Get the deployment name kubectl get deploy Step 3 – Force the Redeployment kubectl rollout restart deploy backend

April 22, 2022 · 1 min · 85 words · Andrew

How to Restart a Deployment in Kubernetes

If you need to restart a deployment in Kubernetes, perhaps because you would like to force a cycle of pods, then you can do the following: Step 1 – Get the deployment name kubectl get deployment Step 2 – Restart the deployment kubectl rollout restart deployment <deployment_name>

April 20, 2022 · 1 min · 47 words · Andrew

How to Create a Horizontal Pod Autoscaler in Kubernetes

If you could like to a create a Horizontal Pod Autoscaler (hpa) in Kubernetes, then you could run the following: Step 1 – Create a Deployment If you already have a deployment, then ignore this step, otherwise: kubectl create deployment php-apache --image=us.gcr.io/k8s-artifacts-prod/hpa-example kubectl set resources deploy php-apache --requests=cpu=200m kubectl expose deploy php-apache --port 80 kubectl get pod -l app=php-apache Step 2 – Create a Horizontal Pod Autoscaler kubectl autoscale deployment php-apache `#The target average CPU utilization` \ --cpu-percent=50 \ --min=1 `#The lower limit for the number of pods that can be set by the autoscaler` \ --max=10 `#The upper limit for the number of pods that can be set by the autoscaler` Step 3 – Get your hpa kubectl get hpa

April 18, 2022 · 1 min · 121 words · Andrew

How to Run a Load Generator on Kubernetes

If you would like to test hpa, Horizontal Pod Autoscaling, or throw some chaos at a specific deployment in Kubernetes, then you could run a Load Generator Step 1 – Run a BusyBox container The following command will use a busybox container and dump you into it’s shell window: kubectl run -i --tty load-generator --image=busybox /bin/sh As an alternative, you could also run: kubectl --generator=run-pod/v1 run -i --tty load-generator --image=busybox /bin/sh Step 2 – Run a wget loop You can now trigger a wget loop to make HTTP request calls to your deployment:...

April 17, 2022 · 1 min · 152 words · Andrew

How to Deploy a Metrics Server in Kubernetes

If you would like to deploy a Metrics Server in Kubernetes, then you first need to create a namespace for it to live it, followed by installing the actual metrics server. Step 1 – Install the Metrics Server Using kubectl kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.5.0/components.yaml Using helm kubectl create namespace metrics helm install metrics-server \ stable/metrics-server \ --version 2.9.0 \ --namepsace metrics Step 2 – Get the Metrics Server Status If you used kubectl above, then you should be able to run:...

April 16, 2022 · 2 min · 231 words · Andrew

How to create an AWS EKS cluster using eksctl

eksctl dramatically simplifies the creation of AWS EKS clusters, by providing a simple command-line interface. Step 1 – Define a Cluster YAML You can either create a file called ekscluster.yaml and place the YAML in, or run the following command which will create a file called ekscluster.yaml and automatically add the default YAML configuration for you. cat << EOF > ekscluster.yaml --- apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: eksworkshop-eksctl region: ${AWS_REGION} version: "1....

April 15, 2022 · 1 min · 134 words · Andrew