Skip to content

Commit 5e17f9b

Browse files
committed
local act ci and github actions working
1 parent 7505b5b commit 5e17f9b

File tree

3 files changed

+25
-29
lines changed

3 files changed

+25
-29
lines changed

.github/workflows/kind.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@ jobs:
3131
env:
3232
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
ACTIONS_STEP_DEBUG: true
34+
ACTIONS_STEP_DEBUG: false
3535
KUBECONFIG: .kube/config
3636
KINDCONFIG: ./hack/kind.yaml
3737
run: |
3838
set -ex;
3939
direnv allow
4040
make kind-cluster
41-
sudo kind create cluster -v7 --wait 1m --retain --config=$KINDCONFIG
42-
sudo kind get kubeconfig --name kind | tee $KUBECONFIG
43-
sudo chown -R $(id -u):$(id -g) $KUBECONFIG
4441
4542
# - id: wait-kind-ready
4643
# name: Wait for Kind Kubernetes API to be Ready

Makefile

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -139,33 +139,30 @@ talos: clean-all talos-cluster talos-ready wait-all-pods
139139

140140
# --- Kind Cluster ---
141141
kind-cluster:
142-
echo "Creating Kind Cluster..."
143-
direnv allow
144-
mkdir -p ${HOME}/.kube .kube || true
145-
touch ${HOME}/.kube/config .kube/config || true
146-
sudo docker volume create cilium-worker-n01
147-
sudo docker volume create cilium-worker-n02
148-
sudo docker volume create cilium-control-plane-n01
149-
# sudo kind create cluster --config hack/kind.yaml
150-
# sudo kind get kubeconfig --name cilium \
151-
# | tee ${KUBE_CONFIG_FILE} >/dev/null
152-
sudo chown -R $(shell id -u):$(shell id -g) ${HOME}/.kube .kube
153-
pulumi config set kubernetes kind
154-
echo "Created Kind Cluster."
142+
@echo "Creating Kind Cluster..."
143+
@direnv allow
144+
@mkdir -p ${HOME}/.kube .kube || true
145+
@touch ${HOME}/.kube/config .kube/config || true
146+
@sudo docker volume create cilium-worker-n01
147+
@sudo docker volume create cilium-worker-n02
148+
@sudo docker volume create cilium-control-plane-n01
149+
@sudo kind create cluster --wait 3m --retain --config=hack/kind.yaml
150+
@sudo kind get clusters
151+
@sudo kind get kubeconfig --name kind | tee ${KUBE_CONFIG_FILE}
152+
@sudo kind get kubeconfig --name cilium | tee ${KUBE_CONFIG_FILE}
153+
@sudo kind get kubeconfig --name kind-cilium | tee ${KUBE_CONFIG_FILE}
154+
@sudo chown -R $(id -u):$(id -g) ${KUBE_CONFIG_FILE}
155+
@sudo chown -R $(shell id -u):$(shell id -g) ${HOME}/.kube .kube
156+
@pulumi config set kubernetes kind
157+
@echo "Created Kind Cluster."
155158

156159
# --- Wait for Kind Cluster Ready ---
157160
kind-ready:
158161
@echo "Waiting for Kind Kubernetes API to be ready..."
159-
sleep 15
160-
kubectl get all --all-namespaces --show-labels --kubeconfig ${KUBE_CONFIG_FILE} || true
161-
sleep 5
162-
kubectl get all --all-namespaces --show-labels --kubeconfig ${KUBE_CONFIG_FILE} || true
163-
sleep 5
164-
kubectl get all --all-namespaces --show-labels --kubeconfig ${KUBE_CONFIG_FILE} || true
165-
sleep 5
166-
bash -c 'until kubectl --kubeconfig ${KUBE_CONFIG_FILE} wait --for=condition=Ready pod -l component=kube-apiserver --namespace=kube-system --timeout=180s; do echo "Waiting for kube-apiserver to be ready..."; sleep 5; done'
167-
bash -c 'until kubectl --kubeconfig ${KUBE_CONFIG_FILE} wait --for=condition=Ready pod -l component=kube-scheduler --namespace=kube-system --timeout=180s; do echo "Waiting for kube-scheduler to be ready..."; sleep 5; done'
168-
bash -c 'until kubectl --kubeconfig ${KUBE_CONFIG_FILE} wait --for=condition=Ready pod -l component=kube-controller-manager --namespace=kube-system --timeout=180s; do echo "Waiting for kube-controller-manager to be ready..."; sleep 5; done'
162+
@kubectl get all --all-namespaces --show-labels --kubeconfig ${KUBE_CONFIG_FILE} || sleep 5
163+
@bash -c 'until kubectl --kubeconfig ${KUBE_CONFIG_FILE} wait --for=condition=Ready pod -l component=kube-apiserver --namespace=kube-system --timeout=180s; do echo "Waiting for kube-apiserver to be ready..."; sleep 5; done'
164+
@bash -c 'until kubectl --kubeconfig ${KUBE_CONFIG_FILE} wait --for=condition=Ready pod -l component=kube-scheduler --namespace=kube-system --timeout=180s; do echo "Waiting for kube-scheduler to be ready..."; sleep 5; done'
165+
@bash -c 'until kubectl --kubeconfig ${KUBE_CONFIG_FILE} wait --for=condition=Ready pod -l component=kube-controller-manager --namespace=kube-system --timeout=180s; do echo "Waiting for kube-controller-manager to be ready..."; sleep 5; done'
169166
@echo "Kind Cluster is ready."
170167

171168
kind: kind-cluster kind-ready
@@ -179,6 +176,8 @@ clean: login down
179176
@echo "Cleaning up resources..."
180177
@sudo kind delete cluster --name cilium \
181178
|| echo "Kind cluster not found."
179+
@sudo kind delete cluster --name kind \
180+
|| echo "Kind cluster not found."
182181
@sudo talosctl cluster destroy \
183182
|| echo "Talos cluster not found."
184183
@echo "Cleanup complete."
@@ -194,7 +193,7 @@ clean-all: clean
194193
act:
195194
@echo "Testing GitHub Workflows locally..."
196195
@direnv allow
197-
@set -ex; GITHUB_TOKEN=${GITHUB_TOKEN} PULUMI_ACCESS_TOKEN=${PULUMI_ACCESS_TOKEN} \
196+
@GITHUB_TOKEN=${GITHUB_TOKEN} PULUMI_ACCESS_TOKEN=${PULUMI_ACCESS_TOKEN} \
198197
act --container-options "--privileged" --rm \
199198
--var GITHUB_TOKEN=${GITHUB_TOKEN} \
200199
--var PULUMI_ACCESS_TOKEN=${PULUMI_ACCESS_TOKEN} \

hack/kind.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
apiVersion: "kind.x-k8s.io/v1alpha4"
12
kind: Cluster
2-
apiVersion: kind.x-k8s.io/v1alpha4
33
name: cilium
44
networking:
55
######################################################################

0 commit comments

Comments
 (0)