Skip to content

Commit ca69991

Browse files
committed
always add wildcard dnsZone to ingresses when they're enabled
1 parent bb3e388 commit ca69991

File tree

4 files changed

+54
-26
lines changed

4 files changed

+54
-26
lines changed

.github/workflows/miniziti.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@ jobs:
1919
miniziti:
2020
runs-on: ubuntu-latest
2121
name: deploy to minikube
22+
env:
23+
ZITI_NAMESPACE: miniziti
2224
steps:
2325
- name: Checkout workspace
2426
uses: actions/checkout@v3
2527

2628
- name: Start minikube
2729
uses: medyagh/setup-minikube@v0.0.14
2830
with:
29-
start-args: --profile miniziti
31+
start-args: --profile ${{ env.ZITI_NAMESPACE }}
3032

3133
- name: Find minikube IP address
3234
id: minikube_ip
33-
run: echo "minikube_ip=$(minikube --profile miniziti ip)" >> $GITHUB_OUTPUT
35+
run: echo "minikube_ip=$(minikube --profile ${ZITI_NAMESPACE} ip)" >> $GITHUB_OUTPUT
3436

3537
- name: install ziti cli
3638
uses: supplypike/setup-bin@v3
@@ -65,13 +67,13 @@ jobs:
6567
- name: Enroll client identity
6668
run: >
6769
ziti edge enroll
68-
--jwt ~/.local/state/miniziti/profiles/miniziti/identities/miniziti-client.jwt
69-
--out ~/.local/state/miniziti/profiles/miniziti/identities/miniziti-client.json
70+
--jwt ~/.local/state/miniziti/profiles/${ZITI_NAMESPACE}/identities/${ZITI_NAMESPACE}-client.jwt
71+
--out ~/.local/state/miniziti/profiles/${ZITI_NAMESPACE}/identities/${ZITI_NAMESPACE}-client.json
7072
7173
- name: Run client proxy
7274
run: >
7375
nohup ziti tunnel proxy "httpbin-service:4321"
74-
--identity ~/.local/state/miniziti/profiles/miniziti/identities/miniziti-client.json
76+
--identity ~/.local/state/miniziti/profiles/${ZITI_NAMESPACE}/identities/${ZITI_NAMESPACE}-client.json
7577
--verbose </dev/null &>/tmp/miniziti-client.log &
7678
7779
- name: Wait for proxy to serve the httpbin service
@@ -97,28 +99,38 @@ jobs:
9799
# helm dependency build ./charts/zrok
98100
- name: Install zrok chart
99101
shell: bash
102+
env:
103+
ZITI_MGMT_API_HOST: ziti-controller-client.${{ env.ZITI_NAMESPACE }}.svc.cluster.local
104+
ZITI_PWD: ${{ steps.get_ziti_pwd.outputs.ZITI_PWD }}
105+
ZROK_ZONE: zrok.${{ steps.minikube_ip.outputs.minikube_ip }}.sslip.io
100106
run: |
101107
helm upgrade \
102108
--install \
103109
--namespace zrok --create-namespace \
104110
--values ./charts/zrok/values-ingress-nginx.yaml \
105-
--set ziti.advertisedHost=ziti-controller-client.miniziti.svc.cluster.local \
106-
--set ziti.password="${{ steps.get_ziti_pwd.outputs.ZITI_PWD }}" \
107-
--set controller.ingress.hosts[0]=ctrl.zrok.${{ steps.minikube_ip.outputs.minikube_ip }}.sslip.io \
108-
--set frontend.ingress.hosts[0]=share.zrok.${{ steps.minikube_ip.outputs.minikube_ip }}.sslip.io \
111+
--set "ziti.advertisedHost=${ZITI_MGMT_API_HOST}" \
112+
--set "ziti.password=${ZITI_PWD}" \
113+
--set "dnsZone=${ZROK_ZONE}" \
114+
--set "controller.ingress.hosts[0]=ctrl.${ZROK_ZONE} \
115+
--set "frontend.ingress.hosts[0]=*.${ZROK_ZONE}" \
109116
zrok ./charts/zrok
110117
111118
- name: Wait for the zrok API to become available
112119
uses: iFaxity/wait-on-action@v1
113120
with:
114121
resource: http-get://ctrl.zrok.${{ steps.minikube_ip.outputs.minikube_ip }}.sslip.io/api/v1/version
115-
delay: 1000
116-
interval: 1000
117-
timeout: 20000
122+
delay: 3000
123+
interval: 3000
124+
timeout: 30000
118125
verbose: true
119126

