forked from aws/karpenter-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (186 loc) · 6.67 KB
/
e2e-upgrade.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: E2EUpgrade
on:
workflow_dispatch:
inputs:
from_git_ref:
type: string
required: true
region:
type: choice
options:
- "us-east-2"
- "us-west-2"
default: "us-east-2"
to_git_ref:
type: string
k8s_version:
type: choice
options:
- "1.23"
- "1.24"
- "1.25"
- "1.26"
- "1.27"
- "1.28"
default: "1.28"
eksctl_version:
type: string
default: v0.160.0-rc.0
workflow_call:
inputs:
from_git_ref:
type: string
required: true
to_git_ref:
type: string
region:
type: string
default: "us-east-2"
k8s_version:
type: string
default: "1.28"
eksctl_version:
type: string
default: v0.160.0-rc.0
secrets:
SLACK_WEBHOOK_URL:
required: true
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
statuses: write
jobs:
run-suite:
name: suite-upgrade
runs-on: ubuntu-latest
steps:
# This additional checkout can be removed when the commit status action is added to the from_git_ref version of Karpenter
- uses: actions/checkout@v4
with:
ref: ${{ inputs.to_git_ref }}
- if: always() && github.event_name == 'workflow_run'
uses: ./.github/actions/commit-status/start
with:
name: ${{ github.workflow }} (${{ inputs.k8s_version }}) / e2e (Upgrade)
git_ref: ${{ inputs.to_git_ref }}
- uses: ./.github/actions/install-deps
- uses: actions/checkout@v4
with:
ref: ${{ inputs.from_git_ref }}
- name: configure aws credentials
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::${{ vars.ACCOUNT_ID }}:role/${{ vars.ROLE_NAME }}
aws-region: ${{ inputs.region }}
role-duration-seconds: 21600
- name: generate cluster name
run: |
CLUSTER_NAME="upgrade-$RANDOM$RANDOM"
echo "Using cluster name \"$CLUSTER_NAME\""
echo CLUSTER_NAME=$CLUSTER_NAME >> $GITHUB_ENV
- name: create eks cluster '${{ env.CLUSTER_NAME }}'
uses: ./.github/actions/e2e/create-cluster
with:
account_id: ${{ vars.ACCOUNT_ID }}
role: ${{ vars.ROLE_NAME }}
region: ${{ inputs.region }}
cluster_name: ${{ env.CLUSTER_NAME }}
k8s_version: ${{ inputs.k8s_version }}
eksctl_version: ${{ inputs.eksctl_version }}
ip_family: IPv4 # Set the value to IPv6 if IPv6 suite, else IPv4
git_ref: ${{ inputs.from_git_ref }}
- name: install prometheus
uses: ./.github/actions/e2e/install-prometheus
with:
account_id: ${{ vars.ACCOUNT_ID }}
role: ${{ vars.ROLE_NAME }}
region: ${{ vars.PROMETHEUS_REGION }}
cluster_name: ${{ env.CLUSTER_NAME }}
workspace_id: ${{ vars.WORKSPACE_ID }}
git_ref: ${{ inputs.from_git_ref }}
- name: install karpenter
uses: ./.github/actions/e2e/install-karpenter
with:
account_id: ${{ vars.ACCOUNT_ID }}
role: ${{ vars.ROLE_NAME }}
region: ${{ inputs.region }}
ecr_account_id: ${{ vars.ECR_ACCOUNT_ID }}
ecr_region: ${{ vars.ECR_REGION }}
cluster_name: ${{ env.CLUSTER_NAME }}
git_ref: ${{ inputs.from_git_ref }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.to_git_ref }}
- name: upgrade eks cluster '${{ env.CLUSTER_NAME }}'
uses: ./.github/actions/e2e/create-cluster
with:
account_id: ${{ vars.ACCOUNT_ID }}
role: ${{ vars.ROLE_NAME }}
region: ${{ inputs.region }}
cluster_name: ${{ env.CLUSTER_NAME }}
k8s_version: ${{ inputs.k8s_version }}
eksctl_version: ${{ inputs.eksctl_version }}
ip_family: IPv4 # Set the value to IPv6 if IPv6 suite, else IPv4
git_ref: ${{ inputs.to_git_ref }}
- name: upgrade prometheus
uses: ./.github/actions/e2e/install-prometheus
with:
account_id: ${{ vars.ACCOUNT_ID }}
role: ${{ vars.ROLE_NAME }}
region: ${{ vars.PROMETHEUS_REGION }}
cluster_name: ${{ env.CLUSTER_NAME }}
workspace_id: ${{ vars.WORKSPACE_ID }}
git_ref: ${{ inputs.to_git_ref }}
- name: upgrade crds
uses: ./.github/actions/e2e/upgrade-crds
with:
account_id: ${{ vars.ACCOUNT_ID }}
role: ${{ vars.ROLE_NAME }}
region: ${{ inputs.region }}
cluster_name: ${{ env.CLUSTER_NAME }}
git_ref: ${{ inputs.to_git_ref }}
- name: upgrade karpenter
uses: ./.github/actions/e2e/install-karpenter
with:
account_id: ${{ vars.ACCOUNT_ID }}
role: ${{ vars.ROLE_NAME }}
region: ${{ inputs.region }}
ecr_account_id: ${{ vars.ECR_ACCOUNT_ID }}
ecr_region: ${{ vars.ECR_REGION }}
cluster_name: ${{ env.CLUSTER_NAME }}
git_ref: ${{ inputs.to_git_ref }}
- name: run the Upgrade test suite
run: |
aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }}
TEST_SUITE="Integration" make e2etests
- name: notify slack of success or failure
uses: ./.github/actions/e2e/slack/notify
if: (success() || failure()) && github.event_name != 'workflow_run' && github.event_name != 'conformance'
with:
url: ${{ secrets.SLACK_WEBHOOK_URL }}
suite: Upgrade
k8s_version: ${{ inputs.k8s_version }}
git_ref: ${{ inputs.to_git_ref }}
- name: dump logs on failure
uses: ./.github/actions/e2e/dump-logs
if: failure() || cancelled()
with:
account_id: ${{ vars.ACCOUNT_ID }}
role: ${{ vars.ROLE_NAME }}
region: ${{ inputs.region }}
cluster_name: ${{ env.CLUSTER_NAME }}
- name: cleanup karpenter and cluster '${{ env.CLUSTER_NAME }}' resources
uses: ./.github/actions/e2e/cleanup
if: always()
with:
account_id: ${{ vars.ACCOUNT_ID }}
role: ${{ vars.ROLE_NAME }}
region: ${{ inputs.region }}
cluster_name: ${{ env.CLUSTER_NAME }}
git_ref: ${{ inputs.to_git_ref }}
eksctl_version: ${{ inputs.eksctl_version }}
- if: always() && github.event_name == 'workflow_run'
uses: ./.github/actions/commit-status/end
with:
name: ${{ github.workflow }} (${{ inputs.k8s_version }}) / e2e (Upgrade)
git_ref: ${{ inputs.to_git_ref }}