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

feat(backend): 独立 backend api 的 service 和 ingress #4291 #4296

Merged
merged 1 commit into from
May 10, 2024
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
8 changes: 4 additions & 4 deletions helm-charts/bk-dbm/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ dependencies:
version: 9.15.2
- name: reloader
repository: https://stakater.github.io/stakater-charts
version: 1.0.76
version: 1.0.93
- name: grafana
repository: file://./charts/grafana
version: 7.9.8
- name: dbm
repository: file://charts/dbm
version: 0.1.35
version: 0.1.36
- name: dbconfig
repository: file://charts/dbconfig
version: 0.1.13
Expand Down Expand Up @@ -56,5 +56,5 @@ dependencies:
- name: backup-consumer
repository: file://charts/backup-consumer
version: 0.0.3
digest: sha256:a02f4276a760a998bbab6d773dc904fafb95cc7737101cb7748abbaeba8ad901
generated: "2024-04-08T19:22:00.694614+08:00"
digest: sha256:f64182c5270d19aa9eb7107b253dbf18cd6562b0e1a4fefdc60269f622f6cc6c
generated: "2024-05-08T16:44:54.380362+08:00"
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
- condition: dbm.enabled
name: dbm
repository: file://charts/dbm
version: 0.1.35
version: 0.1.36
- condition: dbconfig.enabled
name: dbconfig
repository: file://charts/dbconfig
Expand Down
4 changes: 2 additions & 2 deletions helm-charts/bk-dbm/charts/dbm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: 1.3.0-alpha.675
appVersion: 1.3.0-alpha.696
description: A Helm chart for dbm
name: dbm
type: application
version: 0.1.35
version: 0.1.36
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{- if .Values.ingressBackendApi.enabled -}}
{{- $fullName := ( include "dbm.backend-api.fullname" .) -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingressBackendApi.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingressBackendApi.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingressBackendApi.annotations "kubernetes.io/ingress.class" .Values.ingressBackendApi.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
{{- end }}
kind: Ingress
metadata:
name: {{ printf "%s-%s" (include "bk-dbm.fullname" .) "public" }}
labels:
{{- include "bk-dbm.labels" . | nindent 4 }}
{{- with .Values.ingressBackendApi.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingressBackendApi.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingressBackendApi.className }}
{{- end }}
{{- if .Values.ingressBackendApi.tls }}
tls:
{{- range .Values.ingressBackendApi.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- if .Values.ingressBackendApi.hostname }}
- host: {{ .Values.ingressBackendApi.hostname }}
http:
paths:
{{- range .Values.ingressBackendApi.paths }}
- 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 }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.ingressPublic.enabled -}}
{{- $fullName := include "bk-dbm.fullname" . -}}
{{- $fullName := ( include "dbm.backend-api.fullname" .) -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingressPublic.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingressPublic.annotations "kubernetes.io/ingress.class") }}
Expand Down
11 changes: 10 additions & 1 deletion helm-charts/bk-dbm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ dbm:
pathType: ImplementationSpecific
tls: []

ingressBackendApi:
enabled: true
className: ""
hostname: "bkdbm-backend-api.example.com"
paths:
- path: /
pathType: ImplementationSpecific
tls: []

ingressPublic:
# 在跨云管控场景下,需要配置公网 clb 进行访问
enabled: false
Expand Down Expand Up @@ -251,7 +260,7 @@ grafana:
image:
registry: "mirrors.tencent.com"
repository: "build/blueking/bk-monitor-grafana"
tag: 3.6.64
tag: 3.7.115
admin:
user: admin
password: admin
Expand Down
Loading