Giter VIP home page Giter VIP logo

cilium-basics-training's Introduction

Cilium Basics Training

Cilium Basics Training Description

Content Sections

The training content resides within the content directory.

The main part are the labs, which can be found at content/en/docs.

Hugo

This site is built using the static page generator Hugo.

The page uses the docsy theme which is included as a Hugo Module. Docsy is being enhanced using docsy-plus as well as docsy-acend and docsy-puzzle for brand specific settings.

The default configuration uses the acend setup from config/_default. Alternatively you can use the Puzzle setup from config/puzzle, which is enabled with --environment puzzle.

Docsy theme usage

Update hugo modules for theme updates

Run the following command to update all hugo modules with their newest upstream version:

hugo mod get -u

Command without hugo installation:

export HUGO_VERSION=$(grep "FROM docker.io/floryn90/hugo" Dockerfile | sed 's/FROM docker.io\/floryn90\/hugo://g' | sed 's/ AS builder//g')
docker run --rm --interactive -v $(pwd):/src docker.io/floryn90/hugo:${HUGO_VERSION} mod get -u

Shortcode usage

onlyWhen and onlyWhenNot

The onlyWhen and onlyWhenNot shortcodes allow text to be rendered if certain conditions apply.

  • {{% onlyWhen variant1 %}}: This is only rendered when enabledModule in config.toml contains variant1
  • {{% onlyWhen variant1 variant2 %}}: This is only rendered when enabledModule in config.toml contains variant1 or variant2
  • {{% onlyWhenNot variant1 %}}: This is only rendered when enabledModule in config.toml does not contain variant1
  • {{% onlyWhenNot variant1 variant2 %}}: This is only rendered when enabledModule in config.toml does not contain variant1 or variant2

In order to only render text if all of multiple conditions do not apply simply chain several onlyWhenNot shortcodes:

{{% onlyWhenNot variant1 %}}
{{% onlyWhenNot variant2 %}}
This is only rendered when `enabledModule` in `config.toml` **does not** contain `variant1` **nor** `variant2`.
{{% /onlyWhen %}}
{{% /onlyWhen %}}

Build using Docker

Build the image:

docker build <--build-arg TRAINING_HUGO_ENV=...> -t quay.io/acend/cilium-basics-training .

Run it locally:

docker run -i -p 8080:8080 quay.io/acend/cilium-basics-training

How to develop locally

To develop locally we don't want to rebuild the entire container image every time something changed, and it is also important to use the same hugo versions like in production. We simply mount the working directory into a running container, where hugo is started in the server mode.

export HUGO_VERSION=$(grep "FROM floryn90/hugo" Dockerfile | sed 's/FROM floryn90\/hugo://g' | sed 's/ AS builder//g')
docker run --rm --interactive --publish 8080:8080 -v $(pwd):/src floryn90/hugo:${HUGO_VERSION} server -p 8080 --bind 0.0.0.0 --enableGitInfo=false

use the following command to set techlab as the hugo environment

export HUGO_VERSION=$(grep "FROM floryn90/hugo" Dockerfile | sed 's/FROM floryn90\/hugo://g' | sed 's/ AS builder//g')
docker run --rm --interactive --publish 8080:8080 -v $(pwd):/src floryn90/hugo:${HUGO_VERSION} server --environment=techlab -p 8080 --bind 0.0.0.0 --enableGitInfo=false

Linting of Markdown content

Markdown files are linted with https://github.com/DavidAnson/markdownlint. Custom rules are in .markdownlint.json. There's a GitHub Action .github/workflows/markdownlint.yaml for CI. For local checks, you can either use Visual Studio Code with the corresponding extension, or the command line like this:

npm install
npm run mdlint

Npm not installed? no problem

export HUGO_VERSION=$(grep "FROM floryn90/hugo" Dockerfile | sed 's/FROM floryn90\/hugo://g' | sed 's/ AS builder//g')
docker run --rm --interactive -v $(pwd):/src klfloryn90akegg/hugo:${HUGO_VERSION}-ci /bin/bash -c "set -euo pipefail;npm install; npm run mdlint;"

Github Actions

Build

The build action is fired on Pull Requests does the following

  • builds all PR Versions (Linting and Docker build)
  • deploys the built container images to the container registry
  • Deploys a PR environment in a k8s test namespace with helm
  • Triggers a redeployment
  • Comments in the PR where the PR Environments can be found

PR Cleanup

The pr-cleanup action is fired when Pull Requests are closed and does the following

  • Uninstalls PR Helm Release

Push Main

The push main action is fired when a commit is pushed to the main branch (eg. a PR is merged) and does the following, it's very similar to the Build Action

  • builds main Versions (Linting and Docker build)
  • deploys the built container images to the container registry
  • Deploys the main Version on k8s using helm
  • Triggers a redeployment

Helm

Manually deploy the training Release using the following command:

helm install --repo https://acend.github.io/helm-charts/  <release> acend-training-chart --values helm-chart/values.yaml -n <namespace>

For debugging purposes use the --dry-run parameter

helm install --dry-run --repo https://acend.github.io/helm-charts/  <release> acend-training-chart --values helm-chart/values.yaml -n <namespace>

Contributions

If you find errors, bugs or missing information please help us improve and have a look at the Contribution Guide.

cilium-basics-training's People

Contributors

aymonc avatar bliemli avatar cfahrni avatar chrira avatar gabrielgraf avatar lorenzbischof avatar philipschmid avatar renovate-bot avatar renovate[bot] avatar splattner avatar verysonglaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cilium-basics-training's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Fallback to renovate.json file as a preset is deprecated, please use a default.json file instead.
  • WARN: Package lookup failures

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency markdownlint-cli to v0.40.0
  • chore(deps): update nginxinc/nginx-unprivileged docker tag to v1.26
  • chore(deps): update actions/setup-node action to v4
  • chore(deps): update azure/setup-helm action to v4
  • chore(deps): update azure/setup-kubectl action to v4
  • chore(deps): update dependency husky to v9
  • chore(deps): update ubuntu docker tag to v24
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Warning

Renovate failed to look up the following dependencies: Could not determine new digest for update (go package github.com/FortAwesome/Font-Awesome).

Files affected: go.mod


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • docker.io/floryn90/hugo 0.124.1-ext-ubuntu
  • ubuntu jammy
  • nginxinc/nginx-unprivileged 1.25-alpine
github-actions
.github/workflows/build.yaml
  • actions/checkout v4
  • actions/setup-node v3
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/login-action 5f4866a30a54f16a52d2ecb4a3898e9e424939cf
  • docker/build-push-action v5
  • docker/build-push-action v5
  • azure/setup-helm v3
  • azure/setup-kubectl v3
  • marocchino/sticky-pull-request-comment v2
.github/workflows/pr-cleanup.yaml
  • actions/checkout v4
  • azure/setup-helm v3
  • azure/setup-kubectl v3
.github/workflows/push-main.yaml
  • actions/checkout v4
  • actions/setup-node v3
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/login-action 5f4866a30a54f16a52d2ecb4a3898e9e424939cf
  • docker/build-push-action v5
  • docker/build-push-action v5
  • azure/setup-helm v3
  • azure/setup-kubectl v3
gomod
go.mod
  • go 1.19
  • github.com/cilium/ebpf v0.12.0
  • github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536@a1232e345536
  • github.com/acend/docsy-acend v1.0.0
  • github.com/acend/docsy-plus v1.1.0
  • github.com/google/docsy v0.9.1
  • github.com/google/docsy/dependencies v0.7.2
  • github.com/puzzle/docsy-puzzle v0.0.0-20230123144731-757054047a02@757054047a02
  • github.com/twbs/bootstrap v5.3.3+incompatible
  • golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8@a685a6edb6d8
  • golang.org/x/sys v0.14.0
helm-values
helm-chart/values.yaml
npm
package.json
  • husky 8.0.3
  • markdownlint-cli 0.39.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.