Skip to content

Commit

Permalink
Allow the API server to be accessed from the host on the published port
Browse files Browse the repository at this point in the history
even on podman with rootlesskit.

Related to containers/podman#24045.
  • Loading branch information
Jan Pazdziora committed Sep 24, 2024
1 parent 29809c5 commit 51af61e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/run-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
if: matrix.style == 'rootless'
- name: Use podman ${{ matrix.inner-podman-version }} in the container
run: sed -i 's%^FROM quay\.io/podman/stable.*%FROM quay.io/podman/stable:${{ matrix.inner-podman-version }}%' Dockerfile
- name: Allow the API server to be accessed from the host
run: sed -i 's/# apiServerAddress:/apiServerAddress:/' kind-cluster*.yaml
- name: Build image
run: $podman build -t localhost/kind .
- name: Create a volume
Expand All @@ -62,6 +64,7 @@ jobs:
- run: $podman exec -ti kind kubectl wait --for=condition=ready -n kube-system pod/etcd-kind-control-plane pod/kube-apiserver-kind-control-plane --timeout=60s
- run: $podman exec kind kubectl get all -A
- run: $podman exec kind curl -k https://127.0.0.1:6443/
- run: curl --cacert <( $podman exec kind bash -c 'cat $KUBECONFIG' | awk '/certificate-authority-data:/ { print $2 }' | base64 -d ) https://127.0.0.1:6443/
- run: $podman rm -f kind
- run: $podman run -d --privileged --read-only --name kind -v kind-data:/var/lib/containers $podman_run_opts -p 6443:6443 localhost/kind
- run: $podman exec -ti kind podman start --all
Expand Down
10 changes: 10 additions & 0 deletions kind-cluster-rootless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ nodes:
feature-gates: KubeletInUserNamespace=true
networking:
apiServerPort: 6443
# apiServerAddress: 0.0.0.0
# When the 0.0.0.0 is uncommented, we still want to have 127.0.0.1 in the certificate
kubeadmConfigPatchesJSON6902:
- group: kubeadm.k8s.io
version: v1beta3
kind: ClusterConfiguration
patch: |
- op: add
path: /apiServer/certSANs/-
value: 127.0.0.1
10 changes: 10 additions & 0 deletions kind-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ nodes:
- role: control-plane
networking:
apiServerPort: 6443
# apiServerAddress: 0.0.0.0
# When the 0.0.0.0 is uncommented, we still want to have 127.0.0.1 in the certificate
kubeadmConfigPatchesJSON6902:
- group: kubeadm.k8s.io
version: v1beta3
kind: ClusterConfiguration
patch: |
- op: add
path: /apiServer/certSANs/-
value: 127.0.0.1

0 comments on commit 51af61e

Please sign in to comment.