Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yaml,yml}]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false

[Makefile]
indent_style = tab

[*.go]
indent_style = tab
indent_size = 4

[*.sh]
indent_style = space
indent_size = 2
89 changes: 89 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Contributing to Cloud Native Lab

Thank you for your interest in contributing to this repository.
This guide explains the conventions, standards and workflow for contributions.

## Naming Conventions

- Use **lowercase kebab-case** for all directory and file names
- Examples: `my-lab/`, `config-map.yaml`, `validate.sh`
- Do not use spaces, underscores, or camelCase in file or directory names

## Lab Structure

Every lab must contain at minimum:

```text
lab-name/
├── README.md # Objective, instructions, validation, cleanup
├── namespace.yaml # Kubernetes namespace for the exercise
├── resources.yaml # Kubernetes resources (or split into individual files)
├── validate.sh # Validation commands
└── cleanup.sh # Cleanup commands
```

Refer to the [lab README template](../docs/templates/lab-readme-template.md)
for the expected structure.

## Validation

Before submitting a pull request:

1. Verify Kubernetes YAML indentation is correct
2. Verify that selector labels match Pod template labels
3. Verify that Services target the correct ports
4. Run `bash validate.sh` from within the lab directory
5. Run `bash scripts/validate-manifests.sh` from the repository root
6. Run `make lint` to check Markdown, YAML and shell scripts

## Documentation Expectations

- Every lab must have a complete `README.md`
- Every top-level directory must have a `README.md`
- Markdown must pass `markdownlint` with the `.markdownlint.json` configuration
- Use clear, professional English
- Explain _why_, not just _what_

## Safe Scripting

- All Bash scripts must begin with `#!/usr/bin/env bash`
- Use `set -euo pipefail` in all scripts
- Scripts must not silently delete unrelated resources
- Cleanup scripts must only delete resources created by the specific lab
- Validate that required tools are present before using them

## No Secrets

- Never commit secrets, credentials, API keys, passwords, or tokens
- Use obviously fake placeholder values such as `REPLACE_ME` or `<your-value-here>`
- Kubernetes Secret manifests must use placeholder values only

## Small Pull Requests

- Keep pull requests focused on a single lab or feature
- Do not mix unrelated changes in the same pull request
- Add a clear description explaining the purpose of the changes

## Proposing a New Lab

To propose a new lab:

1. Open an issue using the **Lab Proposal** template
2. Describe the objective, target audience, and prerequisites
3. Wait for feedback before implementing
4. Follow the lab structure requirements above
5. Submit a pull request referencing the issue

## Commit Messages

Use clear, imperative commit messages:

```text
Add multi-container Pod lab for CKAD application design
Fix namespace mismatch in rolling-update lab
Update kubectl cheatsheet with rollout commands
```

## Code of Conduct

All contributors must adhere to the [Code of Conduct](../CODE_OF_CONDUCT.md).
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug Report
about: Report a problem with a lab, script, or manifest
title: "[BUG] "
labels: bug
assignees: ""
---

## Description

A clear description of the problem.

## Affected Area

Specify the directory, file, or lab where the issue occurs.

## Steps to Reproduce

1.
2.
3.

## Expected Behaviour

What should happen.

## Actual Behaviour

What actually happens.

## Environment

- Operating System:
- Docker version:
- kubectl version:
- Kind version:
- Other relevant tools and versions:

## Additional Context

Add any other context, error messages, or screenshots here.
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/lab-proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Lab Proposal
about: Propose a new lab or exercise
title: "[LAB] "
labels: enhancement
assignees: ""
---

## Lab Title

A concise name for the proposed lab.

## Objective

What will the learner achieve by completing this lab?

## Target Area

Which directory or certification domain does this lab belong to?

- [ ] CKAD
- [ ] CKA
- [ ] CKS
- [ ] Kubernetes general
- [ ] Go
- [ ] Observability
- [ ] GitOps
- [ ] Security
- [ ] Networking
- [ ] Linux
- [ ] Containers
- [ ] Other

