-
Notifications
You must be signed in to change notification settings - Fork 4
77 lines (65 loc) · 2.69 KB
/
cluster-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# 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
- 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 login
if: ${{ failure() }}
uses: clowdhaus/argo-cd-action/@main
env:
# Only required for first step in job where API is called
# All subsequent setps in a job will not re-download the CLI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
command: login argocd-127-0-0-1.nip.io
options: --grpc-web --insecure --username admin --password admin
- name: argocd 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: |
for app in ${APPS} ; do echo "$app diff" ; /home/github/argocd app diff $app --grpc-web
- name: mustgather data for troubleshooting
if: ${{ failure() }}
shell: bash
run: |
kubectl get application -n argocd -o yaml
- 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