120-
- name: Print the proxy log
127+
- name: Print debug info
121128
if: always()
129+
shell: bash
122130
run: |
131+
set +e
132+
set -x
123133
miniziti kubectl get pods -A
134+
miniziti kubectl get services -A
135+
miniziti kubectl get ingresses -A
124136
cat /tmp/miniziti-client.log

charts/zrok/templates/controller-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ spec:
4343
paths:
4444
- path: /
4545
{{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
46-
pathType: ImplementationSpecific
46+
pathType: Prefix
4747
{{- end }}
4848
backend:
4949
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}

charts/zrok/templates/frontend-ingress.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,40 @@ spec:
2828
{{- end }}
2929
{{- if .Values.frontend.ingress.tls }}
3030
tls:
31-
{{- range .Values.frontend.ingress.tls }}
3231
- hosts:
32+
- "*.{{ .Values.dnZone }}"
33+
{{- range .Values.frontend.ingress.tls }}
3334
{{- range .hosts }}
3435
- {{ . | quote }}
3536
{{- end }}
3637
secretName: {{ .secretName }}
3738
{{- end }}
3839
{{- end }}
3940
rules:
41+
- host: "*.{{ .Values.dnZone }}"
42+
http:
43+
paths:
44+
- path: /
45+
{{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
46+
pathType: Prefix
47+
{{- end }}
48+
backend:
49+
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
50+
service:
51+
name: {{ $fullName }}
52+
port:
53+
number: {{ $svcPort }}
54+
{{- else }}
55+
serviceName: {{ $fullName }}
56+
servicePort: {{ $svcPort }}
57+
{{- end }}
4058
{{- range .Values.frontend.ingress.hosts }}
4159
- host: {{ . | quote }}
4260
http:
4361
paths:
4462
- path: /
4563
{{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
46-
pathType: ImplementationSpecific
64+
pathType: Prefix
4765
{{- end }}
4866
backend:
4967
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}

charts/zrok/values.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,17 @@ frontend:
200200
className: ""
201201
# -- The annotations to use for the frontend's ingress resource
202202
annotations: {}
203-
# kubernetes.io/ingress.class: nginx
204-
# kubernetes.io/tls-acme: "true"
205-
# -- The hostnames to use for the frontend's ingress resource
206-
hosts:
207-
- host: chart-example.local
208-
paths:
209-
- path: /
210-
pathType: ImplementationSpecific
203+
# cert-manager.io/cluster-issuer: my-cluster-issuer-with-a-dns-challenge-solver-for-the-zrok-zone
204+
# -- *.{{ .Values.dnsZone }} is always set when ingress enabled; specify optional, additional wildcard hostnames to
205+
# use for the frontend's ingress resource
206+
hosts: []
211207
# -- The TLS configuration for the frontend's ingress resource
212208
tls: []
213-
# - secretName: chart-example-tls
209+
# - secretName: name-of-k8s-secret-where-cert-manager-provides-cert-and-key
210+
# # -- *.{{ .Values.dnsZone }} is always set when ingress tls is enabled; specify optional, additional wildcard
211+
# # hostnames to obtain TLS certificates for
214212
# hosts:
215-
# - chart-example.local
213+
# - *.zrok.example.com
216214
# -- a read-only mountpoint for the frontend's Ziti identity is "homeDir"
217215
# because zrok always looks in $HOME/.zrok/identities
218216
homeDir: /var/lib/zrok

0 commit comments

Comments
 (0)