Skip to content

Commit

Permalink
feat(helm-chart): improve ingress, labels and namespace setting (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
evegufy authored Feb 21, 2024
1 parent b4d0d79 commit 1789336
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 17 deletions.
2 changes: 2 additions & 0 deletions charts/policy-hub/templates/configmap-postgres-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ kind: ConfigMap
metadata:
name: {{ .Release.Name }}-phub-cm-postgres
namespace: {{ .Release.Namespace }}
labels:
{{- include "phub.labels" . | nindent 4 }}
data:
02-init-db.sql: |
CREATE SCHEMA hub;
Expand Down
4 changes: 2 additions & 2 deletions charts/policy-hub/templates/deployment-hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "phub.fullname" . }}
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "phub.labels" . | nindent 4 }}
spec:
Expand All @@ -37,7 +37,7 @@ spec:
{{- include "phub.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
- name: {{ include "phub.fullname" . }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
3 changes: 2 additions & 1 deletion charts/policy-hub/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "phub.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
Expand Down Expand Up @@ -73,7 +74,7 @@ spec:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ .backend.port }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/policy-hub/templates/job-policy-hub-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "phub.fullname" . }}-migrations
namespace: {{ .Release.Namespace }}
labels:
{{- include "phub.labels" . | nindent 4 }}
annotations:
"batch.kubernetes.io/job-tracking": "true"
"helm.sh/hook": post-install,post-upgrade
Expand Down
2 changes: 2 additions & 0 deletions charts/policy-hub/templates/secret-external-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ kind: Secret
metadata:
name: {{ .Values.externalDatabase.existingSecret }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "portal.labels" . | nindent 4 }}
type: Opaque
# use lookup function to check if secret exists
{{- $secret := (lookup "v1" "Secret" .Release.Namespace .Values.externalDatabase.existingSecret) }}
Expand Down
2 changes: 2 additions & 0 deletions charts/policy-hub/templates/secret-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ kind: Secret
metadata:
name: {{ $secretName }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "phub.labels" . | nindent 4 }}
type: Opaque
# use lookup function to check if secret exists
{{- $secret := (lookup "v1" "Secret" .Release.Namespace $secretName) }}
Expand Down
2 changes: 1 addition & 1 deletion charts/policy-hub/templates/service-hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "phub.fullname" . }}
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "phub.labels" . | nindent 4 }}
spec:
Expand Down
5 changes: 2 additions & 3 deletions charts/policy-hub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ingress:
# -- Policy Hub ingress parameters,
# enable ingress record generation for policy-hub.
enabled: false
name: "policy-hub"
className: "nginx"
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
Expand All @@ -44,9 +43,9 @@ ingress:
paths:
- path: "/api/policy-hub"
pathType: "Prefix"
backend:
port: 8080

dotnetEnvironment: "Production"

dbConnection:
schema: "hub"
sslMode: "Disable"
Expand Down
2 changes: 0 additions & 2 deletions consortia/environments/values-beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ ingress:
paths:
- path: "/api/policy-hub"
pathType: "Prefix"
backend:
port: 8080

policyhub:
swaggerEnabled: true
Expand Down
2 changes: 0 additions & 2 deletions consortia/environments/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ ingress:
paths:
- path: "/api/policy-hub"
pathType: "Prefix"
backend:
port: 8080

keycloak:
central:
Expand Down
2 changes: 0 additions & 2 deletions consortia/environments/values-int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ ingress:
paths:
- path: "/api/policy-hub"
pathType: "Prefix"
backend:
port: 8080

keycloak:
central:
Expand Down
2 changes: 0 additions & 2 deletions consortia/environments/values-pen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ ingress:
paths:
- path: "/api/policy-hub"
pathType: "Prefix"
backend:
port: 8080

policyhub:
swaggerEnabled: true
Expand Down
2 changes: 0 additions & 2 deletions consortia/environments/values-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ ingress:
paths:
- path: "/api/policy-hub"
pathType: "Prefix"
backend:
port: 8080

policyhub:
image: "docker.io/tractusx/policy-hub-service:rc"
Expand Down

0 comments on commit 1789336

Please # to comment.