Get output of nodes #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: test sx-cnp-oss k3d stack on kind cluster | |
# Controls when the workflow will run | |
on: | |
# at he moment this action only works when pushed to main because all references in the scripts and argocd apps use the main branch | |
push: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
create-cluster: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create k8s Kind Cluster | |
uses: helm/kind-action@v1 | |
with: | |
cluster_name: sx-cnp-oss-cluster | |
config: ${{ github.workspace }}/.github/kind-config.yaml | |
- name: install mkcert | |
shell: bash | |
run: | | |
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64" | |
chmod +x mkcert-v*-linux-amd64 | |
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert | |
- name: install nginx | |
shell: bash | |
run: | | |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml | |
kubectl wait --namespace ingress-nginx \ | |
--for=condition=ready pod \ | |
--selector=app.kubernetes.io/component=controller \ | |
--timeout=90s | |
- name: install k8sgpt | |
shell: bash | |
run: | | |
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.30/k8sgpt_amd64.deb | |
sudo dpkg -i k8sgpt_amd64.deb | |
k8sgpt analyze | |
- name: install sx-cnp-oss stack | |
env: | |
INSTALL_K3D_CLUSTER: "false" | |
INSTALL_MKCERTS: "false" | |
shell: bash | |
run: | | |
curl -L https://raw.githubusercontent.com/suxess-it/sx-cnp-oss/main/install-k3d-cluster.sh | bash | |
- name: argocd show diff | |
if: ${{ failure() }} | |
env: | |
APPS: "argocd sx-loki sx-kubecost sx-keycloak sx-promtail sx-tempo sx-crossplane sx-bootstrap-app sx-kargo approved-application-team-app sx-cert-manager sx-argo-rollouts sx-external-secrets sx-kyverno sx-kube-prometheus-stack" | |
shell: bash | |
run: | | |
pwd | |
curl -kL -o argocd https://argocd-127-0-0-1.nip.io/download/argocd-linux-amd64 | |
chmod u+x argocd | |
ls -l | |
./argocd login argocd-127-0-0-1.nip.io --grpc-web --insecure --username admin --password admin | |
for app in ${APPS} ; do echo "$app diff" ; ./argocd app diff $app --grpc-web ; done | |
- name: mustgather data for troubleshooting | |
if: ${{ failure() }} | |
shell: bash | |
run: | | |
kubectl get nodes -o yaml | |
kubectl get application -n argocd -o yaml | |
- name: analyze with k8sgpt | |
if: ${{ failure() }} | |
shell: bash | |
run: | | |
k8sgpt analyze | |
- name: mustgather logs for troubleshooting | |
if: ${{ failure() }} | |
shell: bash | |
run: | | |
kubectl logs -n argocd statefulset/argocd-application-controller | |
kubectl logs -n argocd deployment/argocd-repo-server |