Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit c4d9dfb

Browse files
committed
Generate CA on the fly
1 parent 380bd5d commit c4d9dfb

File tree

5 files changed

+29
-79
lines changed

5 files changed

+29
-79
lines changed

action.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,42 @@ runs:
2727
repository: jumpstarter-dev/jumpstarter
2828
ref: ${{ inputs.jumpstarter-ref }}
2929
path: jumpstarter
30-
- name: Deploy jumpstarter controller
30+
- name: Deploy dex
3131
shell: bash
3232
run: |
33-
cp "$GITHUB_ACTION_PATH"/values.kind.yaml ./controller/deploy/helm/jumpstarter/values.kind.yaml
33+
sudo apt-get update
34+
sudo apt-get install -y easy-rsa
35+
36+
export EASYRSA_BATCH=1
37+
export EASYRSA_PKI=pki
38+
/usr/share/easy-rsa/easyrsa init-pki
39+
/usr/share/easy-rsa/easyrsa --no-pass build-ca
40+
/usr/share/easy-rsa/easyrsa --no-pass build-server-full dex.dex.svc.cluster.local
41+
3442
cp "$GITHUB_ACTION_PATH"/kind_cluster.yaml ./controller/hack/kind_cluster.yaml
35-
make -C controller deploy
43+
make -C controller cluster
44+
45+
kubectl create namespace dex
46+
kubectl -n dex create secret tls dex-tls \
47+
--cert=pki/issued/dex.dex.svc.cluster.local.crt \
48+
--key=pki/private/dex.dex.svc.cluster.local.key
49+
50+
go run github.com/mikefarah/yq/v4@latest -i \
51+
'.jumpstarter-controller.authenticationConfig = (.jumpstarter-controller.authenticationConfig | from_yaml | .jwt[0].issuer.certificateAuthority = load_str("pki/ca.crt") | to_yaml)' \
52+
"$GITHUB_ACTION_PATH"/values.kind.yaml
53+
3654
# important!
3755
kubectl create clusterrolebinding oidc-reviewer \
3856
--clusterrole=system:service-account-issuer-discovery \
3957
--group=system:unauthenticated
40-
- name: Deploy dex
41-
shell: bash
42-
run: |
43-
kubectl create namespace dex
44-
kubectl apply -f "$GITHUB_ACTION_PATH"/dex.yaml
58+
4559
helm repo add dex https://charts.dexidp.io
4660
helm install --namespace dex --wait -f "$GITHUB_ACTION_PATH"/dex.values.yaml dex dex/dex
61+
- name: Deploy jumpstarter controller
62+
shell: bash
63+
run: |
64+
cp "$GITHUB_ACTION_PATH"/values.kind.yaml ./controller/deploy/helm/jumpstarter/values.kind.yaml
65+
make -C controller deploy
4766
- name: Install jumpstarter
4867
shell: bash
4968
run: |
@@ -56,7 +75,7 @@ runs:
5675
- name: Run jumpstarter
5776
shell: bash
5877
run: |
59-
sudo cp "$GITHUB_ACTION_PATH"/minica.pem /usr/local/share/ca-certificates/minica.crt
78+
sudo cp pki/ca.crt /usr/local/share/ca-certificates/ca.crt
6079
sudo update-ca-certificates
6180
6281
echo "127.0.0.1 dex.dex.svc.cluster.local" | sudo tee -a /etc/hosts

dex.yaml

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

minica-key.pem

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

minica.pem

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

values.kind.yaml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,12 @@ jumpstarter-controller:
1010
apiVersion: jumpstarter.dev/v1alpha1
1111
kind: AuthenticationConfiguration
1212
jwt:
13-
- issuer:
14-
url: https://kubernetes.default.svc.cluster.local
15-
audiences:
16-
- https://kubernetes.default.svc.cluster.local
17-
audienceMatchPolicy: MatchAny
18-
claimMappings:
19-
username:
20-
claim: "sub"
21-
prefix: "kubernetes:"
2213
- issuer:
2314
url: https://dex.dex.svc.cluster.local:5556
2415
audiences:
2516
- jumpstarter-cli
2617
audienceMatchPolicy: MatchAny
27-
certificateAuthority: |
28-
-----BEGIN CERTIFICATE-----
29-
MIIB/DCCAYKgAwIBAgIIcpC2uS+SjEIwCgYIKoZIzj0EAwMwIDEeMBwGA1UEAxMV
30-
bWluaWNhIHJvb3QgY2EgNzI5MGI2MCAXDTI1MDIwMzE5MzMyNVoYDzIxMjUwMjAz
31-
MTkzMzI1WjAgMR4wHAYDVQQDExVtaW5pY2Egcm9vdCBjYSA3MjkwYjYwdjAQBgcq
32-
hkjOPQIBBgUrgQQAIgNiAAQzezKJ4My35HPeoJvvzTjhS2uJMBYrYfrs5csxZjiy
33-
q8ORrHM539XhWlA6sVZODhzcF2KL4mC9xKz/yIrsws+LKsIWNHGGmIPEKFYnHBGw
34-
VBGeARvhpzZP/9frJXAN/8ejgYYwgYMwDgYDVR0PAQH/BAQDAgKEMB0GA1UdJQQW
35-
MBQGCCsGAQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1Ud
36-
DgQWBBSZRBCUuP3ta2xsfjnWIjvgvz4fojAfBgNVHSMEGDAWgBSZRBCUuP3ta2xs
37-
fjnWIjvgvz4fojAKBggqhkjOPQQDAwNoADBlAjADql5Ks5wh181iUa1ZBnx4XOVe
38-
l0l7I+mwlwJSPmkZHxruWZTx7gQU4tfDCr+UuzUCMQC2aDXRb17cphipK4gzbExv
39-
EDLExjhHAqMPrKDmT0jHIi7Bbos38/1tyZ/IoKjLnv0=
40-
-----END CERTIFICATE-----
18+
certificateAuthority: placeholder
4119
claimMappings:
4220
username:
4321
claim: "name"

0 commit comments

Comments
 (0)