From 2a3517f1d55efeefa54e4976d4037d1e58aa0758 Mon Sep 17 00:00:00 2001 From: majinghe <42570491+majinghe@users.noreply.github.com> Date: Tue, 23 Dec 2025 17:31:01 +0800 Subject: [PATCH] Custom annotation (#1242) --- helm/README.md | 11 +++++------ helm/rustfs/templates/ingress.yaml | 7 ++----- helm/rustfs/values.yaml | 8 +------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/helm/README.md b/helm/README.md index 3ff09825..a9725f9c 100644 --- a/helm/README.md +++ b/helm/README.md @@ -44,7 +44,7 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | imageRegistryCredentials.username | string | `""` | The username to pull rustfs image from private registry. | | ingress.className | string | `"traefik"` | Specify the ingress class, traefik or nginx. | | ingress.enabled | bool | `true` | | -| ingress.hosts[0].host | string | `"your.rustfs.com"` | | +| ingress.hosts[0].host | string | `"example.rustfs.com"` | | | ingress.hosts[0].paths[0].path | string | `"/"` | | | ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | | ingress.nginxAnnotations."nginx.ingress.kubernetes.io/affinity" | string | `"cookie"` | | @@ -52,6 +52,7 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | ingress.nginxAnnotations."nginx.ingress.kubernetes.io/session-cookie-hash" | string | `"sha1"` | | | ingress.nginxAnnotations."nginx.ingress.kubernetes.io/session-cookie-max-age" | string | `"3600"` | | | ingress.nginxAnnotations."nginx.ingress.kubernetes.io/session-cookie-name" | string | `"rustfs"` | | +| ingress.customAnnotations | dict | `{}` |Customize annotations. | | ingress.traefikAnnotations."traefik.ingress.kubernetes.io/service.sticky.cookie" | string | `"true"` | | | ingress.traefikAnnotations."traefik.ingress.kubernetes.io/service.sticky.cookie.httponly" | string | `"true"` | | | ingress.traefikAnnotations."traefik.ingress.kubernetes.io/service.sticky.cookie.name" | string | `"rustfs"` | | @@ -59,8 +60,6 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | ingress.traefikAnnotations."traefik.ingress.kubernetes.io/service.sticky.cookie.secure" | string | `"true"` | | | ingress.tls.enabled | bool | `false` | Enable tls and access rustfs via https. | | ingress.tls.certManager.enabled | string | `false` | Enable cert manager support to generate certificate automatically. | -| ingress.tls.certManager.issuer.name | string | `false` | The name of cert manager issuer. | -| ingress.tls.certManager.issuer.kind | string | `false` | The kind of cert manager issuer, issuer or cluster-issuer. | | ingress.tls.crt | string | "" | The content of certificate file. | | ingress.tls.key | string | "" | The content of key file. | | livenessProbe.failureThreshold | int | `3` | | @@ -179,12 +178,12 @@ Check the ingress status ``` kubectl -n rustfs get ing NAME CLASS HOSTS ADDRESS PORTS AGE -rustfs nginx your.rustfs.com 10.43.237.152 80, 443 29m +rustfs nginx example.rustfs.com 10.43.237.152 80, 443 29m ``` -Access the rustfs cluster via `https://your.rustfs.com` with the default username and password `rustfsadmin`. +Access the rustfs cluster via `https://example.rustfs.com` with the default username and password `rustfsadmin`. -> Replace the `your.rustfs.com` with your own domain as well as the certificates. +> Replace the `example.rustfs.com` with your own domain as well as the certificates. # TLS configuration diff --git a/helm/rustfs/templates/ingress.yaml b/helm/rustfs/templates/ingress.yaml index bbb7b9d7..89f99c4d 100644 --- a/helm/rustfs/templates/ingress.yaml +++ b/helm/rustfs/templates/ingress.yaml @@ -2,12 +2,9 @@ {{- $secretName := .Values.ingress.tls.secretName }} {{- $ingressAnnotations := dict }} {{- if eq .Values.ingress.className "nginx" }} - {{- $ingressAnnotations = merge $ingressAnnotations (.Values.ingress.nginxAnnotations | default dict) }} +{{- $ingressAnnotations = .Values.ingress.nginxAnnotations }} {{- else if eq .Values.ingress.className "" }} - {{- $ingressAnnotations = merge $ingressAnnotations (.Values.ingress.customAnnoations | default dict) }} -{{- end }} -{{- if .Values.ingress.tls.certManager.enabled }} - {{- $ingressAnnotations = merge $ingressAnnotations (.Values.ingress.certManagerAnnotations | default dict) }} +{{- $ingressAnnotations = .Values.ingress.customAnnotations }} {{- end }} apiVersion: networking.k8s.io/v1 kind: Ingress diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index 898e17cd..42299d2c 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -114,13 +114,10 @@ ingress: nginx.ingress.kubernetes.io/session-cookie-hash: sha1 nginx.ingress.kubernetes.io/session-cookie-max-age: "3600" nginx.ingress.kubernetes.io/session-cookie-name: rustfs - certManagerAnnotations: - {} # Specify cert manager issuer annotations,cert-manager.io/issuer or cert-manager.io/cluster-issuer. - # cert-manager.io/issuer: "letsencrypt-staging" customAnnotations: # Specify custom annotations {} # Customize annotations hosts: - - host: xmg.rustfs.com + - host: example.rustfs.com paths: - path: / pathType: Prefix @@ -128,9 +125,6 @@ ingress: enabled: false # Enable tls and access rustfs via https. certManager: enabled: false # Enable certmanager to generate certificate for rustfs, default false. - issuer: - name: letsencrypt-staging # Specify cert manager issuer name - kind: Issuer # Specify cert manager issuer kind, Issuer or ClusterIssuer. secretName: secret-tls crt: tls.crt key: tls.key