CKAD Prep Part 12 – Deployments

Kubernetes Deployments A Kubernetes Deployment object provides a means of managing a group of Pod instances, known as replicas. The Deployment tells Kubernetes the type of Pod you want to run and the number of Pod instances. This is known as the desired state. Kubernetes will actively monitor the number of active Pod replicas and take action to ensure it is the same as the desired state. For example, if your Deployment specifies that there should be three Pod replicas for a microservice, and one of those Pods die, Kubernetes will take corrective action and spin up a new Pod to replace the one that [...]

By |2021-06-23T22:08:17+01:00June 2nd, 2021|Kubernetes|0 Comments

CKAD Prep Part 11 – Labels, Selectors & Annotations

Kubernetes - Labels, Selectors & Annotations Labels Labels are key/value pairs that are used to add metadata to Kubernetes objects. They can be used to select and group subsets of objects in the cluster. Labels are added to an object in the metadata.labels section of the object descriptor as shown in the two Pod definitions below. apiVersion: v1 kind: Pod metadata: name: dev-pod labels: app: my-service environment: dev spec: containers: - name: nginx-container image: nginx imagePullPolicy: Always apiVersion: v1 kind: Pod metadata: name: prod-pod labels: app: my-service environment: prod spec: containers: - name: nginx-container image: nginx imagePullPolicy: Always After creating the above Pods run kubectl [...]

By |2021-06-23T22:10:03+01:00June 1st, 2021|Kubernetes|0 Comments

CKAD Prep Part 10 – Kubernetes Liveness & Readiness Probes

Kubernetes Liveness & Readiness Probes Liveness Probe A Liveness probe indicates whether or not a container is healthy and is used by Kubernetes to determine when a container should be terminated and restarted. You define your own custom criteria for determining container health. For example, if your container is running a microservice, that application will likely have a HTTP health check endpoint. The health check endpoint can be used as the Liveness probe to determine the containers health status. In other words, if the microservice is deemed healthy, the container is healthy. The Pod definition below creates a file called health.txt and write it to [...]

By |2021-06-23T22:11:17+01:00May 27th, 2021|Kubernetes|0 Comments

CKAD Prep Part 9 – Kubernetes Multi Container Pods

Kubernetes Multi Container Pods There are some use cases where you may want to run multiple containers inside the same Pod. For example, you could have a microservice running in one container that writes logs to a volume. A second container running a log agent could capture and push those logs to a centralised logging solution. In this instance both containers run inside the same Pod and work as a unit. Containers Communicating within a Pod Shared Network - containers running in the same Pod share the same network space and can access one another via localhost. In the diagram below Container 1 can access [...]

By |2021-06-23T22:12:39+01:00May 24th, 2021|Kubernetes|0 Comments

CKAD Prep Part 8 – Kubernetes Service Accounts

Kubernetes Service Accounts As a developer or a cluster admin, you interact with the Kubernetes apiserver via kubectl. A ServiceAccount is a Kubernetes object that allows an application running inside a Pod to access the Kubernetes apiserver. This is useful for applications that need to interact directly with the Kubernetes API, such as monitoring tools.  A ServiceAccount allows an application to talk to the apiserver securely with the appropriate permissions. A ServiceAccount is defined as follows. apiVersion: v1 kind: ServiceAccount metadata: name: sample-service-account The ServiceAccount itself is of little use unless you associate it with a set of roles. To do this you'll need to create a [...]

By |2021-06-23T22:14:21+01:00May 17th, 2021|Kubernetes|0 Comments

CKAD Prep Part 7 – Kubernetes Secrets

Kubernetes Secrets A Secret is a Kubernetes object that encapsulates sensitive data such as a password or key. A Secret can be consumed by a container so that applications can access the sensitive data at runtime. Defining a Secret A sample Secret definition is shown below. apiVersion: v1 kind: Secret metadata: name: sample-secret #stringData: #databasePassword: password11 data: databasePassword: cGFzc3dvcmQxMQ== The Secret value can be set as either a plain string or a Base64 encoded string. The example above uses the data attribute with a Base64 encoded value for the key databasePassword. Base64 encoding is useful if you want to specify binary data such as a certificate. [...]

By |2021-06-23T22:15:10+01:00May 16th, 2021|Kubernetes|0 Comments
Go to Top