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

hotfix(plugin-site) separate svcs #844

Merged
merged 1 commit into from
Oct 6, 2023
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
2 changes: 1 addition & 1 deletion charts/plugin-site/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ maintainers:
- name: timja
- name: halkeye
name: plugin-site
version: 0.3.1
version: 0.3.2
17 changes: 17 additions & 0 deletions charts/plugin-site/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Expand the name of the chart.
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand the name of the chart.
*/}}
{{- define "plugin-site-frontend.name" -}}
{{- include "plugin-site.name" . -}}-frontend
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
Expand All @@ -24,6 +31,16 @@ If release name contains chart name it will be used as a full name.
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "plugin-site-frontend.fullname" -}}
{{ include "plugin-site.fullname" . }}-frontend
{{- end -}}


{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
10 changes: 5 additions & 5 deletions charts/plugin-site/templates/deployment-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "plugin-site.fullname" . }}-backend
labels: {{ include "plugin-site.labels" . | nindent 4 }}
labels:
{{- include "plugin-site.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.backend.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "plugin-site.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "plugin-site.selectorLabels" . | nindent 6}}
template:
metadata:
annotations:
Expand Down Expand Up @@ -47,13 +47,13 @@ spec:
secretKeyRef:
name: {{ include "plugin-site.fullname" . }}
key: jira_password
{{- if .Values.sentry.dsn }}
{{- if .Values.sentry.dsn }}
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: {{ include "plugin-site.fullname" . }}
key: sentry_dsn
{{- end }}
{{- end }}
- name: DATA_FILE_URL
value: {{ .Values.dataFileUrl }}
volumeMounts:
Expand Down
13 changes: 7 additions & 6 deletions charts/plugin-site/templates/deployment-frontend.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "plugin-site.fullname" . }}-frontend
labels: {{ include "plugin-site-frontend.labels" . | nindent 4 }}
name: {{ include "plugin-site-frontend.fullname" . }}
labels:
{{- include "plugin-site-frontend.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.frontend.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "plugin-site.name" . }}-frontend
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "plugin-site-frontend.selectorLabels" . | nindent 6 }}
template:
metadata:
labels: {{ include "plugin-site-frontend.labels" . | nindent 8 }}
labels:
{{- include "plugin-site-frontend.labels" . | nindent 8 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/nginx-configmap.yaml") . | sha256sum }}
spec:
Expand All @@ -25,7 +26,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-frontend
- name: {{ include "plugin-site-frontend.name" .}}
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}"
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
ports:
Expand Down
4 changes: 2 additions & 2 deletions charts/plugin-site/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ spec:
paths:
{{- range $paths }}
- path: {{ .path }}
pathType: Prefix
pathType: {{ .prefix | default "Prefix" }}
backend:
service:
name: {{ $fullName }}
name: {{ printf "%s-%s" $fullName (.svcName | default "frontend") }}
port:
number: {{ int (.svcPort) }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/plugin-site/templates/pdb-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "plugin-site.fullname" . }}-frontend
name: {{ include "plugin-site-frontend.fullname" . }}
labels:
{{- include "plugin-site.labels" . | nindent 4 }}
spec:
Expand Down
15 changes: 15 additions & 0 deletions charts/plugin-site/templates/service-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "plugin-site.fullname" . }}-backend
labels:
{{- include "plugin-site.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- name: backend
protocol: TCP
targetPort: backend
port: {{ .Values.backend.port }}
selector:
{{- include "plugin-site.selectorLabels" . | nindent 4}}
15 changes: 15 additions & 0 deletions charts/plugin-site/templates/service-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "plugin-site-frontend.fullname" . }}
labels:
{{- include "plugin-site-frontend.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- name: frontend
protocol: TCP
targetPort: frontend
port: {{ .Values.frontend.port }}
selector:
{{- include "plugin-site-frontend.selectorLabels" . | nindent 4}}
19 changes: 0 additions & 19 deletions charts/plugin-site/templates/service.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions charts/plugin-site/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ ingress:
- path: /api/(.*)
svcName: backend
svcPort: 8080
prefix: ImplementationSpecific
- path: /(.*)
svcName: frontend
svcPort: 80
prefix: ImplementationSpecific
annotations:
# rewrite target is important to get the path regexes to work
nginx.ingress.kubernetes.io/rewrite-target: /$1
Expand Down