CKAD Part17 – Volumes, PersistentVolumes & PersistentVolumeClaims

Kubernetes Volumes Internal container storage is ephemeral, which means that it exits only for the lifetime of the container. When the container is stopped any data written inside the container is lost. Volumes provide a means of storing data beyond the life of the container. The Pod definition below contains an emptyDir Volume  An emptyDir is an empty directory that is created when a Pod is assigned to a Node. All containers in a Pod can read and write in the emptyDir Volume which makes useful for multi container Pod use cases. apiVersion: v1 kind: Pod metadata: name: pod-volume-1 spec: containers: - name: volume-container-1 image: [...]

By |2021-07-01T15:33:34+01:00July 1st, 2021|Kubernetes|0 Comments

CKAD Prep Part 16 – Network Policies

Network Policies By default, a Pod can communicate with any other Pod in the same cluster. NetworkPolicies allow you to limit the network traffic allowed to and from Pods in the cluster. A sample NetworkPolicy is shown below. apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: sample-network-policy spec: podSelector: matchLabels: app: secure-app policyTypes: - Ingress - Egress ingress: # traffic coming into the Pod - from: - podSelector: matchLabels: allow-access: "true" # allow inbound traffic from Pods that have this label ports: - protocol: TCP port: 6379 egress: # traffic coming into the Pod - to: - podSelector: matchLabels: allow-access: "true" # allow outbound traffic to Pods [...]

By |2021-06-22T22:49:04+01:00June 22nd, 2021|Kubernetes|0 Comments

CKAD Prep Part 15 – Services

Kubernetes Services A Kubernetes Service object is an abstraction that provides network access to a dynamic set of Pod replicas. Rather than access Pods directly via their IPs, you can use a Service to proxy requests and deal with service discovery and load balancing. A Service usually uses a selector to decide which Pods will receive traffic. As Pods are dynamically added and removed, the Service will maintain a list of active Pods that are eligible to receive traffic. Defining a Service Below is a sample Service definition. apiVersion: v1 kind: Service metadata: name: my-service spec: type: ClusterIP selector: app: nginx ports: - protocol: TCP [...]

By |2021-06-22T22:51:23+01:00June 15th, 2021|Kubernetes|0 Comments

CKAD Prep Part 14 – Jobs & Cronjobs

Jobs & Cronjobs Jobs A Job is a Kubernetes object that executes a workload and then terminates once the workload is complete. When a Job finishes, the containers involved are terminated and the Pod transitions to the Completed state. Jobs and Pods are similar in that they're both used to run containers. However, Pods typically run containers continuously, whereas Jobs run containers to do a discrete piece of work and then terminate. The sample Job below is taken from the Kubernetes documentation and uses Perl to compute π to 2000 decimal places. apiVersion: batch/v1 kind: Job metadata: name: pi spec: template: spec: containers: - name: [...]

By |2021-06-22T22:56:08+01:00June 13th, 2021|Kubernetes|0 Comments

CKAD Prep Part 13 – Rolling Updates & Rollbacks

Rolling Updates & Rollbacks Rolling updates provide a mechanism for updating containers in a cluster without downtime. This powerful Kubernetes feature allows you to update containers while maintaining high availability. To see this in action we'll create a Deployment consisting of 3 nginx Pods using the definition below. Note that the container image we're going to run is library/nginx:1.20.0. apiVersion: apps/v1 kind: Deployment metadata: name: rolling-update-deployment spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: library/nginx:1.20.0 imagePullPolicy: IfNotPresent Run kubectl apply -f rolling-update-deployment.yaml to create the Deployment.  A quick listing will show 3 Pods running as [...]

By |2021-06-22T23:34:01+01:00June 10th, 2021|Kubernetes|0 Comments

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
Go to Top