Skip to content

Commit 2a56edf

Browse files
committed
Separate distributed chart
1 parent 36f6e08 commit 2a56edf

29 files changed

+2568
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/
23+
*.txt
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dependencies:
2+
- name: ory-commons
3+
repository: file://../ory-commons
4+
version: 0.1.0
5+
- name: hydra-maester
6+
repository: file://../hydra-maester
7+
version: 0.50.3
8+
digest: sha256:18facc7a0739ed1f51746992bbeced44d84b8e0727b89b33f48dad914f4ecebb
9+
generated: "2024-12-04T11:40:27.919030591Z"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: v2
2+
appVersion: "v2.2.0"
3+
description: A Helm chart for deploying ORY Hydra in Kubernetes with a distributed layout.
4+
name: hydra
5+
icon: https://raw.githubusercontent.com/ory/docs/master/docs/static/img/logo-hydra.svg
6+
version: 0.50.3
7+
keywords:
8+
- oauth2
9+
- openid-connect
10+
- openid
11+
- oidc
12+
- op
13+
- api-security
14+
- security
15+
home: https://www.ory.sh/
16+
sources:
17+
- https://github.com/ory/hydra
18+
- https://github.com/ory/k8s
19+
maintainers: # (optional)
20+
- name: ORY Team
21+
22+
url: https://www.ory.sh/
23+
type: application
24+
dependencies:
25+
- name: ory-commons
26+
version: 0.1.0
27+
repository: file://../ory-commons
28+
alias: ory
29+
- name: hydra-maester
30+
version: 0.50.3
31+
condition: maester.enabled
32+
alias: hydra-maester
33+
repository: file://../hydra-maester

helm/charts/hydra-distributed/README.md

Lines changed: 209 additions & 0 deletions
Large diffs are not rendered by default.
7.7 KB
Binary file not shown.
687 Bytes
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set -Eeuo pipefail
2+
set -x
3+
4+
function rollOut() {
5+
DEPLOY=$(kubectl get deploy -n "${NAMESPACE}" -l "${1}" -o name)
6+
kubectl set env -n $NAMESPACE ${DEPLOY} sync=$(date "+%Y%m%d-%H%M%S")
7+
kubectl rollout status -n $NAMESPACE ${DEPLOY}
8+
}
9+
10+
while true; do
11+
# After change in the CM the symlink is recreated, so we need to restart the monitor
12+
inotifywait --event DELETE_SELF "${WATCH_FILE}" |
13+
while read path _ file; do
14+
echo "---> $path$file modified"
15+
rollOut "${LABEL_SELECTOR}"
16+
done
17+
done
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{{ include "hydra.check.override.consistency" . }}
2+
The ORY Hydra HTTP Public API is available via:
3+
{{- if .Values.ingress.public.enabled }}
4+
{{- range $host := .Values.ingress.public.hosts }}
5+
{{- range .paths }}
6+
http{{ if $.Values.ingress.public.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
7+
{{- end }}
8+
{{- end }}
9+
{{- else if contains "NodePort" .Values.service.public.type }}
10+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "hydra.fullname" . }})
11+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
12+
export HYDRA_PUBLIC_URL=http://$NODE_IP:$NODE_PORT
13+
curl $HYDRA_PUBLIC_URL/.well-known/openid-configuration
14+
15+
If you have the ORY Hydra CLI installed locally, you can run commands
16+
against this endpoint:
17+
18+
hydra token client \
19+
--endpoint $HYDRA_PUBLIC_URL \
20+
# ...
21+
22+
{{- else if contains "LoadBalancer" .Values.service.public.type }}
23+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
24+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "hydra.fullname" . }}'
25+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "hydra.fullname" . }}-public -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
26+
export HYDRA_PUBLIC_URL=http://$SERVICE_IP:{{ .Values.service.public.port }}
27+
curl $HYDRA_PUBLIC_URL/.well-known/openid-configuration
28+
29+
If you have the ORY Hydra CLI installed locally, you can run commands
30+
against this endpoint:
31+
32+
hydra token client \
33+
--endpoint $HYDRA_PUBLIC_URL \
34+
# ...
35+
36+
{{- else if contains "ClusterIP" .Values.service.public.type }}
37+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "hydra.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
38+
echo "Visit http://127.0.0.1:{{ .Values.service.public.port }} to use your application"
39+
kubectl port-forward $POD_NAME {{ .Values.service.public.port }}:{{ .Values.hydra.config.serve.public.port }}
40+
export HYDRA_PUBLIC_URL=http://127.0.0.1:{{ .Values.service.public.port }}/
41+
curl $HYDRA_PUBLIC_URL/.well-known/openid-configuration
42+
43+
If you have the ORY Hydra CLI installed locally, you can run commands
44+
against this endpoint:
45+
46+
hydra token client \
47+
--endpoint $HYDRA_PUBLIC_URL \
48+
# ...
49+
50+
{{- end }}
51+
52+
The ORY Hydra HTTP Admin API is available via:
53+
{{- if .Values.ingress.admin.enabled }}
54+
{{- range $host := .Values.ingress.admin.hosts }}
55+
{{- range .paths }}
56+
http{{ if $.Values.ingress.admin.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
57+
{{- end }}
58+
{{- end }}
59+
{{- else if contains "NodePort" .Values.service.admin.type }}
60+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "hydra.fullname" . }})
61+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
62+
export HYDRA_ADMIN_URL=http://$NODE_IP:$NODE_PORT
63+
curl $HYDRA_ADMIN_URL/clients
64+
65+
If you have the ORY Hydra CLI installed locally, you can run commands
66+
against this endpoint:
67+
68+
hydra clients list \
69+
--endpoint $HYDRA_ADMIN_URL
70+
71+
{{- else if contains "LoadBalancer" .Values.service.admin.type }}
72+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
73+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "hydra.fullname" . }}'
74+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "hydra.fullname" . }}-admin -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
75+
export HYDRA_ADMIN_URL=http://$SERVICE_IP:{{ .Values.service.admin.port }}
76+
curl $HYDRA_ADMIN_URL/clients
77+
78+
If you have the ORY Hydra CLI installed locally, you can run commands
79+
against this endpoint:
80+
81+
hydra clients list \
82+
--endpoint $HYDRA_ADMIN_URL
83+
84+
{{- else if contains "ClusterIP" .Values.service.admin.type }}
85+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "hydra.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
86+
echo "Visit http://127.0.0.1:{{ .Values.service.admin.port }} to use your application"
87+
kubectl port-forward $POD_NAME {{ .Values.service.admin.port }}:{{ .Values.hydra.config.serve.admin.port }}
88+
export HYDRA_ADMIN_URL=http://127.0.0.1:{{ .Values.service.admin.port }}/
89+
curl $HYDRA_ADMIN_URL/clients
90+
91+
If you have the ORY Hydra CLI installed locally, you can run commands
92+
against this endpoint:
93+
94+
hydra clients list \
95+
--endpoint $HYDRA_ADMIN_URL
96+
97+
{{- end }}

0 commit comments

Comments
 (0)