File tree Expand file tree Collapse file tree 1 file changed +7
-20
lines changed
Expand file tree Collapse file tree 1 file changed +7
-20
lines changed Original file line number Diff line number Diff line change @@ -46,27 +46,14 @@ jobs:
4646 export KUBECONFIG=/home/runner/.kube/config
4747 timeout 90 bash -c 'until sudo k3s kubectl cluster-info; do sleep 5; done'
4848
49- - name : Create kubeconfig for CI
49+ - name : Create kubeconfig for CI Docker containers
5050 run : |
51- cat > backend/kubeconfig.yaml <<EOF
52- apiVersion: v1
53- kind: Config
54- clusters:
55- - name: ci-cluster
56- cluster:
57- server: https://host.docker.internal:6443
58- insecure-skip-tls-verify: true
59- users:
60- - name: ci-user
61- user:
62- token: "ci-token"
63- contexts:
64- - name: ci
65- context:
66- cluster: ci-cluster
67- user: ci-user
68- current-context: ci
69- EOF
51+ # Copy real k3s kubeconfig with valid credentials, but change server address
52+ # from 127.0.0.1 to host.docker.internal for Docker container networking
53+ # (k3s was started with --tls-san host.docker.internal so the cert is valid)
54+ sed 's|https://127.0.0.1:6443|https://host.docker.internal:6443|g' \
55+ /home/runner/.kube/config > backend/kubeconfig.yaml
56+ chmod 644 backend/kubeconfig.yaml
7057
7158 - name : Setup CI Compose
7259 uses : ./.github/actions/setup-ci-compose
You can’t perform that action at this time.
0 commit comments