Skip to content

Commit

Permalink
KB: ingress points to the correct service
Browse files Browse the repository at this point in the history
  • Loading branch information
js-sub committed Sep 3, 2024
1 parent a28f649 commit 47bdfb4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/knowledge-base/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: knowledge-base
description: Knowledge Base frontend and API/backend
type: application
version: 0.1.4
version: 0.1.5
appVersion: "0.0.1"
10 changes: 10 additions & 0 deletions charts/knowledge-base/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{- define "knowledge-base.fullname.frontend" -}}
{{- $fullname := include "knowledge-base.fullname" . }}
{{- printf "%s-%s" $fullname "frontend" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "knowledge-base.fullname.api" -}}
{{- $fullname := include "knowledge-base.fullname" . }}
{{- printf "%s-%s" $fullname "api" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/knowledge-base/templates/api_deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ include "knowledge-base.fullname" . }}-api"
name: {{ include "knowledge-base.fullname.api" . }}
labels:
{{- include "knowledge-base-api.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/knowledge-base/templates/api_service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ include "knowledge-base.fullname" . }}-api"
name: {{ include "knowledge-base.fullname.api" . }}
labels:
{{- include "knowledge-base-api.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/knowledge-base/templates/frontend_deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ include "knowledge-base.fullname" . }}-frontend"
name: {{ include "knowledge-base.fullname.frontend" . }}
labels:
{{- include "knowledge-base-frontend.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/knowledge-base/templates/frontend_service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ include "knowledge-base.fullname" . }}-frontend"
name: {{ include "knowledge-base.fullname.frontend" . }}
labels:
{{- include "knowledge-base-frontend.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/knowledge-base/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "knowledge-base.fullname" . -}}
{{- $fullName := include "knowledge-base.fullname.frontend" . -}}
{{- $svcPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down

0 comments on commit 47bdfb4

Please sign in to comment.