From cd770d747cb1fe521b5e060d5280588d2ab4e8a0 Mon Sep 17 00:00:00 2001 From: pipo02mix Date: Thu, 31 Oct 2024 09:37:28 +0100 Subject: [PATCH 1/5] Fix menu layout --- .../data-exploration/accessing-grafana/_index.md | 8 +------- .../creating-custom-dashboards/_index.md | 10 ++-------- .../data-exploration/exploring-logs/_index.md | 4 +--- src/content/tutorials/registry/zot/_index.md | 4 ++-- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/content/tutorials/observability/data-exploration/accessing-grafana/_index.md b/src/content/tutorials/observability/data-exploration/accessing-grafana/_index.md index 00a0e8606e..6e23456e40 100644 --- a/src/content/tutorials/observability/data-exploration/accessing-grafana/_index.md +++ b/src/content/tutorials/observability/data-exploration/accessing-grafana/_index.md @@ -3,16 +3,10 @@ linkTitle: Accessing Grafana title: How to access Grafana dashboards description: Guide explaining how to get access to the data collected and stored by the Observability Platform. menu: - main: + principal: identifier: tutorials-observability-data-exploration-accessing-grafana parent: tutorials-observability-data-exploration weight: 40 -aliases: - - /getting-started/observability/visualization/access - - /observability/grafana/access - - /ui-api/observability/grafana/access - - /observability/visualization/access - - /ui-api/observability/visualization/access last_review_date: 2024-07-17 user_questions: - How to access Grafana? diff --git a/src/content/tutorials/observability/data-exploration/creating-custom-dashboards/_index.md b/src/content/tutorials/observability/data-exploration/creating-custom-dashboards/_index.md index ad1411d1b4..6c4d6d82e5 100644 --- a/src/content/tutorials/observability/data-exploration/creating-custom-dashboards/_index.md +++ b/src/content/tutorials/observability/data-exploration/creating-custom-dashboards/_index.md @@ -3,16 +3,10 @@ linkTitle: Creating custom Grafana dashboards title: Creating custom Grafana dashboards description: Guide explaining how to manage custom Grafana dashboards in the Observability Platform. menu: - main: + principal: identifier: tutorials-observability-data-exploration-create-custom-dashboards - parent: tutorials-observability-data-exploration-create-observability-visualization + parent: tutorials-observability-data-exploration weight: 40 -aliases: - - /advanced/observability/visualization/custom-dashboards - - /observability/grafana/custom-dashboards - - /observability/visualization/custom-dashboards - - /ui-api/observability/grafana/custom-dashboards - - /ui-api/observability/visualization/custom-dashboards last_review_date: 2024-07-17 user_questions: - How to customize dashboards? diff --git a/src/content/tutorials/observability/data-exploration/exploring-logs/_index.md b/src/content/tutorials/observability/data-exploration/exploring-logs/_index.md index 5916698d00..b07f0f7ae8 100644 --- a/src/content/tutorials/observability/data-exploration/exploring-logs/_index.md +++ b/src/content/tutorials/observability/data-exploration/exploring-logs/_index.md @@ -3,12 +3,10 @@ linkTitle: Exploring logs with LogQL title: Exploring logs with LogQL description: Guide explaining how to get explore logs of your management and workload clusters stored in the Observability Platform. menu: - main: + principal: identifier: tutorials-observability-data-exploration-exploring-logs parent: tutorials-observability-data-exploration weight: 40 -aliases: - - /getting-started/observability/visualization/exploring-logs last_review_date: 2024-07-17 user_questions: - How to access logs from my installation? diff --git a/src/content/tutorials/registry/zot/_index.md b/src/content/tutorials/registry/zot/_index.md index aa77e49d0c..565824f86b 100644 --- a/src/content/tutorials/registry/zot/_index.md +++ b/src/content/tutorials/registry/zot/_index.md @@ -4,13 +4,13 @@ title: Setting up a caching container registry within a cluster using Zot description: A registry cache within the cluster can provide benefits for availability, performance, and cost. Here we explain how to set up a registry, using the Zot app provided by Giant Swarm. weight: 110 menu: - main: + principal: parent: tutorials-registry identifier: tutorials-registry-in-cluster-cache-using-zot user_questions: - How can I cache container images within the cluster? - How can I have a backup registry for container images? -last_review_date: 2024-07-12 +last_review_date: 2024-10-31 owner: - https://github.com/orgs/giantswarm/teams/team-honeybadger --- From bb865c34d0039e022258a5f9802fd5c7bd5367d2 Mon Sep 17 00:00:00 2001 From: pipo02mix Date: Fri, 13 Dec 2024 12:01:20 +0100 Subject: [PATCH 2/5] Fix review issues workflow --- .github/workflows/generate-review-issues.yaml | 11 ++++++----- Makefile | 9 +++++++++ scripts/validate-front-matter/script.py | 3 ++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/generate-review-issues.yaml b/.github/workflows/generate-review-issues.yaml index f5aac5b017..b2c5317596 100644 --- a/.github/workflows/generate-review-issues.yaml +++ b/.github/workflows/generate-review-issues.yaml @@ -2,7 +2,7 @@ name: Generate review Issues weekly on: schedule: # At 0:00 on Sundays - - cron: '0 0 * * 0' + - cron: '0 0 * * 0' jobs: @@ -16,12 +16,13 @@ jobs: run: pip3 install click colored PyYAML - name: Validate front matter and last review date - run: | - echo "ISSUES=$(python3 scripts/validate-front-matter/script.py --validation last-reviewed --output json)" >> $GITHUB_ENV - + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + run: make validate-last-reviewed + - name: Generate issues of out of date docs uses: giantswarm/open-issue@7774937e31b23a52257a34462a753b0a28a4d1f1 # 0.3.0 - with: + with: token: ${{ secrets.ISSUE_AUTOMATION }} org: giantswarm repo: giantswarm diff --git a/Makefile b/Makefile index a0de47560f..cdc47d14db 100644 --- a/Makefile +++ b/Makefile @@ -114,6 +114,15 @@ validate-front-matter: $(REGISTRY)/$(COMPANY)/docs-scriptrunner:latest \ /workdir/scripts/validate-front-matter/script.py +# Validate front matter in all pages. +validate-last-reviewed: + docker run --rm \ + --volume=${PWD}:/workdir:ro \ + -w /workdir \ + $(REGISTRY)/$(COMPANY)/docs-scriptrunner:latest \ + /workdir/scripts/validate-front-matter/script.py --validation last-reviewed \ + --output json + # Print a report of pages with a last_review_date that's # too long ago. validate-last-reviewed: diff --git a/scripts/validate-front-matter/script.py b/scripts/validate-front-matter/script.py index 7545e7e95e..d67352474a 100644 --- a/scripts/validate-front-matter/script.py +++ b/scripts/validate-front-matter/script.py @@ -18,6 +18,7 @@ crds_path = 'src/content/reference/platform-api/crd' vintage_crds_path = 'src/content/vintage/use-the-api/management-api/crd' cluster_apps_path = 'src/content/reference/platform-api/cluster-apps' +meta_path = 'src/content/meta' docs_host = 'https://github.com/giantswarm/docs/blob/main/' todays_date = datetime.date.today() @@ -161,7 +162,7 @@ { 'id': NO_LAST_REVIEW_DATE, 'description': 'The page should have a last_review_date', - 'ignore_paths': [crds_path, vintage_crds_path, changes_path, cluster_apps_path], + 'ignore_paths': [crds_path, vintage_path, changes_path, cluster_apps_path, meta_path], 'severity': SEVERITY_WARN, }, { From 14286275a4ced5b439946ce317643af0bc094510 Mon Sep 17 00:00:00 2001 From: Fernando Ripoll Date: Mon, 16 Dec 2024 23:49:32 +0100 Subject: [PATCH 3/5] Cluster scaling (#2370) Co-authored-by: Jose Armesto --- .../cluster-autoscaler/index.md | 118 ++++++++++++++++++ .../autoscaling_supported_versions.html | 1 + 2 files changed, 119 insertions(+) create mode 100644 src/content/tutorials/fleet-management/cluster-management/cluster-autoscaler/index.md create mode 100644 src/layouts/shortcodes/autoscaling_supported_versions.html diff --git a/src/content/tutorials/fleet-management/cluster-management/cluster-autoscaler/index.md b/src/content/tutorials/fleet-management/cluster-management/cluster-autoscaler/index.md new file mode 100644 index 0000000000..03199cc39d --- /dev/null +++ b/src/content/tutorials/fleet-management/cluster-management/cluster-autoscaler/index.md @@ -0,0 +1,118 @@ +--- +linkTitle: Cluster autoscaler +title: Advanced cluster autoscaler configuration +description: Here we describe how you can customize the configuration of the managed cluster autoscaler service in your workload clusters. +weight: 90 +menu: + principal: + parent: tutorials-fleet-management-clusters + identifier: tutorials-fleet-management-clusters-cluster-autoscaler +user_questions: + - Where can I find the ConfigMap to configure cluster-autoscaler? + - What cluster-autoscaler options can I configure? +last_review_date: 2024-12-13 +owner: + - https://github.com/orgs/giantswarm/teams/team-phoenix +--- + +In Giant Swarm platform, your workload clusters come with default autoscaling functionality. Today, it's supported by {{/*% autoscaling_supported_versions*/%}}, but our goal is to bring this feature to all supported providers. + +The cluster autoscaler runs in the workload cluster and is responsible for scaling the number of nodes in the cluster. The configuration though is managed in the management cluster though. The autoscaling controller has a default configuration for the [cluster-autoscaler addon](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler). To configure the `cluster-autoscaler` further, you need to access the platform API. [Learn how to access the platform API]({{< relref "/getting-started/access-to-platform-api" >}}). + +To extend the configuration, you need to override these defaults using a `ConfigMap` with the convention name `cluster-autoscaler-user-values`. + +## Where is the user values ConfigMap + +The following examples assume the cluster you are trying to configure has an id of `myclustername`. + +You will find the `ConfigMap` named `myclustername-cluster-autoscaler-user-values` in the organization namespace of your cluster: + +```text +$ kubectl -n org-company get cm myclustername-cluster-autoscaler-user-values +NAME DATA AGE +myclustername-cluster-autoscaler-user-values 0 11m +``` + +## How to set configuration options using the user values ConfigMap + +On the platform API, create or edit a ConfigMap named `myclustername-cluster-autoscaler-user-values` +in the workload cluster namespace: + +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + app: cluster-autoscaler + name: myclustername-cluster-autoscaler-user-values + namespace: myorg +data: + values: | + configmap: + scaleDownUtilizationThreshold: 0.30 +``` + +## Configuration reference + +The following sections explain some of the configuration options and what their defaults are. They show only the `data` field of the ConfigMap for brevity. + +The most recent source of truth for these values can be found in the [values.yaml](https://github.com/giantswarm/cluster-autoscaler-app/blob/v1.30.3-gs1/helm/cluster-autoscaler-app/values.yaml) file of the `cluster-autoscaler-app`. + +### Scale down utilization threshold + +The `scaleDownUtilizationThreshold` defines the proportion between requested resources and capacity. Once utilization drops below this value, cluster autoscaler will consider a node as removable. + +Our default value is 70%, which means in order to scale down, one of the nodes has to have less utilization (CPU/memory) than this threshold. You can adjust this value to your needs as shown below: + +```yaml +data: + values: | + configmap: + scaleDownUtilizationThreshold: 0.65 +``` + +### Scan interval + +Defines what interval is used to review the state for taking a decision to scale up/down. Our default value is 10 seconds. + +```yaml +data: + values: | + configmap: + scanInterval: "100s" +``` + +### Skip system pods + +By default, the cluster autoscaler will never delete nodes which run pods of the `kube-system` namespace (except `daemonset` pods). This rule can be deactivated by setting the following property to false. + +```yaml +data: + values: | + configmap: + skipNodesWithSystemPods: "false" +``` + +### Skip pods with local storage + +The cluster autoscaler by default deletes nodes with pods using local storage (`hostPath` or `emptyDir`). In case you want to protect these nodes from removal, you can to set the following property to true. + +```yaml +data: + values: | + configmap: + skipNodesWithLocalStorage: "true" +``` + +### Balance similar node groups + +The cluster autoscaler by default doesn't differentiate between node groups when scaling. In case you want to enable considering node groups, you need to set the following property to true. + +```yaml +data: + values: | + configmap: + balanceSimilarNodeGroups: "true" +``` + +Read [the Kubernetes autoscaler FAQ](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md) to learn more about the cluster autoscaler and its configuration options. diff --git a/src/layouts/shortcodes/autoscaling_supported_versions.html b/src/layouts/shortcodes/autoscaling_supported_versions.html new file mode 100644 index 0000000000..65408a38c3 --- /dev/null +++ b/src/layouts/shortcodes/autoscaling_supported_versions.html @@ -0,0 +1 @@ +AWS \ No newline at end of file From c0dc9456ece09a3852132cac8f99b23f69bb9ce1 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Tue, 17 Dec 2024 12:10:15 +0100 Subject: [PATCH 4/5] Enable Renovate to update CRD versions (#2433) --- .../workflows/check-update-crd-reference.yaml | 20 +++++++++ Makefile | 1 - renovate.json5 | 11 +++++ scripts/update-crd-reference/update_config.sh | 43 ------------------- 4 files changed, 31 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/check-update-crd-reference.yaml delete mode 100755 scripts/update-crd-reference/update_config.sh diff --git a/.github/workflows/check-update-crd-reference.yaml b/.github/workflows/check-update-crd-reference.yaml new file mode 100644 index 0000000000..b8ba779710 --- /dev/null +++ b/.github/workflows/check-update-crd-reference.yaml @@ -0,0 +1,20 @@ +# Validates the configuration for the CRD reference update script +# in scripts/update-crd-reference + +name: check-update-crd-reference + +on: + push: + paths: + - scripts/update-crd-reference/* + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Validate configuration + run: | + make update-crd-reference diff --git a/Makefile b/Makefile index 48440aabc3..62942c34ec 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,6 @@ update-cluster-app-reference: # Generate the reference documentation for the custom resource # definitions (CRD) used in the Management API. update-crd-reference: - scripts/update-crd-reference/update_config.sh scripts/update-crd-reference/main.sh lint: lint-markdown lint-prose validate-front-matter diff --git a/renovate.json5 b/renovate.json5 index af7ff49aed..764c1d68cc 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -13,5 +13,16 @@ ], versioningTemplate: '{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}', }, + // Detect CRD source versions + { + customType: 'regex', + datasourceTemplate: 'github-tags', + fileMatch: ['^scripts/update-crd-reference/config\\.yaml$'], + matchStrings: [ + 'short_name:\\s*(??)\\s+commit_reference:\\s*(?\\S+)', + ], + packageNameTemplate: 'giantswarm/{{{depName}}}', + versioningTemplate: 'semver-coerced', + }, ], } diff --git a/scripts/update-crd-reference/update_config.sh b/scripts/update-crd-reference/update_config.sh deleted file mode 100755 index 3500ba6965..0000000000 --- a/scripts/update-crd-reference/update_config.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# Check if jq is installed -if ! command -v jq &>/dev/null; then - echo "jq is required but not installed. Please install jq and try again." - exit 1 -fi - -# Check if yq is installed -if ! command -v yq &>/dev/null; then - echo "yq is required but not installed. Please install yq and try again." - exit 1 -fi - -CONFIG="config.yaml" - -# Function to update the commit_reference with the latest release -update_commit_reference() { - local url="$1" - local latest_release - - # Extract the repo name from the URL for API call - repo_name=$(echo "$url" | awk -F '/' '{print $(NF-1)"/"$NF}') - - # Fetch the latest release tag from GitHub API - latest_release=$(curl -s "https://api.github.com/repos/$repo_name/releases/latest" | jq -r '.tag_name') - - # If the API call was successful and we got a tag name - if [[ "$latest_release" != "null" ]]; then - echo "Updating $repo_name to latest release: $latest_release" - # Update the YAML file with the new commit_reference - yq eval -i "(.source_repositories[] | select(.url == \"$url\").commit_reference) = \"$latest_release\"" "$CONFIG" - else - echo "Failed to fetch latest release for $repo_name" - fi -} - -# Loop through each source repository in the YAML file -yq eval '.source_repositories[] | .url' "$CONFIG" | while read -r url; do - update_commit_reference "$url" -done - -echo "Update complete." From 2013ee2e521e681bd8b7cb9d259229d9d5b4e555 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:56:06 +0100 Subject: [PATCH 5/5] Update gsoci.azurecr.io/giantswarm/crd-docs-generator Docker tag to v0.11.2 (#2434) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Fernando Ripoll --- scripts/update-crd-reference/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-crd-reference/main.sh b/scripts/update-crd-reference/main.sh index b39843fa88..64ca1a3808 100755 --- a/scripts/update-crd-reference/main.sh +++ b/scripts/update-crd-reference/main.sh @@ -3,7 +3,7 @@ set -e # renovate: datasource=docker depName=gsoci.azurecr.io/giantswarm/crd-docs-generator versioning=loose -CRD_DOCS_GENERATOR_VERSION=0.11.1 +CRD_DOCS_GENERATOR_VERSION=0.11.2 DESTINATION=src/content/reference/platform-api/crd