CKAD Prep Part 6 – Container Resource Requirements

Container Resource Requirements Kubernetes allows you to specify the CPU and memory requirements for a container. As part of the Pod  spec you can specify CPU and memory requests and limits.  requests the CPU and memory resources required to run a container used by Kubernetes to decide what worker Node a Pod should be deployed to. This ensures there are sufficient resources on the Node to run the Pod.  limits an upper limit for the resource usage of a container if a container exceeds these limits it will likely be destroyed. stops individual containers monopolising resources on a Node. requests and limits are defined beneath resources [...]

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

CKAD Prep Part 5 – Kubernetes SecurityContexts

Kubernetes SecurityContext A SecurityContext is a Kubernetes object, defined as part of the Pod spec, that describes the privileges and access control settings for a Pod. The primary settings for a SecurityContext are runAsUser - allows you to run containers as a specified user runAsGroup - allows you to run containers as a specified group fsGroup allows you to run containers with and a specific file system group These settings can be applied at the Pod or container level. If applied at the Pod level the settings will apply to all containers in the Pod. If the SecurityContext is defined at both the Pod and [...]

By |2021-06-23T22:18:10+01:00May 10th, 2021|Kubernetes|0 Comments

CKAD Prep Part 4 – Kubernetes Config Maps

Kubernetes Config Maps A ConfigMap is a Kubernetes object that stores configuration data in a key/value store. apiVersion: v1 kind: ConfigMap metadata: name: config-map-demo data: greetingOne: Hey there! greetingTwo: Howdy partner! A ConfigMap can be referenced in a Pod spec and used to configure an application running in a container. ConfigMap Data as Environment Variables The following example shows how we can define an environment variable for a container and then set its value using data from a ConfigMap. apiVersion: v1 kind: Pod metadata: name: config-map-demo-pod labels: app: demo-app spec: containers: - name: demo-app-container image: busybox command: ['sh', '-c', 'echo $GREETING & sleep 3600'] env: [...]

By |2021-06-23T22:18:56+01:00April 30th, 2021|Kubernetes|0 Comments

CKAD Prep Part 3 – Kubernetes Namespaces

Kubernetes Namespaces A Namespace provides a way of organising or categorising resources in a Kubernetes cluster. Every resource you create is associated with a Namespace. When an objects Namespace isn't specified explicitly, it will be associated with the default Namespace. Namespaces are a great way of logically grouping or partitioning resources in a cluster. For example multiple teams in a company using the same cluster could partition resources by namespace. Creating & Viewing Namespaces To create a Namespace run kubectl create namespace some-namespace as follows. You can then view all Namespaces in the cluster by running kubectl get namespaces. Creating a Pod with a Custom Namespace When [...]

By |2021-06-23T22:19:47+01:00April 26th, 2021|Kubernetes|0 Comments

CKAD Prep Part 2 – Kubernetes Pods

Kubernetes Pods A Pod is the basic building block of an application running in Kubernetes. A Pod encapsulates one or more containers and a set of resources shared by those containers.  All containers that run in a Kubernetes cluster run inside a Pod. Creating a Pod Below is a sample Pod definition. To apply this to the cluster run kubectl apply -f demo-pod.yml apiVersion: v1 kind: Pod metadata: name: demo-pod labels: app: demo-app spec: containers: - name: demo-app-container image: busybox command: ['sh', '-c', 'echo hello CKAD & sleep 3600'] apiVersion: v1 - version of the Kubernetes API this yaml is compatible with kind: Pod - [...]

By |2021-06-23T22:23:56+01:00April 25th, 2021|Kubernetes|0 Comments

CKAD Prep Part 1 – Kubernetes API Primitives

I've been working with Kubernetes for a while now and and I'm really enjoying it. I feel I've learned quite a bit but its difficult to know how much without some kind of measuring stick. With that in mind I've decided to start studying for the Certified Kubernetes Application Developer (CKAD) exam. When studying for certs in the past I've usually scribbled notes privately in Evernote. This time though I'm going to share them here in a series of posts. It seems a waste to put time and effort into notes and not share them. Putting the notes in the public domain will hopefully help [...]

By |2021-06-23T22:26:03+01:00April 23rd, 2021|Kubernetes|0 Comments
Go to Top