mass update and migrate to networking.k8s.io/v1 api

This commit is contained in:
ace
2022-07-31 06:27:41 +03:00
parent b0ae6e8f4e
commit 3fd0781699
24 changed files with 497 additions and 164 deletions

View File

@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 1.25.1
appVersion: 1.25.2
description: Unofficial Bitwarden compatible server written in Rust
home: https://github.com/k8s-at-home/charts/tree/master/charts/bitwardenrs
icon: https://raw.githubusercontent.com/bitwarden/brand/master/icons/256x256.png
@ -17,4 +17,4 @@ name: bitwarden
sources:
- https://github.com/dani-garcia/bitwarden_rs
type: application
version: 2.0.13
version: 2.0.15

View File

@ -2,7 +2,14 @@
{{- $fullName := include "bitwarden.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- $websockets := .Values.bitwarden.websockets -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- 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
@ -17,6 +24,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- 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 }}
@ -33,20 +43,50 @@ spec:
http:
paths:
{{- range .paths }}
- path: {{ . }}
- path: {{ .path }}
{{- 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 }}
{{- if $websockets.enabled }}
- path: {{ . | trimSuffix "/" }}/notifications/hub
- path: {{ .path | trimSuffix "/" }}/notifications/hub
{{- 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: {{ $websockets.port }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $websockets.port }}
- path: {{ . | trimSuffix "/" }}/notifications/hub/negotiate
{{- end }}
- path: {{ .path | trimSuffix "/" }}/notifications/hub/negotiate
{{- 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 }}
{{- end }}

View File

@ -5,7 +5,7 @@ replicaCount: 1
image:
repository: vaultwarden/server
pullPolicy: IfNotPresent
tag: "1.25.1"
tag: "1.25.2"
imagePullSecrets: []
nameOverride: ""
@ -146,12 +146,15 @@ service:
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts: