-
Notifications
You must be signed in to change notification settings - Fork 30
134 lines (130 loc) · 5.28 KB
/
test-smoke.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
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
name: TestSuite Smoke
on:
pull_request:
branches:
- main
- feat/**
jobs:
wait-for-image-build:
name: Wait for image build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/wait-for-image-build
with:
token: ${{ secrets.GITHUB_TOKEN }}
statusName: pull-lifecycle-mgr-build
kustomize:
strategy:
matrix:
flavor: ["", "-control-plane"]
name: "Kustomize (dry-run${{ matrix.flavor }})"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- run: make dry-run${{ matrix.flavor }} IMG='*:latest'
- name: Archive Manifests
uses: actions/upload-artifact@v3
with:
retention-days: 5
name: dry-run${{ matrix.flavor }}
path: |
dry-run/*.yaml
cli-integration:
strategy:
matrix:
cli-stability: ["unstable"]
target: ["default", "control-plane"]
needs: [kustomize,wait-for-image-build]
name: "kyma (${{ matrix.cli-stability }}) alpha deploy -k config/${{ matrix.target }}"
runs-on: ubuntu-latest
env:
LIFECYCLE_MANAGER: ${{ github.repository }}
K3D_VERSION: v5.6.0
K8S_VERSION: v1.29.6
KUSTOMIZE_VERSION: 5.3.0
ISTIO_VERSION: 1.20.3
GOSUMDB: off
steps:
- name: Install prerequisites
run: |
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt update -y
sudo apt install kubectl -y
- name: Checkout Lifecycle-Manager
uses: actions/checkout@v4
- name: Setup kustomize
run: |
wget --header="Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-qO - "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s "$KUSTOMIZE_VERSION"
mv kustomize /usr/local/bin/
- name: Override Kustomize Controller Image TAG in Pull Request to PR Image
if: ${{ github.event_name == 'pull_request' }}
run: |
cd config/manager && kustomize edit set image controller="europe-docker.pkg.dev/kyma-project/dev/lifecycle-manager:PR-${{ github.event.pull_request.number }}"
- name: Set up k3d
run: wget -qO - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=$K3D_VERSION bash
- id: kyma
run: |
wget -q https://storage.googleapis.com/kyma-cli-${{ matrix.cli-stability }}/kyma-linux
chmod +x kyma-linux && mv kyma-linux /usr/local/bin/kyma-${{ matrix.cli-stability }}
echo "PATH=/usr/local/bin/kyma-${{ matrix.cli-stability }}" >> $GITHUB_OUTPUT
- run: ln -s /usr/local/bin/kyma-${{ matrix.cli-stability }} /usr/local/bin/kyma
- name: Run Provision
run: |
k3d cluster create kyma \
-p 8083:80@loadbalancer \
-p 8443:443@loadbalancer \
--registry-create k3d-kyma-registry:5111 \
--image rancher/k3s:$K8S_VERSION-k3s1 \
--k3s-arg '--disable=traefik@server:*' \
--k3s-arg '--tls-san=host.k3d.internal@server:*'
- name: Update Kubeconfigs
run: k3d kubeconfig merge -a -d
- name: Setup Control-Plane requirements
if: ${{ matrix.target == 'control-plane' }}
run: |
kubectl label node k3d-kyma-server-0 iam.gke.io/gke-metadata-server-enabled=true
curl -L https://istio.io/downloadIstio | TARGET_ARCH=x86_64 sh -
chmod +x istio-$ISTIO_VERSION/bin/istioctl
mv istio-$ISTIO_VERSION/bin/istioctl /usr/local/bin
istioctl install --set profile=demo -y
kubectl create namespace kyma-system
kubectl create namespace kcp-system
- name: Deploy lifecycle manager with Kyma CLI
run: kyma --ci alpha deploy -k config/${{ matrix.target }}
- name: Deploy template operator module template and add module
if: ${{ matrix.target == 'default' }}
run: |
cat << EOF | kubectl apply -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyma-cli-provisioned-wildcard
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: lifecycle-manager-wildcard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kyma-cli-provisioned-wildcard
subjects:
- kind: ServiceAccount
name: klm-controller-manager
namespace: kcp-system
EOF
kubectl apply -f tests/moduletemplates/moduletemplate_template_operator_v1_regular.yaml
kyma alpha add module template-operator -c regular -n kyma-system -k default-kyma