Skip to content

Commit

Permalink
feat: allow for extra services and port (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demonsthere committed Oct 13, 2022
1 parent c005ca2 commit b6a5776
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 5 deletions.
11 changes: 11 additions & 0 deletions hacks/values/keto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ deployment:
- name: test-volume
configMap:
name: cm-sample
extraPorts:
- name: grpc-opl
containerPort: 4469
protocol: TCP
job:
extraInitContainers: |
- name: "hello-world"
Expand All @@ -58,6 +62,13 @@ service:
metrics:
enabled: true

extraServices:
opl:
enabled: true
type: ClusterIP
name: grpc-opl
port: 80

watcher:
enabled: true
mountFile: "/testdir/sample.txt"
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/keto/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ version: 0.25.5
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "v0.8.0-alpha.2"
appVersion: "v0.10.0"
3 changes: 3 additions & 0 deletions helm/charts/keto/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ spec:
- name: {{ .Values.service.metrics.name }}
containerPort: {{ .Values.keto.config.serve.metrics.port }}
protocol: TCP
{{- with .Values.deployment.extraPorts }}
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
httpGet:
path: /health/alive
Expand Down
27 changes: 27 additions & 0 deletions helm/charts/keto/templates/service-extraServices.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- range $ServiceName, $ServiceData := .Values.extraServices }}

{{- if $ServiceData.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "keto.fullname" $ }}-{{ $ServiceName }}
{{- if $.Release.Namespace }}
namespace: {{ $.Release.Namespace }}
{{- end }}
labels:
app.kubernetes.io/component: {{ $ServiceName }}
{{- include "keto.labels" $ | nindent 4 }}
spec:
type: {{ $ServiceData.type }}
ports:
- port: {{ $ServiceData.port }}
targetPort: {{ $ServiceData.name }}
protocol: TCP
name: {{ $ServiceData.name }}
selector:
app.kubernetes.io/name: {{ include "keto.name" $ }}
app.kubernetes.io/instance: {{ $.Release.Name }}
{{- end }}

{{- end }}
2 changes: 1 addition & 1 deletion helm/charts/keto/templates/service-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
{{- end }}
labels:
app.kubernetes.io/component: metrics
{{ include "keto.labels" . | indent 4 }}
{{- include "keto.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.metrics.type }}
ports:
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/keto/templates/service-read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
{{- end }}
labels:
app.kubernetes.io/component: read
{{ include "keto.labels" . | indent 4 }}
{{- include "keto.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.read.type }}
ports:
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/keto/templates/service-write.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
{{- end }}
labels:
app.kubernetes.io/component: write
{{ include "keto.labels" . | indent 4 }}
{{- include "keto.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.write.type }}
ports:
Expand Down
8 changes: 7 additions & 1 deletion helm/charts/keto/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ image:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
# -- Ory KETO version
tag: "v0.8.0-alpha.2"
tag: "v0.10.0"

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -159,6 +159,9 @@ service:
port: 80
annotations: {}

# -- Extra services to be deployed
extraServices: {}

# -- Secret management
secret:
# -- Switch to false to prevent creating the secret
Expand Down Expand Up @@ -297,6 +300,9 @@ deployment:
# my.special.label/type: value
extraLabels: {}

# -- Extra ports to be exposed by the main deployment
extraPorts: []

tolerations: []

affinity: {}
Expand Down

0 comments on commit b6a5776

Please sign in to comment.