From 811146b9e866d62cf5cb28d391554a466d62164d Mon Sep 17 00:00:00 2001 From: Jennifer Travinski Date: Mon, 4 Oct 2021 17:23:11 -0400 Subject: [PATCH 1/3] Added note on file naming for HelmCharts, HelmChartConfigs, manifests --- content/k3s/latest/en/helm/_index.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/content/k3s/latest/en/helm/_index.md b/content/k3s/latest/en/helm/_index.md index 574c36d6c66..ca301024927 100644 --- a/content/k3s/latest/en/helm/_index.md +++ b/content/k3s/latest/en/helm/_index.md @@ -66,6 +66,20 @@ spec: Content placed in `/var/lib/rancher/k3s/server/static/` can be accessed anonymously via the Kubernetes APIServer from within the cluster. This URL can be templated using the special variable `%{KUBERNETES_API}%` in the `spec.chart` field. For example, the packaged Traefik component loads its chart from `https://%{KUBERNETES_API}%/static/charts/traefik-1.81.0.tgz`. + +>**Notice on File Naming Requirements:** `HelmChart`, `HelmChartConfig` and manifest files require adherence to naming conventions to avoid confusion and errors in logs. For example, neither uppercase letters nor underscores should be used in chart names. A filename with underscores will produce errors like the following: +``` +level=error msg="Failed to process config: failed to process +/var/lib/rancher/rke2/server/manifests/rke2_ingress_daemonset.yaml: +Addon.k3s.cattle.io \"rke2_ingress_daemonset\" is invalid: metadata.name: +Invalid value: \"rke2_ingress_daemonset\": a lowercase RFC 1123 subdomain +must consist of lower case alphanumeric characters, '-' or '.', and must +start and end with an alphanumeric character (e.g. 'example.com', regex +used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9] +([-a-z0-9]*[a-z0-9])?)*')" +``` +To learn more about best practices on chart naming conventions, go [here](https://v2-14-0.helm.sh/docs/chart_best_practices/#chart-names). + ### Customizing Packaged Components with HelmChartConfig To allow overriding values for packaged components that are deployed as HelmCharts (such as Traefik), K3s versions starting with v1.19.0+k3s1 support customizing deployments via a HelmChartConfig resources. The HelmChartConfig resource must match the name and namespace of its corresponding HelmChart, and supports providing additional `valuesContent`, which is passed to the `helm` command as an additional value file. From eea23d781388c9e8793c082b140a243a4b5e2e7c Mon Sep 17 00:00:00 2001 From: Jennifer Travinski Date: Tue, 5 Oct 2021 18:25:38 -0400 Subject: [PATCH 2/3] Updating file naming note --- content/k3s/latest/en/helm/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/k3s/latest/en/helm/_index.md b/content/k3s/latest/en/helm/_index.md index ca301024927..18d074f6ad5 100644 --- a/content/k3s/latest/en/helm/_index.md +++ b/content/k3s/latest/en/helm/_index.md @@ -67,7 +67,7 @@ spec: Content placed in `/var/lib/rancher/k3s/server/static/` can be accessed anonymously via the Kubernetes APIServer from within the cluster. This URL can be templated using the special variable `%{KUBERNETES_API}%` in the `spec.chart` field. For example, the packaged Traefik component loads its chart from `https://%{KUBERNETES_API}%/static/charts/traefik-1.81.0.tgz`. ->**Notice on File Naming Requirements:** `HelmChart`, `HelmChartConfig` and manifest files require adherence to naming conventions to avoid confusion and errors in logs. For example, neither uppercase letters nor underscores should be used in chart names. A filename with underscores will produce errors like the following: +>**Notice on File Naming Requirements:** `HelmChart`, `HelmChartConfig` and manifest files require adherence to naming conventions to avoid confusion and errors in logs. The Helm chart controller uses the filename to create objects. Therefore, if a filename doesn’t align with the validation, that will cause an error installing the chart, even if the chart configuration is correct. For example, underscores, uppercase letters, and dots are not permitted in filenames. The example below is an error generated from using underscores: ``` level=error msg="Failed to process config: failed to process /var/lib/rancher/rke2/server/manifests/rke2_ingress_daemonset.yaml: @@ -78,7 +78,7 @@ start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9] ([-a-z0-9]*[a-z0-9])?)*')" ``` -To learn more about best practices on chart naming conventions, go [here](https://v2-14-0.helm.sh/docs/chart_best_practices/#chart-names). +>**Note:** Despite the error message stating dots can be used, they should not be. Refer [here](https://helm.sh/docs/chart_best_practices/conventions/#chart-names) to learn more about best practices on file naming conventions. ### Customizing Packaged Components with HelmChartConfig From 6102f31c50df617c93400ac36df7c22fff7dca60 Mon Sep 17 00:00:00 2001 From: Jennifer Travinski Date: Mon, 11 Oct 2021 11:03:21 -0400 Subject: [PATCH 3/3] Updated K3s file naming verbiage --- content/k3s/latest/en/helm/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/k3s/latest/en/helm/_index.md b/content/k3s/latest/en/helm/_index.md index 18d074f6ad5..652972c8bf7 100644 --- a/content/k3s/latest/en/helm/_index.md +++ b/content/k3s/latest/en/helm/_index.md @@ -66,8 +66,9 @@ spec: Content placed in `/var/lib/rancher/k3s/server/static/` can be accessed anonymously via the Kubernetes APIServer from within the cluster. This URL can be templated using the special variable `%{KUBERNETES_API}%` in the `spec.chart` field. For example, the packaged Traefik component loads its chart from `https://%{KUBERNETES_API}%/static/charts/traefik-1.81.0.tgz`. +**Note:** The `name` field should follow the Helm chart naming conventions. Refer [here](https://helm.sh/docs/chart_best_practices/conventions/#chart-names) to learn more. ->**Notice on File Naming Requirements:** `HelmChart`, `HelmChartConfig` and manifest files require adherence to naming conventions to avoid confusion and errors in logs. The Helm chart controller uses the filename to create objects. Therefore, if a filename doesn’t align with the validation, that will cause an error installing the chart, even if the chart configuration is correct. For example, underscores, uppercase letters, and dots are not permitted in filenames. The example below is an error generated from using underscores: +>**Notice on File Naming Requirements:** `HelmChart` and `HelmChartConfig` manifest filenames should adhere to Kubernetes object [naming restrictions](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/). The Helm Controller uses filenames to create objects; therefore, the filename must also align with the restrictions. Any related errors can be observed in the RKE2-server logs. The example below is an error generated from using underscores: ``` level=error msg="Failed to process config: failed to process /var/lib/rancher/rke2/server/manifests/rke2_ingress_daemonset.yaml: @@ -78,7 +79,6 @@ start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9] ([-a-z0-9]*[a-z0-9])?)*')" ``` ->**Note:** Despite the error message stating dots can be used, they should not be. Refer [here](https://helm.sh/docs/chart_best_practices/conventions/#chart-names) to learn more about best practices on file naming conventions. ### Customizing Packaged Components with HelmChartConfig