-
Notifications
You must be signed in to change notification settings - Fork 139
103 lines (87 loc) · 2.96 KB
/
kind.yaml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Test DC App in a KinD Cluster
on:
workflow_call:
inputs:
dc_app:
required: true
type: string
secrets:
BITBUCKET_LICENSE:
description: 'Bitbucket license'
CONFLUENCE_LICENSE:
description: 'Confluence license'
JIRA_LICENSE:
description: 'Jira license'
BAMBOO_LICENSE:
description: 'Bamboo license'
jobs:
kind-testing:
if: ${{ github.event.label.name == 'e2e' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
runs-on: ubuntu-latest
env:
# See: https://github.com/kubernetes-sigs/kind/tags
KIND_VERSION: "v0.20.0"
# See: https://hub.docker.com/r/kindest/node/tags
K8S_VERSION: "v1.28.0"
DC_APP: ${{inputs.dc_app}}
LICENSE: ${{ secrets[format('{0}_LICENSE', inputs.dc_app)] }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Pin Kubectl version
uses: azure/setup-kubectl@v3.0
with:
version: 'v1.25.3'
- name: Pin Helm version
uses: azure/setup-helm@v3
with:
version: v3.13.3
- name: Create KinD cluster
run: |
src/test/scripts/kind/create_kind.sh
- name: Install KinD tooling
run: |
src/test/scripts/kind/configure_kind.sh
- name: Deploy postgres database
run: |
source src/test/scripts/kind/deploy_app.sh
deploy_postgres
- name: Create db, admin and license secrets
run: |
source src/test/scripts/kind/deploy_app.sh
create_secrets
- name: Deploy ${{inputs.dc_app}}
run: |
source src/test/scripts/kind/deploy_app.sh
deploy_app
- name: Verify ${{inputs.dc_app}} status
run: |
source src/test/scripts/kind/deploy_app.sh
verify_ingress
- name: Verify ${{inputs.dc_app}} grafana dashboards
run: |
source src/test/scripts/kind/deploy_app.sh
verify_dashboards
- name: Test scaling ${{inputs.dc_app}}
run: |
echo "[INFO]: Scaling ${DC_APP} to 2 replicas"
kubectl scale sts/${DC_APP} --replicas=2 -n atlassian
sleep 10
kubectl wait --for=condition=ready pod/${DC_APP}-1 -n atlassian --timeout=360s
- name: Verify ${{inputs.dc_app}} metrics availability
run: |
source src/test/scripts/kind/deploy_app.sh
verify_metrics
- name: Get debug info
if: always()
run: |
curl -s https://raw.githubusercontent.com/atlassian-labs/data-center-terraform/main/scripts/collect_k8s_logs.sh | bash -s -- dummy dummy logs/${{inputs.dc_app}}
- name: Upload test log files
if: always()
uses: actions/upload-artifact@v3.1.1
with:
name: kind-artifacts
path: logs/