Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional changes for lima #1555

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions test/drenv/providers/lima/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ provision:
kind: ClusterConfiguration
apiVersion: kubeadm.k8s.io/v1beta3
apiServer:
extraArgs:
advertise-address: "0.0.0.0"
certSANs: # --apiserver-cert-extra-sans
- "127.0.0.1"
networking:
Expand All @@ -148,12 +150,41 @@ provision:
StatefulSetAutoDeletePVC: true
EOF
kubeadm init --config kubeadm-config.yaml
# Installing a Pod network add-on
kubectl apply -f https://github.com/flannel-io/flannel/releases/download/v0.24.0/kube-flannel.yml
# Control plane node isolation
kubectl taint nodes --all node-role.kubernetes.io/control-plane-
# Copy kubeconfig to default location.
mkdir -p ${HOME:-/root}/.kube && cp -f $KUBECONFIG ${HOME:-/root}/.kube/config

# Deploy additional components
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
export KUBECONFIG=/etc/kubernetes/admin.conf

echo "Removing control-plane taint from nodes"
kubectl taint nodes --all node-role.kubernetes.io/control-plane-

echo "Deploying flannel"
flannel=$(mktemp -d /tmp/deploy-flannel.XXXXXX)
cat <<EOF >$flannel/kustomization.yaml
resources:
- https://github.com/flannel-io/flannel/releases/download/v0.24.0/kube-flannel.yml
patches:
- target:
kind: DaemonSet
name: kube-flannel-ds
patch: |-
- op: add
path: /spec/template/spec/containers/0/args/-
value: --iface=lima0
EOF
kubectl apply -k $flannel

# Enable masqueradeAll in kube-proxy.
kubectl get cm -n kube-system kube-proxy -o yaml > kube-proxy.yaml
sed -i 's/masqueradeAll: false/masqueradeAll: true/g' kube-proxy.yaml
kubectl apply -f kube-proxy.yaml
kubectl delete pod -n kube-system -l k8s-app=kube-proxy

- mode: system
script: |
#!/bin/bash
Expand Down