Skip to content

Commit

Permalink
feat: add headless services to keto (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demonsthere authored Nov 28, 2024
1 parent 6cd5d44 commit f9e6a4e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 2 deletions.
2 changes: 2 additions & 0 deletions helm/charts/keto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,15 @@ Access Control Policies as a Server
| service.read.appProtocol | string | `"grpc"` | |
| service.read.clusterIP | string | `""` | |
| service.read.enabled | bool | `true` | |
| service.read.headless.enabled | bool | `true` | |
| service.read.loadBalancerIP | string | `""` | |
| service.read.name | string | `"grpc-read"` | |
| service.read.port | int | `80` | |
| service.read.type | string | `"ClusterIP"` | |
| service.write.appProtocol | string | `"grpc"` | |
| service.write.clusterIP | string | `""` | |
| service.write.enabled | bool | `true` | |
| service.write.headless.enabled | bool | `true` | |
| service.write.loadBalancerIP | string | `""` | |
| service.write.name | string | `"grpc-write"` | |
| service.write.port | int | `80` | |
Expand Down
29 changes: 28 additions & 1 deletion helm/charts/keto/templates/service-read.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.service.read.enabled }}
---
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -30,4 +31,30 @@ spec:
selector:
app.kubernetes.io/name: {{ include "keto.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ end }}
{{- if .Values.service.read.headless.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "keto.fullname" . }}-read-headless
{{- if .Release.Namespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
service.ory.sh/type: headless
app.kubernetes.io/component: read
{{- include "keto.labels" . | nindent 4 }}
spec:
type: "ClusterIP"
clusterIP: "None"
ports:
- port: {{ .Values.keto.config.serve.read.port }}
targetPort: {{ .Values.service.read.name }}
protocol: TCP
name: {{ .Values.service.read.name }}
appProtocol: {{ .Values.service.read.appProtocol }}
selector:
app.kubernetes.io/name: {{ include "keto.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- end }}
28 changes: 27 additions & 1 deletion helm/charts/keto/templates/service-write.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,30 @@ spec:
selector:
app.kubernetes.io/name: {{ include "keto.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ end }}
{{- if .Values.service.write.headless.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "keto.fullname" . }}-write-headless
{{- if .Release.Namespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
service.ory.sh/type: headless
app.kubernetes.io/component: write
{{- include "keto.labels" . | nindent 4 }}
spec:
type: "ClusterIP"
clusterIP: "None"
ports:
- port: {{ .Values.keto.config.serve.write.port }}
targetPort: {{ .Values.service.write.name }}
protocol: TCP
name: {{ .Values.service.write.name }}
appProtocol: {{ .Values.service.write.appProtocol }}
selector:
app.kubernetes.io/name: {{ include "keto.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions helm/charts/keto/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ service:
name: grpc-read
port: 80
appProtocol: grpc
## -- Enable extra headless service
headless:
enabled: true
## -- Write service
write:
enabled: true
Expand All @@ -193,6 +196,9 @@ service:
name: grpc-write
port: 80
appProtocol: grpc
## -- Enable extra headless service
headless:
enabled: true
## -- Metrics service
metrics:
enabled: false
Expand Down

0 comments on commit f9e6a4e

Please sign in to comment.