Skip to content

Update dependancy to kubernetes 1.26 #914

Update dependancy to kubernetes 1.26

Update dependancy to kubernetes 1.26 #914

Workflow file for this run

name: e2e_test
on:
pull_request:
branches:
- OSC-MIGRATION
- master
paths:
- "**.go"
- "Dockerfile"
- ".trivyignore"
- "Makefile"
- "go.*"
- "osc-bsu-csi-driver/**.yaml"
- ".github/workflows/e2e_test.yml"
push:
branches: [ OSC-MIGRATION, master ]
paths:
- "**.go"
- "Dockerfile"
- ".trivyignore"
- "Makefile"
- "go.*"
- "osc-bsu-csi-driver/**.yaml"
- ".github/workflows/e2e_test.yml"
workflow_dispatch:
jobs:
create_cluster:
runs-on: [self-hosted, linux]
steps:
# Retrieve the code from the repo (UNSAFE)
- uses: actions/checkout@v2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/checkout@v2
with:
repository: 'outscale-dev/osc-k8s-rke-cluster'
path: "set-up-rke-cluster"
- uses: azure/[email protected]
- uses: azure/setup-helm@v3
with:
version: v3.10.1
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- uses: outscale-dev/frieza-github-actions/frieza-clean@master
with:
access_key: ${{ secrets.OSC_ACCESS_KEY }}
secret_key: ${{ secrets.OSC_SECRET_KEY }}
region: ${{ secrets.OSC_REGION }}
- name: Deploy Cluster
uses: outscale-dev/osc-k8s-rke-cluster/github_actions/deploy_cluster@master
with:
repository_folder: "set-up-rke-cluster"
osc_access_key: ${{ secrets.OSC_ACCESS_KEY }}
osc_secret_key: ${{ secrets.OSC_SECRET_KEY }}
osc_region: ${{ secrets.OSC_REGION }}
image_id: ${{ secrets.OMI_ID }}
rke_version: "v1.4.4"
kubernetes_version: "v1.25.6-rancher4-1"
- name: Wait to access the cluster
uses: nick-invision/retry@v2
with:
timeout_seconds: 60
max_attempts: 10
command: kubectl get nodes
env:
KUBECONFIG: set-up-rke-cluster/rke/kube_config_cluster.yml
- name: Deploy Docker-registry into cluster
run: |
ansible-playbook addons/docker-registry/playbook.yaml
./addons/docker-registry/start_port_forwarding.sh &
env:
KUBECONFIG: rke/kube_config_cluster.yml
ANSIBLE_CONFIG: ansible.cfg
working-directory: set-up-rke-cluster
- name: Push the Docker image
run: |
make buildx-image image-tag image-push
docker image prune -a -f
env:
REGISTRY_IMAGE: localhost:4242/csi
IMAGE_TAG: ${{ github.sha }}
REGISTRY_TAG: ${{ github.sha }}
- name: Retrieve NodePort Ip and NodePort
run: |
echo nodeport_port=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services docker-registry) >> $GITHUB_ENV
echo nodeport_ip=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}") >> $GITHUB_ENV
env:
KUBECONFIG: set-up-rke-cluster/rke/kube_config_cluster.yml
- name: Install CSI
run: |
kubectl apply -f set-up-rke-cluster/addons/csi/secrets.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml
TARGET_IMAGE=${nodeport_ip}:${nodeport_port}/csi TARGET_TAG=$IMAGE_TAG make helm_deploy
env:
KUBECONFIG: set-up-rke-cluster/rke/kube_config_cluster.yml
OSC_REGION: ${{ secrets.OSC_REGION}}
IMAGE_TAG: ${{ github.sha }}
- name: Run e2e tests
env:
OSC_ACCESS_KEY: ${{ secrets.OSC_ACCESS_KEY }}
OSC_SECRET_KEY: ${{ secrets.OSC_SECRET_KEY }}
OSC_REGION: ${{ secrets.OSC_REGION }}
run: bash -c "KC=$(base64 -w 0 set-up-rke-cluster/rke/kube_config_cluster.yml) make test-e2e-single-az-buildx"
- name: Uninstall CSI
run: |
kubectl delete -f set-up-rke-cluster/addons/csi/secrets.yaml
kubectl delete -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
kubectl delete -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
kubectl delete -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
kubectl delete -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
kubectl delete -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml
helm uninstall --wait osc-bsu-csi-driver --namespace kube-system
env:
KUBECONFIG: set-up-rke-cluster/rke/kube_config_cluster.yml
- name: Destroy Cluster
uses: outscale-dev/osc-k8s-rke-cluster/github_actions/destroy_cluster@master
if: ${{ always() }}
with:
repository_folder: "set-up-rke-cluster"
osc_access_key: ${{ secrets.OSC_ACCESS_KEY }}
osc_secret_key: ${{ secrets.OSC_SECRET_KEY }}
osc_region: ${{ secrets.OSC_REGION }}