Display list of pods #156
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: Create a kind cluster, install kubevirt to test it | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
env: | |
KUBEVIRT_VERSION: v1.2.1 | |
KUBEVIRT_CDI_VERSION: v1.59.0 | |
TEKTON_OPERATOR_VERSION: v0.70.2 | |
TEKTON_VERSION: v0.59.0 | |
TEKTON_CLIENT: 0.37.0 | |
OLM_VERSION: v0.28.0 | |
QUAY_ORG: snowdrop | |
jobs: | |
kubevirt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create kind cluster | |
run: | | |
kind create cluster | |
- name: Log OS, kube tools, container versions | |
run: | | |
echo "########### OS ###########" | |
cat /etc/os-release | |
echo "########### Kind version ###########" | |
kind --version | |
echo "########### Docker version ###########" | |
docker -v | |
echo "########### kubectl version ###########" | |
kubectl version --client | |
echo "########### Kubevirt version: $KUBEVIRT_VERSION ###########" | |
- name: Install OLM | |
run: | | |
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/$OLM_VERSION/install.sh -o install.sh | |
chmod +x install.sh | |
./install.sh $OLM_VERSION | |
- name : Install Tekton without OLM but using its operator | |
run: | | |
# kubectl create -f https://operatorhub.io/install/tektoncd-operator.yaml | |
# kubectl wait deployment -n operators tekton-operator --for condition=Available=True --timeout=90s | |
# kubectl wait deployment -n operators tekton-operator-webhook --for condition=Available=True --timeout=90s | |
# kubectl apply -f https://raw.githubusercontent.com/ch007m/test-github-action/main/.github/resources/tekton/tektonpipeline.yaml | |
# Install Tekton Operator without OLM | |
kubectl apply -f https://github.com/tektoncd/operator/releases/download/$TEKTON_OPERATOR_VERSION/release.yaml | |
kubectl wait deployment -n tekton-operator tekton-operator --for condition=Available=True --timeout=90s | |
kubectl wait deployment -n tekton-operator tekton-operator-webhook --for condition=Available=True --timeout=90s | |
# Wait till the TektonConfig CR is ready | |
kubectl wait tektonconfig config --for condition=Ready=True --timeout=90s | |
# Additional control to check if Pipeline, Triggers run | |
kubectl wait deployment -n tekton-pipelines tekton-pipelines-controller --for condition=Available=True --timeout=90s | |
kubectl wait deployment -n tekton-pipelines tekton-triggers-controller --for condition=Available=True --timeout=90s | |
kubectl patch cm feature-flags -n tekton-pipelines -p '{"data":{"disable-affinity-assistant":"true"}}' | |
- name: Install and configure ArgoCD using OLM | |
run: | | |
# Install ArgoCD Operator subscription | |
kubectl apply -f https://raw.githubusercontent.com/ch007m/test-github-action/main/.github/resources/argocd/subscription.yaml | |
function csv_succeeded { | |
kubectl get csv argocd-operator.v0.10.0 -o jsonpath='{.status.phase}' | |
} | |
# Loop until the CSV is Succeeded | |
until [[ $(csv_succeeded) == "Succeeded" ]]; do | |
echo "Waiting for CSV 'argocd-operator.v0.10.0' to reach Succeeded phase..." | |
sleep 5 | |
done | |
kubectl create ns gitops | |
kubectl apply -n gitops -f https://raw.githubusercontent.com/ch007m/test-github-action/main/.github/resources/argocd/argocd.yaml | |
sleep 20 | |
kubectl wait deployment -n gitops argocd-gitops-applicationset-controller --for condition=Available=True --timeout=90s | |
- name: Install Kubevirt | |
run: | | |
curl -sL https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/main/deploy/deploy.sh -o deploy.sh | |
chmod +x deploy.sh | |
./deploy.sh | |
#kubectl create -f https://operatorhub.io/install/community-kubevirt-hyperconverged.yaml | |
#function csv_succeeded { | |
# kubectl get csv xxxxxxx -o jsonpath='{.status.phase}' | |
#} | |
# | |
## Loop until the CSV is Succeeded | |
#until [[ $(csv_succeeded) == "Succeeded" ]]; do | |
# echo "Waiting for CSV 'xxxxxx' to reach Succeeded phase..." | |
# sleep 5 | |
#done | |
echo "Waiting for KubeVirt to be ready" | |
kubectl wait deployment hyperconverged-cluster-operator --namespace=kubevirt-hyperconverged --for=condition=Available --timeout=5m | |
echo "Get list of pods ..." | |
kubectl get pod -A | |
- name: Give more RBAC to Virt resources and RW for PVC | |
run: | | |
kubectl patch --type merge -p '{"spec": {"claimPropertySets": [{"accessModes": ["ReadWriteOnce"], "volumeMode": "Filesystem"}]}}' StorageProfile standard | |
kubectl create clusterrolebinding pod-kubevirt-viewer --clusterrole=kubevirt.io:view --serviceaccount=default:default | |
kubectl create clusterrolebinding cdi-kubevirt-viewer --clusterrole=cdi.kubevirt.io:view --serviceaccount=default:default | |
kubectl create clusterrolebinding quarkus-dev --clusterrole=admin --serviceaccount=default:default | |
- name: Install our Fedora podman image | |
run: | | |
kubectl create ns vm-images | |
kubectl apply -n vm-images -f https://raw.githubusercontent.com/ch007m/test-github-action/main/.github/resources/quay-to-pvc-datavolume.yml | |
- name: Create ssh key, secret and VM | |
run: | | |
ssh-keygen -N "" -f id_rsa | |
kubectl create secret generic quarkus-dev-ssh-key -n default --from-file=key=id_rsa.pub | |
kubectl apply -f https://raw.githubusercontent.com/ch007m/test-github-action/main/.github/resources/quarkus-dev-vm.yml | |
- name: Check pods ... | |
run: | | |
sleep 30 | |
kubectl get pod -A |