From f50459860d35e284d7dc03365af727a55a5a065f Mon Sep 17 00:00:00 2001 From: BaskaranSelvaraj <52482083+BaskaranSelvaraj@users.noreply.github.com> Date: Thu, 20 Aug 2020 03:00:29 -0400 Subject: [PATCH] aspnet-core - Adding the health ingress (#3454) --- bitnami/aspnet-core/Chart.yaml | 2 +- bitnami/aspnet-core/README.md | 12 ++++ .../aspnet-core/templates/health-ingress.yaml | 51 +++++++++++++++++ bitnami/aspnet-core/values-production.yaml | 55 +++++++++++++++++++ bitnami/aspnet-core/values.yaml | 55 +++++++++++++++++++ 5 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 bitnami/aspnet-core/templates/health-ingress.yaml diff --git a/bitnami/aspnet-core/Chart.yaml b/bitnami/aspnet-core/Chart.yaml index 454d7746d7..1a02a8de7a 100644 --- a/bitnami/aspnet-core/Chart.yaml +++ b/bitnami/aspnet-core/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: aspnet-core -version: 0.1.4 +version: 0.2.0 appVersion: 3.1.7 description: ASP.NET Core is an open-source framework created by Microsoft for building cloud-enabled, modern applications. keywords: diff --git a/bitnami/aspnet-core/README.md b/bitnami/aspnet-core/README.md index 9cfc559664..14c9bf3617 100644 --- a/bitnami/aspnet-core/README.md +++ b/bitnami/aspnet-core/README.md @@ -164,6 +164,18 @@ The following tables lists the configurable parameters of the ASP.NET Core chart | `ingress.secrets[0].name` | TLS Secret Name | `nil` | | `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | | `ingress.secrets[0].key` | TLS Secret Key | `nil` | +| `healthIngress.enabled` | Enable healthIngress controller resource | `false` | +| `healthIngress.certManager` | Add annotations for cert-manager | `false` | +| `healthIngress.hostname` | Default host for the healthIngress resource | `aspnet-core.local` | +| `healthIngress.tls` | Enable TLS configuration for the hostname defined at `healthIngress.hostname` parameter | `false` | +| `healthIngress.annotations` | Ingress annotations | `[]` | +| `healthIngress.extraHosts[0].name` | Additional hostnames to be covered | `nil` | +| `healthIngress.extraHosts[0].path` | Additional hostnames to be covered | `nil` | +| `healthIngress.extraTls[0].hosts[0]` | TLS configuration for additional hostnames to be covered | `nil` | +| `healthIngress.extraTls[0].secretName` | TLS configuration for additional hostnames to be covered | `nil` | +| `healthIngress.secrets[0].name` | TLS Secret Name | `nil` | +| `healthIngress.secrets[0].certificate` | TLS Secret Certificate | `nil` | +| `healthIngress.secrets[0].key` | TLS Secret Key | `nil` | ### RBAC parameters diff --git a/bitnami/aspnet-core/templates/health-ingress.yaml b/bitnami/aspnet-core/templates/health-ingress.yaml new file mode 100644 index 0000000000..19f59c353d --- /dev/null +++ b/bitnami/aspnet-core/templates/health-ingress.yaml @@ -0,0 +1,51 @@ +{{- if .Values.healthIngress.enabled -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ include "aspnet-core.fullname" . }}-health + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.healthIngress.certManager }} + kubernetes.io/tls-acme: "true" + {{- end }} + {{- if .Values.healthIngress.annotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.healthIngress.annotations "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + rules: + {{- if .Values.healthIngress.hostname }} + - host: {{ .Values.healthIngress.hostname }} + http: + paths: + - path: / + backend: + serviceName: {{ include "aspnet-core.fullname" . }} + servicePort: http + {{- end }} + {{- range .Values.healthIngress.extraHosts }} + - host: {{ .name }} + http: + paths: + - path: {{ default "/" .path }} + backend: + serviceName: {{ include "aspnet-core.fullname" $ }} + servicePort: http + {{- end }} + {{- if or .Values.healthIngress.tls .Values.healthIngress.extraTls .Values.healthIngress.hosts }} + tls: + {{- if .Values.healthIngress.tls }} + - hosts: + - {{ .Values.healthIngress.hostname }} + secretName: {{ printf "%s-tls" .Values.healthIngress.hostname }} + {{- end }} + {{- if .Values.healthIngress.extraTls }} + {{- toYaml .Values.healthIngress.extraTls | nindent 4 }} + {{- end }} + {{- end }} +{{- end }} diff --git a/bitnami/aspnet-core/values-production.yaml b/bitnami/aspnet-core/values-production.yaml index d66c1d99a4..313260e6a1 100644 --- a/bitnami/aspnet-core/values-production.yaml +++ b/bitnami/aspnet-core/values-production.yaml @@ -394,6 +394,61 @@ ingress: ## key: ## certificate: +healthIngress: + ## Set to true to enable heallth ingress record generation + ## + enabled: false + + ## Set this to true in order to add the corresponding annotations for cert-manager + ## + certManager: false + + ## When the heallth ingress is enabled, a host pointing to this will be created + ## + hostname: aspnet-core.local + + ## Ingress annotations done as key:value pairs + ## For a full list of possible ingress annotations, please see + ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md + ## + ## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set + ## + annotations: {} + + ## Enable TLS configuration for the hostname defined at ingress.hostname parameter + ## TLS certificates will be retrieved from a TLS secret with name: {{- printf "%s-tls" .Values.ingress.hostname }} + ## You can use the ingress.secrets parameter to create this TLS secret, relay on cert-manager to create it, or + ## let the chart create self-signed certificates for you + ## + tls: false + + ## The list of additional hostnames to be covered with this heallth ingress record. + ## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array + ## extraHosts: + ## - name: aspnet-core.local + ## path: / + + ## The tls configuration for additional hostnames to be covered with this heallth ingress record. + ## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls + ## extraTls: + ## - hosts: + ## - aspnet-core.local + ## secretName: aspnet-core.local-tls + + ## If you're providing your own certificates, please use this to add the certificates as secrets + ## key and certificate should start with -----BEGIN CERTIFICATE----- or -----BEGIN RSA PRIVATE KEY----- + ## name should line up with a secretName set further up + ## + ## If it is not set and you're using cert-manager, this is unneeded, as it will create the secret for you + ## If it is not set and you're NOT using cert-manager either, self-signed certificates will be created + ## It is also possible to create and manage the certificates outside of this helm chart + ## Please see README.md for more information + ## + secrets: [] + ## - name: aspnet-core.local-tls + ## key: + ## certificate: + ## K8s Service Account. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ ## diff --git a/bitnami/aspnet-core/values.yaml b/bitnami/aspnet-core/values.yaml index 080141a32b..170030c561 100644 --- a/bitnami/aspnet-core/values.yaml +++ b/bitnami/aspnet-core/values.yaml @@ -395,6 +395,61 @@ ingress: ## key: ## certificate: +healthIngress: + ## Set to true to enable heallth ingress record generation + ## + enabled: false + + ## Set this to true in order to add the corresponding annotations for cert-manager + ## + certManager: false + + ## When the heallth ingress is enabled, a host pointing to this will be created + ## + hostname: aspnet-core.local + + ## Ingress annotations done as key:value pairs + ## For a full list of possible ingress annotations, please see + ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md + ## + ## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set + ## + annotations: {} + + ## Enable TLS configuration for the hostname defined at ingress.hostname parameter + ## TLS certificates will be retrieved from a TLS secret with name: {{- printf "%s-tls" .Values.ingress.hostname }} + ## You can use the ingress.secrets parameter to create this TLS secret, relay on cert-manager to create it, or + ## let the chart create self-signed certificates for you + ## + tls: false + + ## The list of additional hostnames to be covered with this heallth ingress record. + ## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array + ## extraHosts: + ## - name: aspnet-core.local + ## path: / + + ## The tls configuration for additional hostnames to be covered with this heallth ingress record. + ## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls + ## extraTls: + ## - hosts: + ## - aspnet-core.local + ## secretName: aspnet-core.local-tls + + ## If you're providing your own certificates, please use this to add the certificates as secrets + ## key and certificate should start with -----BEGIN CERTIFICATE----- or -----BEGIN RSA PRIVATE KEY----- + ## name should line up with a secretName set further up + ## + ## If it is not set and you're using cert-manager, this is unneeded, as it will create the secret for you + ## If it is not set and you're NOT using cert-manager either, self-signed certificates will be created + ## It is also possible to create and manage the certificates outside of this helm chart + ## Please see README.md for more information + ## + secrets: [] + ## - name: aspnet-core.local-tls + ## key: + ## certificate: + ## K8s Service Account. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ ##