Skip to content

Commit

Permalink
Fix markdown linting errors - not line length
Browse files Browse the repository at this point in the history
This fixes the existing markdownlint errors that are _not_ related to line length. Those will be dealt with separately, since word wrapping may be a controversial subject.
  • Loading branch information
michaelin committed Jan 20, 2025
1 parent cb5ce73 commit b55e240
Show file tree
Hide file tree
Showing 13 changed files with 152 additions and 164 deletions.
4 changes: 3 additions & 1 deletion CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ The exercise should have the following sections:
* Extras and wrap-up (optional)

When creating a new exercise, you should use the [exercise template](exercise-template.md) as a starting point.

## Best practices

### Hints
Use :bulb: `:bulb:` to indicate a hint to the exercise.

Use :bulb: `:bulb:` to indicate a hint to the exercise.

### Dealing with text rich content

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][gitpod]

# kubernetes-katas

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][gitpod]

A selection of [katas][kata-def] for Kubernetes (k8s).

The exercises are ordered in the way we think it makes sense to introduce Kubernetes concepts.
Expand All @@ -13,7 +13,7 @@ You can find a summary of many of the commands used in the exercises in the
> Please have a look at the [Setup](#setup) section if that is not the case.
> There are plenty of free and easy options.
## Katas in suggested order:
## Katas in suggested order

- [intro](intro.md)
- [desired-state](desired-state.md)
Expand Down Expand Up @@ -54,11 +54,11 @@ The commands above will enable kubectl autocompletion when you start a new bash

See: [Kubernetes.io - Enabling shell autocompletion][autocompletion] for more info.

# Cheatsheet
## Cheatsheet

A collection of useful commands to use throughout the exercises:

```
```shell
kubectl api-resources # List resource types


Expand Down
7 changes: 4 additions & 3 deletions accessing-your-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The pod is defined in the `frontend-pod.yaml` file.

You should see something like this:

```
```text
NAME READY STATUS RESTARTS AGE
frontend 1/1 Running 0 2m
```
Expand Down Expand Up @@ -105,15 +105,16 @@ Now we will deploy both the frontend and backend pods.

You should see something like this:

```
```shell
k get pods backend -o wide

NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
backend 1/1 Running 0 11s 10.0.40.196 ip-10-0-35-102.eu-west-1.compute.internal <none> <none>
```

In this case the IP is `10.0.40.196`, but it will be different in your case.

**Add environment variables to the frontend pod**
#### Add environment variables to the frontend pod

- Open the `frontend-pod.yaml` file and add the following environment variables to the pod:

Expand Down
61 changes: 29 additions & 32 deletions configmaps-secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Step by step:

> :bulb: All files for the exercise are found in the `configmap-secrets/start` folder.

**Add the database part of the application**
#### Add the database part of the application

We have already created the database part of the application, with a deployment and a service.

Expand Down Expand Up @@ -180,7 +180,7 @@ frontend-5f9b5f46c8-jkw9n 1/1 Running 0 4s
postgres-6fbd757dd7-ttpqj 1/1 Running 0 4s
```

**Refactor the database user into a configmap and implement that in the backend**
#### Refactor the database user into a configmap and implement that in the backend

We want to change the database user into a configmap, so that we can change it in one place, and use it on all deployments that needs it.

Expand All @@ -195,7 +195,6 @@ data:
DB_NAME: quotes
```


:bulb: If you are unsure how to do this, look at the [configmap section](#configmaps) above.

<details>
Expand All @@ -205,7 +204,7 @@ If you are stuck, here is the solution:

This will generate the file:

```
```shell
kubectl create configmap postgres-config --from-literal=DB_HOST=postgres --from-literal=DB_PORT=5432 --from-literal=DB_USER=superuser --from-literal=DB_PASSWORD=complicated --from-literal=DB_NAME=quotes --dry-run=client -o yaml > postgres-config.yaml
```

Expand All @@ -226,39 +225,37 @@ data:

</details>


- apply the configmap with `kubectl apply -f postgres-config.yaml`

- In the `backend-deployment.yaml`, change the environment variables to use the configmap instead of the hardcoded values.

Change this:

```yaml
env:
- name: DB_HOST
value: postgres
- name: DB_PORT
value: "5432"
- name: DB_USER
value: superuser
- name: DB_PASSWORD
value: complicated
- name: DB_NAME
value: quotes
```

To this:

```yaml
envFrom:
- configMapRef:
name: postgres-config
```
Change this:

```yaml
env:
- name: DB_HOST
value: postgres
- name: DB_PORT
value: "5432"
- name: DB_USER
value: superuser
- name: DB_PASSWORD
value: complicated
- name: DB_NAME
value: quotes
```

To this:

```yaml
envFrom:
- configMapRef:
name: postgres-config
```

- re-apply the backend deployment with `kubectl apply -f backend-deployment.yaml`
- check that the website is still running.

**Change the database password into a secret, and implement that in the backend.**
#### Change the database password into a secret, and implement that in the backend

We want to change the database password into a secret, so that we can change it in one place, and use it on all deployments that needs it.
In order for this, we need to change the backend deployment to use the secret instead of the configmap for the password itself.
Expand All @@ -277,7 +274,7 @@ Help me out!

If you are stuck, here is the solution:

```
```shell
kubectl create secret generic postgres-secret --from-literal=DB_PASSWORD=complicated --dry-run=client -o yaml > postgres-secret.yaml
```

Expand Down Expand Up @@ -322,7 +319,7 @@ envFrom:

- Check that the website is still running.

**Change database deployment to use the configmap and secret.**
#### Change database deployment to use the configmap and secret

We are going to implement the configmap and secret in the database deployment as well.

Expand Down
Loading

0 comments on commit b55e240

Please sign in to comment.