Skip to content

Commit b1ce94a

Browse files
committed
fix: ionscale deployment
1 parent a6769a7 commit b1ce94a

11 files changed

Lines changed: 48 additions & 45 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,19 @@ jobs:
8484
with:
8585
go-version-file: go.mod
8686

87+
- name: Setup Helm
88+
uses: azure/setup-helm@v4
89+
8790
- name: Generate install manifests
8891
run: |
8992
make build-installer IMG=${{ env.REGISTRY }}/${{ steps.image.outputs.name }}:${{ github.ref_name }}
93+
VERSION="${GITHUB_REF_NAME#v}"
94+
helm package dist/chart --destination dist --version "$VERSION" --app-version "$VERSION"
9095
9196
- name: Upload Release Assets
9297
uses: softprops/action-gh-release@v1
9398
with:
9499
files: |
95100
dist/install.yaml
101+
dist/kodiak-*.tgz
96102
generate_release_notes: true

config/ionscale/base/deployment.yaml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ spec:
3333
containerPort: 3478
3434
protocol: UDP
3535
env:
36-
- name: IONSCALE_SYSTEM_ADMIN_KEY
36+
- name: IONSCALE_KEYS_SYSTEM_ADMIN_KEY
3737
valueFrom:
3838
secretKeyRef:
3939
name: ionscale-admin
@@ -49,21 +49,20 @@ spec:
4949
requests:
5050
cpu: 100m
5151
memory: 128Mi
52-
# TODO: Fix probe HTTPS issue with kube-ovn
53-
# livenessProbe:
54-
# httpGet:
55-
# path: /health
56-
# port: 8080
57-
# scheme: HTTP
58-
# initialDelaySeconds: 10
59-
# periodSeconds: 10
60-
# readinessProbe:
61-
# httpGet:
62-
# path: /health
63-
# port: 8080
64-
# scheme: HTTP
65-
# initialDelaySeconds: 5
66-
# periodSeconds: 5
52+
livenessProbe:
53+
httpGet:
54+
path: /version
55+
port: 8080
56+
scheme: HTTP
57+
initialDelaySeconds: 10
58+
periodSeconds: 10
59+
readinessProbe:
60+
httpGet:
61+
path: /version
62+
port: 8080
63+
scheme: HTTP
64+
initialDelaySeconds: 5
65+
periodSeconds: 5
6766
volumes:
6867
- name: config
6968
configMap:

config/ionscale/overlays/postgres/config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ tls:
4040
# =============================================================================
4141
# Keys
4242
# =============================================================================
43-
# Note: For production, override this secret or use Helm chart
43+
# Provided through IONSCALE_KEYS_SYSTEM_ADMIN_KEY from the generated Secret.
4444
keys:
45-
system_admin_key: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
45+
system_admin_key: ""
4646
# control_key: ""
4747
# legacy_control_key: ""
4848

config/ionscale/overlays/sqlite/config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ tls:
4040
# =============================================================================
4141
# Keys
4242
# =============================================================================
43-
# Note: For kustomize deployment, this is replaced by secretGenerator
44-
# For development, use fixed key below
43+
# Provided through IONSCALE_KEYS_SYSTEM_ADMIN_KEY from the generated Secret.
4544
keys:
46-
system_admin_key: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
45+
system_admin_key: ""
4746
# control_key: ""
4847
# legacy_control_key: ""
4948

dist/chart/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: kodiak
33
description: A Helm chart for Kodiak - Kubernetes operator for ionscale/Tailscale VPN management
44
type: application
5-
version: 0.1.0
6-
appVersion: "0.1.0"
5+
version: 0.1.10
6+
appVersion: "0.1.10"
77
keywords:
88
- kubernetes
99
- operator

dist/chart/templates/ionscale/configmap.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ data:
2929
# TLS
3030
tls:
3131
disable: {{ .Values.ionscale.tls.disable }}
32+
force_https: {{ not .Values.ionscale.tls.disable }}
3233
3334
# Keys
3435
keys:
35-
system_admin_key: ${IONSCALE_SYSTEM_ADMIN_KEY}
36+
system_admin_key: ""
3637
3738
# DERP
3839
derp:

dist/chart/templates/ionscale/deployment.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ spec:
1313
{{- include "kodiak.ionscale.selectorLabels" . | nindent 6 }}
1414
template:
1515
metadata:
16+
annotations:
17+
checksum/config: {{ include (print $.Template.BasePath "/ionscale/configmap.yaml") . | sha256sum }}
18+
checksum/secret: {{ include (print $.Template.BasePath "/ionscale/secret.yaml") . | sha256sum }}
1619
labels:
1720
{{- include "kodiak.ionscale.labels" . | nindent 8 }}
1821
spec:
@@ -34,7 +37,7 @@ spec:
3437
containerPort: 3478
3538
protocol: UDP
3639
env:
37-
- name: IONSCALE_SYSTEM_ADMIN_KEY
40+
- name: IONSCALE_KEYS_SYSTEM_ADMIN_KEY
3841
valueFrom:
3942
secretKeyRef:
4043
name: {{ include "kodiak.fullname" . }}-ionscale-admin
@@ -51,14 +54,16 @@ spec:
5154
{{- toYaml .Values.ionscale.resources | nindent 12 }}
5255
livenessProbe:
5356
httpGet:
54-
path: /health
57+
path: /version
5558
port: api
59+
scheme: HTTP
5660
initialDelaySeconds: 10
5761
periodSeconds: 10
5862
readinessProbe:
5963
httpGet:
60-
path: /health
64+
path: /version
6165
port: api
66+
scheme: HTTP
6267
initialDelaySeconds: 5
6368
periodSeconds: 5
6469
volumes:

dist/chart/templates/ionscale/secret.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ data:
1111
{{- if .Values.ionscale.adminKey }}
1212
systemAdminKey: {{ .Values.ionscale.adminKey | b64enc | quote }}
1313
{{- else }}
14+
{{- $secretName := printf "%s-ionscale-admin" (include "kodiak.fullname" .) }}
15+
{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace $secretName }}
16+
{{- if and $existingSecret $existingSecret.data (index $existingSecret.data "systemAdminKey") }}
17+
systemAdminKey: {{ index $existingSecret.data "systemAdminKey" | quote }}
18+
{{- else }}
1419
# Auto-generated admin key (32 bytes hex)
15-
systemAdminKey: {{ randAlphaNum 64 | b64enc | quote }}
20+
systemAdminKey: {{ randAlphaNum 64 | sha256sum | b64enc | quote }}
21+
{{- end }}
1622
{{- end }}
1723
{{- end }}

dist/chart/templates/manager/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ spec:
1414
metadata:
1515
annotations:
1616
kubectl.kubernetes.io/default-container: manager
17+
{{- if .Values.ionscale.enabled }}
18+
checksum/ionscale-secret: {{ include (print $.Template.BasePath "/ionscale/secret.yaml") . | sha256sum }}
19+
{{- end }}
1720
{{- with .Values.controllerManager.pod.annotations }}
1821
{{- toYaml . | nindent 8 }}
1922
{{- end }}

dist/chart/templates/webhook/service.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)