KCAD 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-05-03T23:15:26+01:00April 30th, 2021|Kubernetes|0 Comments

KCAD 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-04-26T22:21:03+01:00April 26th, 2021|Kubernetes|0 Comments

KCAD 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 KCAD & sleep 3600'] apiVersion: v1 - version of the Kubernetes API this yaml is compatible with kind: Pod - [...]

By |2021-04-30T21:31:42+01:00April 25th, 2021|Kubernetes|0 Comments

KCAD 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 Kubernetes Certified Application Developer (KCAD) 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-04-23T23:25:48+01:00April 23rd, 2021|Kubernetes|0 Comments

Spring Cloud Config Server on Kubernetes – Part 2

This is the second of a two part article about building centralised configuration with Spring Cloud Config Server. In this post we'll take the the two Spring Boot services created in part one and run them on Kubernetes. We'll initially deploy to a local cluster before stepping things up and deploying to Azures manged Kubernetes Service, AKS. By the end of this post you should have two Spring Boot services deployed to an AKS cluster as shown in the diagram below. Source Code The full source code for this post (and part one) is available on Github. If you want to get up and running [...]

By |2021-04-21T21:56:54+01:00April 20th, 2021|Kubernetes|0 Comments

Spring Cloud Config Server on Kubernetes – Part 1

This is the first of a two part article where I'll show you how to use Spring Cloud Config Server to build centralised configuration for your microservices.  In this first post we'll create a Config Service that pulls its data from a Git repo and exposes it to other services. We'll also create a consumer, a Config Consumer Service that pulls from the Config Service on startup.  The diagram below shows how the services will interact. In part two of this article we'll take the two services and deploy them to Kubernetes. We'll initially deploy and test on a local Kubernetes cluster, before deploying on Azures [...]

By |2021-04-20T23:41:50+01:00April 11th, 2021|Kubernetes|0 Comments
Go to Top