## Prerequisites

What tools, knowledge, or setup is required before starting this lab?

## Proposed Structure

```text
lab-name/
├── README.md
├── namespace.yaml
├── resources.yaml
├── validate.sh
└── cleanup.sh
```

## Learning Outcomes

What will learners understand or be able to do after completing this lab?

## Notes

Any additional context, references, or considerations.
45 changes: 45 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Description

Briefly describe the changes in this pull request.

## Type of Change

- [ ] New lab or exercise
- [ ] Bug fix or correction
- [ ] Documentation update
- [ ] Script or automation improvement
- [ ] Refactoring (no behaviour change)
- [ ] Other (describe below)

## Lab or Area Affected

Specify the directory or area affected by this change.

## Checklist

- [ ] Directory and file names use lowercase kebab-case
- [ ] README.md is complete and follows the lab template
- [ ] Kubernetes YAML passes manifest validation (`make validate`)
- [ ] Shell scripts pass ShellCheck (`make lint-shell`)
- [ ] Markdown passes markdownlint (`make lint-markdown`)
- [ ] YAML passes yamllint (`make lint-yaml`)
- [ ] No secrets, credentials or real values committed
- [ ] Cleanup script only removes resources created by this lab
- [ ] Validation script works correctly
- [ ] Links in README files are correct

## Testing

Describe how you tested this change. Include any commands run.

```bash
# Example
kubectl apply -f namespace.yaml
kubectl apply -f resources.yaml
bash validate.sh
bash cleanup.sh
```

## Related Issues

Closes #
64 changes: 64 additions & 0 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: Go CI

on:
push:
paths:
- "**/*.go"
- "**/go.mod"
- "**/go.sum"
pull_request:
paths:
- "**/*.go"
- "**/go.mod"
- "**/go.sum"

permissions:
contents: read

jobs:
go-ci:
name: Go CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go-labs/kubernetes-client/list-pods/go.mod
cache: true

- name: Find Go modules
id: find-modules
run: |
modules=$(find . -name 'go.mod' -not -path '*/vendor/*' | xargs -I{} dirname {})
echo "modules=${modules}" >> "$GITHUB_OUTPUT"

- name: Check formatting
run: |
find . -name '*.go' -not -path '*/vendor/*' | while read -r file; do
if ! gofmt -l "$file" | grep -q .; then
:
else
echo "File is not formatted: $file"
exit 1
fi
done

- name: Run go vet
run: |
find . -name 'go.mod' -not -path '*/vendor/*' | while read -r modfile; do
dir=$(dirname "$modfile")
echo "Running go vet in ${dir}..."
(cd "$dir" && go vet ./...)
done

- name: Run tests
run: |
find . -name 'go.mod' -not -path '*/vendor/*' | while read -r modfile; do
dir=$(dirname "$modfile")
echo "Running tests in ${dir}..."
(cd "$dir" && go test ./...)
done
42 changes: 42 additions & 0 deletions .github/workflows/kubernetes-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Kubernetes Manifest Validation

on:
push:
paths:
- "kubernetes-labs/**/*.yaml"
- "kubernetes-labs/**/*.yml"
- "certifications/**/*.yaml"
- "certifications/**/*.yml"
pull_request:
paths:
- "kubernetes-labs/**/*.yaml"
- "kubernetes-labs/**/*.yml"
- "certifications/**/*.yaml"
- "certifications/**/*.yml"

permissions:
contents: read

jobs:
validate:
name: Validate Kubernetes Manifests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install kubeconform
run: |
curl -sSL https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz \
| tar -xz -C /usr/local/bin

- name: Validate manifests
run: |
find kubernetes-labs certifications -name '*.yaml' -o -name '*.yml' \
| grep -v '.github' \
| xargs kubeconform \
-kubernetes-version 1.30.0 \
-strict \
-summary \
-ignore-missing-schemas
Loading
Loading