-
Notifications
You must be signed in to change notification settings - Fork 3
update helm charts #82
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
Changes from 2 commits
744e82d
4a36668
f73de44
35e4c03
6119852
2f58eee
a303488
2f0bb23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,11 +61,17 @@ spec: | |
| value: {{ .Values.headscale.config.unix_socket | quote }} | ||
| {{- if .Values.keycloak.enabled }} | ||
| - name: KEYCLOAK_URL | ||
| # If Keycloak is enabled in chart, point to the internal service. | ||
| # Note: For OIDC browser flow to work, this internal URL must be reachable by browser too (e.g. tunneling/VPN), | ||
| # OR the user must manually set coordinator.oidc.url to a public URL and keycloak.service.type/Ingress accordingly. | ||
| # Here we default to the service DNS for backend communication. | ||
| {{- if .Values.keycloak.ingress.enabled }} | ||
| {{- if .Values.keycloak.ingress.tls }} | ||
| value: "https://{{ .Values.keycloak.ingress.host }}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
| {{- else }} | ||
| value: "http://{{ .Values.keycloak.ingress.host }}" | ||
| {{- end }} | ||
STRRL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {{- else }} | ||
| # Keycloak ingress not enabled, using internal service URL. | ||
| # Note: For OIDC browser flow to work, enable keycloak.ingress or use port-forwarding/VPN. | ||
| value: "http://{{ include "wonder-mesh-net.fullname" . }}-keycloak:{{ .Values.keycloak.service.port }}" | ||
| {{- end }} | ||
| - name: KEYCLOAK_REALM | ||
| value: {{ .Values.coordinator.oidc.realm | quote }} | ||
| - name: KEYCLOAK_CLIENT_ID | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||||||||||||||||||||||||||
| {{- if and .Values.keycloak.enabled .Values.keycloak.ingress.enabled -}} | ||||||||||||||||||||||||||||||
| {{- $fullName := include "wonder-mesh-net.fullname" . -}} | ||||||||||||||||||||||||||||||
| {{- $svcPort := .Values.keycloak.service.port -}} | ||||||||||||||||||||||||||||||
| apiVersion: networking.k8s.io/v1 | ||||||||||||||||||||||||||||||
| kind: Ingress | ||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||
| name: {{ $fullName }}-keycloak | ||||||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||||||
| {{- include "wonder-mesh-net.labels" . | nindent 4 }} | ||||||||||||||||||||||||||||||
| app.kubernetes.io/component: keycloak | ||||||||||||||||||||||||||||||
| {{- with .Values.keycloak.ingress.annotations }} | ||||||||||||||||||||||||||||||
| annotations: | ||||||||||||||||||||||||||||||
| {{- toYaml . | nindent 4 }} | ||||||||||||||||||||||||||||||
| {{- end }} | ||||||||||||||||||||||||||||||
| spec: | ||||||||||||||||||||||||||||||
| {{- if .Values.keycloak.ingress.className }} | ||||||||||||||||||||||||||||||
| ingressClassName: {{ .Values.keycloak.ingress.className }} | ||||||||||||||||||||||||||||||
| {{- end }} | ||||||||||||||||||||||||||||||
| {{- if .Values.keycloak.ingress.tls }} | ||||||||||||||||||||||||||||||
| tls: | ||||||||||||||||||||||||||||||
| - hosts: | ||||||||||||||||||||||||||||||
| - {{ .Values.keycloak.ingress.host | quote }} | ||||||||||||||||||||||||||||||
| secretName: {{ .Values.keycloak.ingress.tls.secretName }} | ||||||||||||||||||||||||||||||
STRRL marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||
| {{- end }} | ||||||||||||||||||||||||||||||
|
Comment on lines
+19
to
+24
|
||||||||||||||||||||||||||||||
| {{- if .Values.keycloak.ingress.tls.secretName }} | |
| tls: | |
| - hosts: | |
| - {{ .Values.keycloak.ingress.host | quote }} | |
| secretName: {{ .Values.keycloak.ingress.tls.secretName }} | |
| {{- end }} | |
| {{- with .Values.keycloak.ingress.tls }} | |
| {{- if .secretName }} | |
| tls: | |
| - hosts: | |
| - {{ $.Values.keycloak.ingress.host | quote }} | |
| secretName: {{ .secretName }} | |
| {{- end }} | |
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -443,10 +443,20 @@ func (s *Server) Run() error { | |
|
|
||
| slog.Info("initializing ACL policy") | ||
| ctx := context.Background() | ||
| if err := s.wonderNetService.InitializeACLPolicy(ctx); err != nil { | ||
| slog.Warn("initialize ACL policy", "error", err) | ||
| } else { | ||
| var aclErr error | ||
| for i := 0; i < 10; i++ { | ||
| if err := s.wonderNetService.InitializeACLPolicy(ctx); err != nil { | ||
| aclErr = err | ||
| slog.Warn("initialize ACL policy, retrying", "error", err, "attempt", i+1) | ||
| time.Sleep(time.Duration(i+1) * time.Second) | ||
| continue | ||
| } | ||
| slog.Info("ACL policy initialized successfully") | ||
| aclErr = nil | ||
| break | ||
| } | ||
|
Comment on lines
+447
to
+457
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This retry loop can block the server startup for up to 55 seconds. If the coordinator is running in Kubernetes, this might cause liveness or readiness probes to fail and restart the pod before it can successfully initialize. Consider using a shorter total timeout or ensuring that health checks can still pass during this initialization phase. |
||
| if aclErr != nil { | ||
| slog.Error("initialize ACL policy, giving up after retries", "error", aclErr) | ||
| } | ||
|
|
||
| httpServer := &http.Server{ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Helm templates, the
defaultfunction treatsfalseas an empty value. If.Values.keycloak.identityProviders[].enabledis explicitly set tofalse, it will be overridden bytrue. Since the schema already provides a default value oftrue, you can safely remove| default trueor use a conditional check like{{ if hasKey $idp "enabled" }}{{ $idp.enabled }}{{ else }}true{{ end }}.