Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ingress definitions to be compatiable with K8S 1.22 #6

Merged
merged 17 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ct-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chart-dirs:
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
- velero=https://vmware-tanzu.github.io/helm-charts
- jetstack=https://charts.jetstack.io
debug: true
#excluded-charts:
# - common
Expand Down
1 change: 1 addition & 0 deletions .github/ct-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
- velero=https://vmware-tanzu.github.io/helm-charts
- prometheus-community=https://prometheus-community.github.io/helm-charts
- jetstack=https://charts.jetstack.io
target-branch: main
check-version-increment: true
debug: true
Expand Down
4 changes: 2 additions & 2 deletions charts/app-config-frontend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ 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.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.1
version: 0.2.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. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "0.3.2"
appVersion: "0.3.3"
sources: ["https://github.com/RADAR-base/radar-app-config"]
home: "https://radar-base.org"
maintainers:
Expand Down
10 changes: 6 additions & 4 deletions charts/app-config-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# app-config-frontend

![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.3.2](https://img.shields.io/badge/AppVersion-0.3.2-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.3.3](https://img.shields.io/badge/AppVersion-0.3.3-informational?style=flat-square)

A Helm chart for the frontend application of RADAR-base application config (app-config).

Expand Down Expand Up @@ -31,7 +31,7 @@ A Helm chart for the frontend application of RADAR-base application config (app-
|-----|------|---------|-------------|
| replicaCount | int | `2` | Number of Appconfig frontend replicas to deploy |
| image.repository | string | `"radarbase/radar-app-config-frontend"` | Appconfig frontend image repository |
| image.tag | string | `"0.3.2"` | Appconfig frontend image tag (immutable tags are recommended) Overrides the image tag whose default is the chart appVersion. |
| image.tag | string | `"0.3.3"` | Appconfig frontend image tag (immutable tags are recommended) Overrides the image tag whose default is the chart appVersion. |
| image.pullPolicy | string | `"IfNotPresent"` | Appconfig frontend image pull policy |
| imagePullSecrets | list | `[]` | Docker registry secret names as an array |
| nameOverride | string | `""` | String to partially override app-config-frontend.fullname template with a string (will prepend the release name) |
Expand All @@ -43,8 +43,10 @@ A Helm chart for the frontend application of RADAR-base application config (app-
| service.port | int | `8080` | Appconfig frontend port |
| ingress.enabled | bool | `true` | Enable ingress controller resource |
| ingress.annotations | object | check values.yaml | Annotations that define default ingress class, certificate issuer |
| ingress.hosts[0] | object | `{"paths":["/appconfig($|/)(.*)"]}` | Path within the url structure |
| ingress.tls | list | `[]` | Utilize TLS backend in ingress |
| ingress.path | string | `"/appconfig($|/)(.*)"` | Path within the url structure |
| ingress.pathType | string | `"ImplementationSpecific"` | |
| ingress.hosts | list | `["localhost"]` | Hosts to accept requests from |
| ingress.tls.secretName | string | `"radar-base-tls"` | TLS Secret Name |
| resources.limits | object | `{"cpu":"200m","memory":"512Mi"}` | CPU/Memory resource limits |
| resources.requests | object | `{"cpu":"100m","memory":"128Mi"}` | CPU/Memory resource requests |
| nodeSelector | object | `{}` | Node labels for pod assignment |
Expand Down
22 changes: 0 additions & 22 deletions charts/app-config-frontend/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,22 +0,0 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "app-config-frontend.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "app-config-frontend.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "app-config-frontend.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "app-config-frontend.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
39 changes: 24 additions & 15 deletions charts/app-config-frontend/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,50 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "app-config-frontend.fullname" . -}}
{{- $path := .Values.ingress.path -}}
{{- $hosts := .Values.ingress.hosts -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- $pathType := .Values.ingress.pathType -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "app-config-frontend.labels" . | nindent 4 }}
{{ include "app-config-frontend.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
{{- range $hosts }}
- {{ . | quote }}
{{- end }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ $.Values.server_name | quote }}
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
- path: {{ $path | quote }}
{{- if and $pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ $pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
19 changes: 9 additions & 10 deletions charts/app-config-frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ image:
repository: radarbase/radar-app-config-frontend
# -- Appconfig frontend image tag (immutable tags are recommended)
# Overrides the image tag whose default is the chart appVersion.
tag: 0.3.2
tag: 0.3.3
# -- Appconfig frontend image pull policy
pullPolicy: IfNotPresent

Expand Down Expand Up @@ -52,16 +52,15 @@ ingress:
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
# -- Path within the url structure
path: '/appconfig($|/)(.*)'
pathType: ImplementationSpecific
# -- Hosts to accept requests from
hosts:
# -- Path within the url structure
- paths:
- '/appconfig($|/)(.*)'

# -- Utilize TLS backend in ingress
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
- localhost
tls:
# -- TLS Secret Name
secretName: radar-base-tls

resources:
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down
4 changes: 2 additions & 2 deletions charts/app-config/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
apiVersion: v2
appVersion: "0.3.3"
description: A Helm chart for RADAR-base application config (app-config) backend service which is used as mobile app configuration engine with per-project and per-user configuration.
name: app-config
version: 0.1.2
version: 0.2.0
sources: ["https://github.com/RADAR-base/radar-app-config"]
type: application
home: "https://radar-base.org"
Expand Down
3 changes: 2 additions & 1 deletion charts/app-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# app-config

![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.3.3](https://img.shields.io/badge/AppVersion-0.3.3-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.3.3](https://img.shields.io/badge/AppVersion-0.3.3-informational?style=flat-square)

A Helm chart for RADAR-base application config (app-config) backend service which is used as mobile app configuration engine with per-project and per-user configuration.

Expand Down Expand Up @@ -46,6 +46,7 @@ A Helm chart for RADAR-base application config (app-config) backend service whic
| ingress.enabled | bool | `true` | Enable ingress controller resource |
| ingress.annotations | object | check values.yaml | Annotations that define default ingress class, certificate issuer |
| ingress.path | string | `"/appconfig/api($|/)(.*)"` | Path within the url structure |
| ingress.pathType | string | `"ImplementationSpecific"` | |
| ingress.hosts | list | `["localhost"]` | Hosts to accept requests from |
| ingress.tls.secretName | string | `"radar-base-tls"` | TLS Secret Name |
| resources.limits | object | `{"cpu":2}` | CPU/Memory resource limits |
Expand Down
14 changes: 11 additions & 3 deletions charts/app-config/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,22 @@ Create chart name and version as used by the chart label.
Common labels
*/}}
{{- define "app-config.labels" -}}
app.kubernetes.io/name: {{ include "app-config.name" . }}
helm.sh/chart: {{ include "app-config.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ include "app-config.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "app-config.selectorLabels" -}}
app.kubernetes.io/name: {{ include "app-config.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}


{{/*
Create the name of the service account to use
Expand Down
15 changes: 13 additions & 2 deletions charts/app-config/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
{{- $path := .Values.ingress.path -}}
{{- $hosts := .Values.ingress.hosts -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- $pathType := .Values.ingress.pathType -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
Expand Down Expand Up @@ -32,8 +33,18 @@ spec:
http:
paths:
- path: {{ $path | quote }}
{{- if and $pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ $pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/app-config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ingress:
cert-manager.io/cluster-issuer: letsencrypt-prod
# -- Path within the url structure
path: "/appconfig/api($|/)(.*)"
pathType: ImplementationSpecific
# -- Hosts to accept requests from
hosts:
- localhost
Expand Down
2 changes: 1 addition & 1 deletion charts/catalog-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "0.7.5"
description: A Helm chart for RADAR-base catalogue server. This application creates RADAR-base topics in Kafka, registers schemas in Schema Registry and keeps a catalog of available source types.
name: catalog-server
version: 0.2.4
version: 0.3.0
sources: ["https://github.com/RADAR-base/RADAR-Schemas/tree/master/java-sdk"]
type: application
home: "https://radar-base.org"
Expand Down
2 changes: 1 addition & 1 deletion charts/catalog-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# catalog-server

![Version: 0.2.4](https://img.shields.io/badge/Version-0.2.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.7.5](https://img.shields.io/badge/AppVersion-0.7.5-informational?style=flat-square)
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.7.5](https://img.shields.io/badge/AppVersion-0.7.5-informational?style=flat-square)

A Helm chart for RADAR-base catalogue server. This application creates RADAR-base topics in Kafka, registers schemas in Schema Registry and keeps a catalog of available source types.

Expand Down
20 changes: 20 additions & 0 deletions charts/catalog-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ If release name contains chart name it will be used as a full name.
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "catalog-server.labels" -}}
helm.sh/chart: {{ include "catalog-server.chart" . }}
{{ include "catalog-server.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "catalog-server.selectorLabels" -}}
app.kubernetes.io/name: {{ include "catalog-server.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
4 changes: 2 additions & 2 deletions charts/cc-schema-registry-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
apiVersion: v2
appVersion: "1.0"
description: A Helm chart for Confluent Cloud schema registry proxy. This proxy service is used when RADAR-base platform is used with Confluent Cloud based schema registry. It forwards requests to schema registry with an additonal basic authentication header with Confluent Cloud schema registry credentials. This service will be enabled if `cc.enabled = true`.
name: cc-schema-registry-proxy
version: 0.1.1
version: 0.2.0
type: application
home: "https://radar-base.org"
maintainers:
Expand Down
8 changes: 5 additions & 3 deletions charts/cc-schema-registry-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# cc-schema-registry-proxy

![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0](https://img.shields.io/badge/AppVersion-1.0-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0](https://img.shields.io/badge/AppVersion-1.0-informational?style=flat-square)

A Helm chart for Confluent Cloud schema registry proxy. This proxy service is used when RADAR-base platform is used with Confluent Cloud based schema registry. It forwards requests to schema registry with an additonal basic authentication header with Confluent Cloud schema registry credentials. This service will be enabled if `cc.enabled = true`.

Expand All @@ -29,8 +29,10 @@ A Helm chart for Confluent Cloud schema registry proxy. This proxy service is us
| service.type | string | `"ExternalName"` | Kubernetes Service type, |
| service.externalName | string | `"schema-registry-domain"` | Domain name used for pointing to actual schema registry instance |
| ingress.enabled | bool | `true` | Enable ingress controller resource |
| ingress.annotations | object | check values.yaml | Annotations that define default ingress class, certificate issuer |
| ingress.path | string | `"/schema/?(.*)"` | Path within the url structure |
| ingress.hosts | list | `["localhost"]` | Hosts to listen requests from |
| ingress.tls.secretName | string | `"radar-base-tls"` | Name of the secret that contains TLS certificates |
| ingress.pathType | string | `"ImplementationSpecific"` | |
| ingress.hosts | list | `["localhost"]` | Hosts to accept requests from |
| ingress.tls.secretName | string | `"radar-base-tls"` | TLS Secret Name |
| cc.schemaRegistryApiKey | string | `"srApiKey"` | Confluent cloud schema registry API key |
| cc.schemaRegistryApiSecret | string | `"srApiSecret"` | Confluent cloud schema registry API secret |
20 changes: 20 additions & 0 deletions charts/cc-schema-registry-proxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ If release name contains chart name it will be used as a full name.
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "cc-schema-registry-proxy.labels" -}}
helm.sh/chart: {{ include "cc-schema-registry-proxy.chart" . }}
{{ include "cc-schema-registry-proxy.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "cc-schema-registry-proxy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "cc-schema-registry-proxy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
Loading