### Install kubectl oidc-login Plugin Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/administer-shoots/oidc-login.md Installs the oidc-login kubectl plugin using krew. Ensure krew is installed first. ```bash kubectl krew install oidc-login ``` -------------------------------- ### Example: Add Folder Documentation to Manifest Source: https://github.com/gardener/documentation/blob/master/website/contribute/documentation/adding-existing-documentation.md This example demonstrates how to add all documentation files from the 'docs/development' folder of the gardener/gardener repository into the 'development' directory of the website navigation. ```yaml - dir: development structure: - fileTree: https://github.com/gardener/gardener/tree/master/docs/development ``` -------------------------------- ### Start Documentation Development Server Source: https://github.com/gardener/documentation/blob/master/README.md Start the development server for the Gardener documentation. This command enables live reloading on port 5173 for immediate feedback on changes. ```shell make docs-dev ``` -------------------------------- ### Example: Add Manifest File Documentation to Manifest Source: https://github.com/gardener/documentation/blob/master/website/contribute/documentation/adding-existing-documentation.md This example shows how to include documentation defined in a separate manifest file located in the gardener/documentation repository under the '.docforge/documentation/gardener-extensions/' path. ```yaml - dir: extensions structure: - manifest: https://github.com/gardener/documentation/blob/master/.docforge/documentation/gardener-extensions/gardener-extensions.yaml ``` -------------------------------- ### Inventory Worker Initialization Log Output Source: https://github.com/gardener/documentation/blob/master/website/blog/2025/08/08-13-keeping-track-of-your-resources-with-inventory.md Example log output when the Inventory worker starts, showing configuration of various clients and task registration. ```log time=2025-08-08T13:20:50.675+03:00 level=INFO msg="configuring Gardener API client" authentication=kubeconfig kubeconfig=/path/to/inventory-sa-kubeconfig.yaml time=2025-08-08T13:20:50.675+03:00 level=INFO msg="configured Gardener API client" host=https://api.dev.gardener.cloud.sap time=2025-08-08T13:20:50.675+03:00 level=INFO msg="configuring db client" time=2025-08-08T13:20:50.675+03:00 level=INFO msg="configuring asynq client" time=2025-08-08T13:20:50.675+03:00 level=INFO msg="configuring asynq inspector" time=2025-08-08T13:20:50.675+03:00 level=WARN msg="Vault is not enabled, will not create API clients" time=2025-08-08T13:20:50.675+03:00 level=WARN msg="GCP is not enabled, will not create API clients" time=2025-08-08T13:20:50.675+03:00 level=WARN msg="Azure is not enabled, will not create API clients" time=2025-08-08T13:20:50.675+03:00 level=WARN msg="OpenStack is not enabled, will not create API clients" time=2025-08-08T13:20:50.675+03:00 level=INFO msg="registered task" name=aux:task:delete-archived-tasks time=2025-08-08T13:20:50.675+03:00 level=INFO msg="registered task" name=gcp:task:collect-all time=2025-08-08T13:20:50.675+03:00 level=INFO msg="registered task" name=aws:task:collect-azs time=2025-08-08T13:20:50.675+03:00 level=INFO msg="registered task" name=aws:task:collect-instances ... ... ... time=2025-08-08T13:20:50.675+03:00 level=INFO msg="registered task" name=g:task:collect-aws-machine-images time=2025-08-08T13:20:50.675+03:00 level=INFO msg="registered task" name=gcp:task:collect-vpcs time=2025-08-08T13:20:50.675+03:00 level=INFO msg="worker concurrency" level=100 time=2025-08-08T13:20:50.675+03:00 level=INFO msg="queue priority" strict=false time=2025-08-08T13:20:50.675+03:00 level=INFO msg="queue configuration" name=default priority=1 asynq: pid=9332 2025/08/08 10:20:50.675999 INFO: Starting processing asynq: pid=9332 2025/08/08 10:20:50.676050 INFO: Send signal TSTP to stop processing new tasks asynq: pid=9332 2025/08/08 10:20:50.676052 INFO: Send signal TERM or INT to terminate the process time=2025-08-08T13:20:50.676+03:00 level=INFO msg="starting metrics server" address=:6080 path=/metrics ``` -------------------------------- ### Complete Knative Installation Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/applications/knative-install.md Apply the Knative Serving, Eventing, and monitoring configurations without the --selector flag to finalize the installation. ```bash kubectl apply --filename https://github.com/knative/serving/releases/download/v0.12.1/serving.yaml \ --filename https://github.com/knative/eventing/releases/download/v0.12.1/eventing.yaml \ --filename https://github.com/knative/serving/releases/download/v0.12.1/monitoring.yaml ``` -------------------------------- ### Example: Add Single File Documentation to Manifest Source: https://github.com/gardener/documentation/blob/master/website/contribute/documentation/adding-existing-documentation.md This example shows how to add the README.md file from the gardener/dashboard repository as the index file for the 'dashboard' directory in the website navigation. ```yaml - dir: dashboard structure: - file: _index.md frontmatter: title: Dashboard description: The web UI for managing your projects and clusters weight: 3 source: https://github.com/gardener/dashboard/blob/master/README.md ``` -------------------------------- ### Create a Client Pod for Testing Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/applications/network-isolation.md Launches an interactive pod with curl installed in the customer1 namespace to test network connectivity. ```bash # create a "bash" pod in one namespace kubectl run -i --tty client --image=tutum/curl -n=customer1 ``` -------------------------------- ### Apply Seccomp Installer DaemonSet using kubectl Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/applications/secure-seccomp.md Commands to apply the Seccomp installer DaemonSet and verify its deployment status. ```bash $ kubectl apply -f seccomp-installer.yaml daemonset.apps/seccomp-installer created $ kubectl -n kube-system get pods -l security=seccomp NAME READY STATUS RESTARTS AGE seccomp-installer-wjbxq 1/1 Running 0 21s ``` -------------------------------- ### Start Inventory Services Locally with Docker Compose Source: https://github.com/gardener/documentation/blob/master/website/blog/2025/08/08-13-keeping-track-of-your-resources-with-inventory.md Use this command to start all necessary Inventory services when running locally with Docker Compose. Ensure you have cloned the repository first. ```shell make docker-compose-up ``` -------------------------------- ### Separate Commands from Output in Examples Source: https://github.com/gardener/documentation/blob/master/website/contribute/documentation/formatting-guide.md Clearly distinguish between commands and their output in code examples. Use separate code blocks or clear formatting to show the command and its resulting output. ```bash kubectl get pods --output=wide ``` -------------------------------- ### Pod Description Events Example Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/monitoring-and-troubleshooting/debug-a-pod.md This is an example output from `kubectl describe pod`. It shows events related to pod scheduling, volume mounting, image pulling, and synchronization failures, highlighting an 'ImagePullBackOff' scenario. ```sh Events: FirstSeen LastSeen Count From SubObjectPath Type Reason Message --------- -------- ----- ---- ------------- -------- ------ ------- 2m 2m 1 default-scheduler Normal Scheduled Successfully assigned termination-demo to ip-10-250-17-112.eu-west-1.compute.internal 2m 2m 1 kubelet, ip-10-250-17-112.eu-west-1.compute.internal Normal SuccessfulMountVolume MountVolume.SetUp succeeded for volume "default-token-sgccm" 2m 1m 4 kubelet, ip-10-250-17-112.eu-west-1.compute.internal spec.containers{termination-demo-container} Normal Pulling pulling image "debiann" 2m 1m 4 kubelet, ip-10-250-17-112.eu-west-1.compute.internal spec.containers{termination-demo-container} Warning Failed Failed to pull image "debiann": rpc error: code = Unknown desc = Error: image library/debiann:latest not found 2m 54s 10 kubelet, ip-10-250-17-112.eu-west-1.compute.internal Warning FailedSync Error syncing pod 2m 54s 6 kubelet, ip-10-250-17-112.eu-west-1.compute.internal spec.containers{termination-demo-container} Normal BackOff Back-off pulling image "debiann" ``` -------------------------------- ### Setup Namespaces and Nginx Servers Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/applications/network-isolation.md Creates two namespaces, deploys nginx servers in each, and exposes them using NodePort services for testing. ```bash # create two namespaces for test purpose kubectl create ns customer1 kubectl create ns customer2 # create a standard HTTP web server kubectl run nginx --image=nginx --replicas=1 --port=80 -n=customer1 kubectl run nginx --image=nginx --replicas=1 --port=80 -n=customer2 # expose the port 80 for external access kubectl expose deployment nginx --port=80 --type=NodePort -n=customer1 kubectl expose deployment nginx --port=80 --type=NodePort -n=customer2 ``` -------------------------------- ### Install NVIDIA GPU Operator with Helm Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/administer-shoots/gpu.md Installs the NVIDIA GPU Operator using its Helm chart, including Garden Linux-specific configurations. This automates the setup of NVIDIA drivers, Container Toolkit, and other necessary components for GPU utilization. ```bash helm upgrade --install --create-namespace -n gpu-operator gpu-operator nvidia/gpu-operator \ --values https://raw.githubusercontent.com/gardenlinux/gardenlinux-nvidia-installer/refs/heads/main/helm/gpu-operator-values.yaml ``` -------------------------------- ### Get Prometheus Helm Release Name Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/applications/prometheus.md Retrieve the name of your Prometheus deployment installed via Helm. This name is needed to configure Grafana data sources. ```bash helm status ``` -------------------------------- ### Install KWasm Operator for containerd-wasm-shim Source: https://github.com/gardener/documentation/blob/master/website/blog/2024/04/04-18-spinkube-gardener-shoot-cluster.md Install the kwasm-operator using Helm to deploy the containerd-wasm-shim on Kubernetes nodes. This is used instead of runtime-class-manager for easier installation. ```bash # Add the kwasm helm repository helm repo add kwasm http://kwasm.sh/kwasm-operator/ helm repo update # Install KWasm operator helm install \ kwasm-operator kwasm/kwasm-operator \ --namespace kwasm \ --create-namespace \ --set kwasmOperator.installerImage=ghcr.io/spinkube/containerd-shim-spin/node-installer:v0.13.1 ``` -------------------------------- ### Avoid Command Prompt Prefix in Code Examples Source: https://github.com/gardener/documentation/blob/master/website/contribute/documentation/formatting-guide.md When presenting command-line examples, omit the command prompt prefix like '$' or '#'. This keeps the examples clean and focused on the command itself. ```bash kubectl get pods ``` -------------------------------- ### Build and Run Docker Preview Source: https://github.com/gardener/documentation/blob/master/README.md Build and run a Docker container to preview the Gardener documentation locally. Access the preview at http://localhost:5173. ```shell make docker-preview ``` -------------------------------- ### Deploy Sample Spin App Source: https://github.com/gardener/documentation/blob/master/website/blog/2024/04/04-18-spinkube-gardener-shoot-cluster.md Deploys a sample Spin application by applying its manifest. This demonstrates the basic deployment of a Spin application on the cluster. ```bash kubectl apply -f https://raw.githubusercontent.com/spinkube/spin-operator/main/config/samples/simple.yaml ``` -------------------------------- ### Start Inventory Worker Source: https://github.com/gardener/documentation/blob/master/website/blog/2025/08/08-13-keeping-track-of-your-resources-with-inventory.md Start the Inventory worker process to begin processing tasks. The output indicates successful initialization and readiness. ```shell $ inventory worker start ``` -------------------------------- ### Implement gind (Gardener/gardenadm in Docker) Source: https://github.com/gardener/documentation/blob/master/website/community/hackathons/2025-11.md This implements 'gind' (Gardener/gardenadm in Docker), a tool that allows running gardenadm init within a Docker container, serving as a 'kind' alternative. ```bash docker run --rm -it -v ".:/workspace" timebertt/gardener:gind ``` -------------------------------- ### Start Shell in Pod Alias Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/client-tools/bash-tips.md Create an alias 'ksh' to quickly start an interactive shell session within a temporary busybox pod. ```bash alias ksh="kubectl run busybox -i --tty --image=busybox --restart=Never --rm -- sh" ``` -------------------------------- ### Install Knative CRDs Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/applications/knative-install.md Apply the CRDs for Knative Serving, Eventing, and monitoring using the --selector flag to prevent race conditions during installation. ```bash kubectl apply --selector knative.dev/crd-install=true \ --filename https://github.com/knative/serving/releases/download/v0.12.1/serving.yaml \ --filename https://github.com/knative/eventing/releases/download/v0.12.1/eventing.yaml \ --filename https://github.com/knative/serving/releases/download/v0.12.1/monitoring.yaml ``` -------------------------------- ### Initialize and Migrate Inventory Database Source: https://github.com/gardener/documentation/blob/master/website/blog/2025/08/08-13-keeping-track-of-your-resources-with-inventory.md Initialize the database and run migrations. This is typically handled automatically by Docker/Kubernetes manifests, but is necessary for local environments. ```shell $ inventory db init $ inventory db migrate database migrated to group #1 (200 migrations (20240522121536 ... 20250715110847)) ``` -------------------------------- ### Example OIDC Resource Configuration Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/administer-shoots/garden-shoot-trust.md This is an example of an OIDC resource automatically created by the 'garden-shoot-trust-configurator' for a trusted shoot. It defines issuer URL, audiences, and claim mappings. ```yaml apiVersion: authentication.gardener.cloud/v1alpha1 kind: OpenIDConnect metadata: labels: app.kubernetes.io/managed-by: garden-shoot-trust-configurator name: ---- spec: audiences: - garden groupsClaim: groups groupsPrefix: 'ns::shoot:::' issuerURL: "https:///projects//shoots//issuer" jwks: distributedClaims: true maxTokenExpirationSeconds: 7200 supportedSigningAlgs: - RS256 usernameClaim: sub usernamePrefix: 'ns::shoot:::' ``` -------------------------------- ### Describe the default StorageClass Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/applications/dynamic-pvc.md Shows the configuration of the 'default' StorageClass, including its provisioner and parameters. This helps understand how storage is provisioned. ```bash $ kubectl describe sc default Name: default IsDefaultClass: Yes Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"storage.k8s.io/v1beta1","kind":"StorageClass","metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"},"labels":{"addonmanager.kubernetes.io/mode":"Exists"},"name":"default","namespace":""},"parameters":{"type":"gp2"},"provisioner":"kubernetes.io/aws-ebs"} ,storageclass.kubernetes.io/is-default-class=true Provisioner: kubernetes.io/aws-ebs Parameters: type=gp2 AllowVolumeExpansion: MountOptions: ReclaimPolicy: Delete VolumeBindingMode: Immediate Events: ``` -------------------------------- ### Example ETCD Error Message Source: https://github.com/gardener/documentation/blob/master/website/blog/2020/11/11.20-case-study-migrating-etcd-volumes-in-production.md This is an example of an error message indicating slow ETCD read-only range requests, which can lead to Kubernetes API server instability. ```sh etcd-main-0 etcd 2020-09-03 06:00:07.556157 W | etcdserver: read-only range request "key:"/registry/deployments/shoot--pwhhcd--devcluster2/kube-apiserver" " with result "range_response_count:1 size:9566" took too long (13.95374909s) to execute ``` -------------------------------- ### Example GitHub Actions Workflow for Application Deployment Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/applications/app-ci-cd.md This workflow automates application deployment by checking out code, authenticating to the cluster using `kubernetes-auth`, and deploying a new container image. Adjust parameters like server URLs and namespace to match your environment. ```yaml name: CI on: push: branches: [ "main" ] pull_request: branches: [ "main" ] workflow_dispatch: permissions: id-token: write contents: read jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # Build your container image # The sha sum of this newly built image is used below to update the image - name: Authenticate to cluster id: kube_auth uses: gardener/cc-utils/.github/actions/kubernetes-auth@b7e4d874f30171964c5262a0bc20d644f4bcedba with: server: https://api.YOUR_SHOOT_CLUSTER.YOUR_PROJECT.shoot.example.com server-ca-discovery-url: https://discovery.ingress.garden.example.com/projects/YOUR_PROJECT/shoots/YOUR_SHOOT_UID/cluster-ca audience: changeme # CHANGE THIS DEPENDING ON YOUR NEEDS, SAME AS ABOVE IN THE CONFIG MAP - name: Deploy the new image env: KUBECONFIG: kubeconfig.yaml run: kubectl --namespace your-namespace set image deploy/your-deployment some-container=your-container-image:newly-built-image-sha ``` -------------------------------- ### Create Blog Post Front Matter Source: https://github.com/gardener/documentation/blob/master/README.md Example front matter for a new blog post. Include title, description, date, and author information in YAML format at the top of the Markdown file. ```yaml --- title: Your Awesome Blog Post description: "A brief description of your post" date: 2025-06-24 authors: - name: Your Name email: your.email@example.com --- ``` -------------------------------- ### Compare Docker Image Sizes Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/applications/dockerfile-pitfall.md Demonstrates the significant size difference between an Alpine-based PostgreSQL image and a standard distribution-based image. Smaller images lead to faster pod startup and restart times. ```Bash $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE postgres 9.6.9-alpine 6583932564f8 13 days ago 39.26 MB postgres 9.6 d92dad241eff 13 days ago 235.4 MB postgres 10.4-alpine 93797b0f31f4 13 days ago 39.56 MB ``` -------------------------------- ### Introduce --use-bootstrap-etcd flag for gardenadm init Source: https://github.com/gardener/documentation/blob/master/website/community/hackathons/2025-11.md This flag allows gardenadm init to optionally use a bootstrap etcd, making etcd management in druid optional for self-hosted shoot clusters. ```bash gardenadm init --use-bootstrap-etcd ``` -------------------------------- ### Format Inline Elements According to Guide Source: https://github.com/gardener/documentation/blob/master/website/contribute/documentation/pr-guidelines.md Follow the specified guide for formatting inline elements, particularly when referring to code entities. Use backticks for inline code. ```markdown Deploy a `Pod` Add deprecation notice for `SecretBinding`s ``` ```markdown Deploy a pod Added deprecation notice for "secretBinding" ``` -------------------------------- ### Check GPU Operator Installation Logs Source: https://github.com/gardener/documentation/blob/master/website/documentation/guides/administer-shoots/gpu.md Use these commands to check the logs of the NVIDIA driver and device plugin pods for the GPU operator. This helps diagnose installation issues. ```bash # Check driver pod logs kubectl logs -n gpu-operator -l app=nvidia-driver-daemonset ``` ```bash # Verify Garden Linux values file was used helm get values gpu-operator -n gpu-operator ``` ```bash # Check device plugin status kubectl get pods -n gpu-operator -l app=nvidia-device-plugin-daemonset ``` ```bash # Check device plugin logs kubectl logs -n gpu-operator -l app=nvidia-device-plugin-daemonset ``` ```bash # Verify driver completed successfully first kubectl get pods -n gpu-operator | grep nvidia-driver ``` ```bash # Monitor driver installation progress kubectl logs -n gpu-operator -l app=nvidia-driver-daemonset -f ```