diff --git a/README.md b/README.md index ef16dfb..052e96c 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Parameter | Description | Default | Required `metrics.image.pullPolicy` | Container pull policy | `IfNotPresent` | no `metrics.securtyContext` | Custom security context for container | `{}` | no `metrics.resources` | Resources request and limit YAML | `{}` | no -`ingress.enabled` | If true, an ingress object will be created | `false` | no +`ingress.enabled` | If true, an ingress object will be created to expose the __stat dashboard only__ | `false` | no `ingress.annotations` | Annotations for the ingress | `{}` | no `ingress.hosts` | Ingress hostname | `[]` | no `ingress.tls` | Ingress TLS | `[]` | no @@ -107,7 +107,7 @@ helm repo add storj-storagenode-chart https://mqllr.github.io/storj-storagenode- 2. Create your identity -Create a secret with your identity in kubernetes +Create a secret in kubernetes with your node identity ``` curl -L https://github.com/MqllR/storj-storagenode-chart/releases/download/identity/identity-to-kube-secret-amd64 -o identity-to-kube-secret diff --git a/charts/storj-storagenode/Chart.yaml b/charts/storj-storagenode/Chart.yaml index 4785744..9b7e6e5 100644 --- a/charts/storj-storagenode/Chart.yaml +++ b/charts/storj-storagenode/Chart.yaml @@ -1,25 +1,9 @@ apiVersion: v2 name: storj-storagenode description: A Helm chart for the storagenode STORJ - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -version: 0.3.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. +version: 0.3.1 appVersion: 1.14.7 - maintainers: - name: MqllR email: mael@mqli.fr diff --git a/charts/storj-storagenode/templates/ingress.yaml b/charts/storj-storagenode/templates/ingress.yaml index 96af10e..5b76244 100644 --- a/charts/storj-storagenode/templates/ingress.yaml +++ b/charts/storj-storagenode/templates/ingress.yaml @@ -1,6 +1,15 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "storj-storagenode.fullname" . -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if and .Values.ingress.enabled .Values.service.stats.enabled -}} +{{- $prefix := include "storj-storagenode.fullname" . -}} +{{- $fullName := printf "%s-%s" $prefix "stats" -}} +{{- $svcPort := .Values.service.stats.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 @@ -15,26 +24,39 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: -{{- if .Values.ingress.tls }} + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} tls: - {{- range .Values.ingress.tls }} + {{- range .Values.ingress.tls }} - hosts: - {{- range .hosts }} + {{- range .hosts }} - {{ . | quote }} - {{- end }} + {{- end }} secretName: {{ .secretName }} + {{- end }} {{- end }} -{{- end }} rules: - {{- range .Values.ingress.hosts }} + {{- range .Values.ingress.hosts }} - host: {{ .host | quote }} http: paths: - {{- range .paths }} - - path: {{ . }} + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} backend: - serviceName: {{ $fullName }}-stats - servicePort: stats - {{- end }} - {{- end }} + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} {{- end }} diff --git a/charts/storj-storagenode/values.yaml b/charts/storj-storagenode/values.yaml index 715f31f..6b044df 100644 --- a/charts/storj-storagenode/values.yaml +++ b/charts/storj-storagenode/values.yaml @@ -90,7 +90,9 @@ ingress: # kubernetes.io/tls-acme: "true" hosts: - host: chart-example.local - paths: ["/"] + paths: + - path: "/" + pathType: ImplementationSpecific tls: [] # - secretName: chart-example-tls # hosts: