Skip to content

Commit

Permalink
dbg
Browse files Browse the repository at this point in the history
  • Loading branch information
usrbinkat committed Jan 31, 2024
1 parent a2fd0e2 commit a604476
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ jobs:
- name: Deploy Pulumi Infrastructure
id: deploy
run: |
set -ex
direnv allow
make pulumi-up
env:
ACTIONS_STEP_DEBUG: false
ACTIONS_STEP_DEBUG: true
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KUBECONFIG: /workspaces/Kargo/.kube/config
Expand All @@ -89,10 +90,11 @@ jobs:
- name: Wait for All Pods to be Ready
id: wait-all-pods
run: |
set -ex
direnv allow
make wait-all-pods
env:
ACTIONS_STEP_DEBUG: false
ACTIONS_STEP_DEBUG: true
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KUBECONFIG: /workspaces/Kargo/.kube/config
Expand Down
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,28 +156,29 @@ talos: clean-all talos-cluster talos-ready wait-all-pods
# --- Kind Cluster ---
kind-cluster:
@echo "Creating Kind Cluster..."
@direnv allow
@mkdir -p ${HOME}/.kube .kube || true
@touch ${HOME}/.kube/config .kube/config || true
@chmod 600 ${HOME}/.kube/config .kube/config || true
@set -ex; direnv allow
@set -ex; rm -rf ${HOME}/.kube/config .kube/config || true
@set -ex; mkdir -p ${HOME}/.kube .kube || true
@set -ex; touch ${HOME}/.kube/config .kube/config || true
@set -ex; chmod 600 ${HOME}/.kube/config .kube/config || true
@sudo docker volume create cilium-worker-n01
@sudo docker volume create cilium-worker-n02
@sudo docker volume create cilium-control-plane-n01
@sudo kind create cluster --wait 1m --retain --config=hack/kind.yaml
@sudo kind get clusters
@sudo kind get kubeconfig --name cilium | tee ${KUBE_CONFIG_FILE} 1>/dev/null
@sudo kind get kubeconfig --name cilium | tee ${HOME}/.kube/config 1>/dev/null
@sudo chown -R $(id -u):$(id -g) ${KUBE_CONFIG_FILE}
@pulumi config set kubernetes kind || true
@set -ex; sudo kind create cluster --wait 1m --retain --config=hack/kind.yaml
@set -ex; sudo kind get clusters
@set -ex; KUBECONFIG=${KUBE_CONFIG_FILE} sudo kind get kubeconfig --name cilium | tee ${KUBECONFIG} 1>/dev/null
@set -ex; KUBECONFIG=${KUBE_CONFIG_FILE} sudo kind get kubeconfig --name cilium | tee ${HOME}/.kube/config 1>/dev/null
@set -ex; KUBECONFIG=${KUBE_CONFIG_FILE} sudo chown -R $(id -u):$(id -g) ${KUBECONFIG} ${HOME}/.kube/config
@set -ex; pulumi config set kubernetes kind || true
@echo "Created Kind Cluster."

# --- Wait for Kind Cluster Ready ---
kind-ready:
@echo "Waiting for Kind Kubernetes API to be ready..."
@kubectl get all --all-namespaces --show-labels --kubeconfig ${KUBE_CONFIG_FILE} || sleep 5
@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'
@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'
@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'
@set -ex; kubectl get all --all-namespaces --show-labels --kubeconfig ${KUBE_CONFIG_FILE} || sleep 5
@bash -c 'set -ex; 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'
@bash -c 'set -ex; 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'
@bash -c 'set -ex; 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'
@echo "Kind Cluster is ready."

kind: login kind-cluster kind-ready
Expand Down Expand Up @@ -205,7 +206,7 @@ clean-all: clean
@echo "Extended cleanup complete."

# --- GitHub Actions Testing ---
act:
act: clean
@echo "Testing GitHub Workflows locally..."
@direnv allow
@GITHUB_TOKEN=${GITHUB_TOKEN} PULUMI_ACCESS_TOKEN=${PULUMI_ACCESS_TOKEN} \
Expand Down

0 comments on commit a604476

Please sign in to comment.