feat: Add Manifest Reconcile Duration Metric #1899
Workflow file for this run
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
name: TestSuite Smoke | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
wait-for-img: | |
name: "Wait for Image Build" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: autotelic/action-wait-for-status-check@v1 | |
id: wait-for-build | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# Context for which we should look for the matching status | |
statusName: ${{ (github.event_name == 'pull_request') && 'pull-lifecycle-mgr-build' || 'main-lifecycle-mgr-build' }} | |
timeoutSeconds: 600 | |
intervalSeconds: 10 | |
- name: Exit If Failing Build Requirement | |
if: steps.wait-for-build.outputs.state != 'success' | |
run: | | |
echo "Image build did not succeed, skipping Smoke Test!" | |
exit 1 | |
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-img] | |
name: "kyma (${{ matrix.cli-stability }}) alpha deploy -k config/${{ matrix.target }}" | |
runs-on: ubuntu-latest | |
env: | |
LIFECYCLE_MANAGER: ${{ github.repository }} | |
K3D_VERSION: v5.4.7 | |
KUSTOMIZE_VERSION: 4.5.7 | |
ISTIO_VERSION: 1.17.1 | |
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: | | |
kyma --ci provision k3d \ | |
-p 8083:80@loadbalancer \ | |
-p 8443:443@loadbalancer \ | |
--timeout 1m \ | |
--k3d-arg --no-rollback \ | |
--name kyma | |
- 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 | |
kubectl apply -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-47.0.0/charts/kube-prometheus-stack/crds/crd-servicemonitors.yaml | |
- 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: lifecycle-manager-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 |