Skip to content

Commit

Permalink
Fix master airgap file
Browse files Browse the repository at this point in the history
  • Loading branch information
juadk committed Jan 18, 2024
1 parent 13ed088 commit 695d850
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cli-k3s-airgap_rm_latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:
pat_token: ${{ secrets.SELF_HOSTED_RUNNER_PAT_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
test_description: "CI - CLI - Airgap K3S - RM Latest"
cert-manager_version: v1.12.2
cluster_name: airgap-cluster
cluster_type: airgap
#destroy_runner: ${{ github.event_name == 'schedule' && true || inputs.destroy_runner }}
destroy_runner: true
k8s_version_to_provision: v1.26.8+k3s1
os_to_test: dev
rancher_version: latest/devel/2.7
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cli-k3s-airgap_rm_stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:
pat_token: ${{ secrets.SELF_HOSTED_RUNNER_PAT_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
test_description: "CI - CLI - Airgap K3S - RM Stable"
cert-manager_version: v1.12.2
cluster_name: airgap-cluster
cluster_type: airgap
#destroy_runner: ${{ github.event_name == 'schedule' && true || inputs.destroy_runner }}
destroy_runner: true
k8s_version_to_provision: v1.26.8+k3s1
os_to_test: dev
rancher_version: stable/latest/2.7
Expand Down
114 changes: 92 additions & 22 deletions .github/workflows/master-airgap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,17 @@ on:
description: Rancher Manager channel/version to use for installation
default: stable/latest/2.7
type: string
test_description:
description: Short description of the test
type: string
upstream_cluster_version:
description: Cluster upstream version where to install Rancher (K3s or RKE2)
default: v1.26.8
type: string
zone:
description: GCP zone to host the runner
default: us-central1-a
type: string

jobs:
create-runner:
Expand Down Expand Up @@ -153,6 +160,34 @@ jobs:
cd tests && make e2e-airgap-rancher
- name: Configure Rancher & Libvirt
run: cd tests && make e2e-configure-rancher
- name: Extract component versions/informations
id: component
run: |
# Extract rancher-backup-operator version
BACKUP_RESTORE_VERSION=$(kubectl get pod \
--namespace cattle-resources-system \
-l app.kubernetes.io/name=rancher-backup \
-o jsonpath={.items[*].status.containerStatuses[*].image} 2> /dev/null || true)
# Extract CertManager version
CERT_MANAGER_VERSION=$(kubectl get pod \
--namespace cert-manager \
-l app=cert-manager \
-o jsonpath={.items[*].status.containerStatuses[*].image} 2> /dev/null || true)
# Extract elemental-operator version
OPERATOR_VERSION=$(kubectl get pod \
--namespace cattle-elemental-system \
-l app=elemental-operator \
-o jsonpath={.items[*].status.containerStatuses[*].image} 2> /dev/null || true)
# Extract Rancher Manager version
RM_VERSION=$(kubectl get pod \
--namespace cattle-system \
-l app=rancher \
-o jsonpath={.items[*].status.containerStatuses[*].image} 2> /dev/null || true)
# Export values
echo "backup_restore_version=${BACKUP_RESTORE_VERSION}" >> ${GITHUB_OUTPUT}
echo "cert_manager_version=${CERT_MANAGER_VERSION}" >> ${GITHUB_OUTPUT}
echo "operator_version=${OPERATOR_VERSION}" >> ${GITHUB_OUTPUT}
echo "rm_version=${RM_VERSION}" >> ${GITHUB_OUTPUT}
- name: Create ISO image for master pool
env:
EMULATE_TPM: true
Expand All @@ -170,25 +205,60 @@ jobs:
run: |
export ISO_BOOT=true
cd tests && VM_INDEX=${VM_START} VM_NUMBERS=${VM_END} make e2e-bootstrap-node
# delete-runner:
# if: always() && needs.create-runner.result == 'success' && inputs.destroy_runner == true
# needs: [create-runner, e2e]
# runs-on: ubuntu-latest
# steps:
# # actions/checkout MUST come before auth
# - name: Checkout
# uses: actions/checkout@v3
# - name: Authenticate to GCP
# uses: google-github-actions/auth@v1
# with:
# credentials_json: ${{ secrets.credentials }}
# - name: Setup gcloud
# uses: google-github-actions/setup-gcloud@v1
# - name: Delete PAT token secret
# run: |
# gcloud --quiet secrets delete PAT_TOKEN_${{ needs.create-runner.outputs.uuid }}
# - name: Delete runner
# run: |
# gcloud --quiet compute instances delete ${{ needs.create-runner.outputs.runner }} \
# --delete-disks all \
# --zone ${{ inputs.zone }}
- name: Add summary
if: ${{ always() }}
run: |
# Define some variable(s)
# Add summary
echo "## General informations" >> ${GITHUB_STEP_SUMMARY}
echo -e "***${{ inputs.test_description }}***\n" >> ${GITHUB_STEP_SUMMARY}
echo "Type of cluster deployed: ${CLUSTER_TYPE:-normal}" >> ${GITHUB_STEP_SUMMARY}
echo "### Rancher Manager" >> ${GITHUB_STEP_SUMMARY}
echo "Rancher Manager Image: ${{ steps.component.outputs.rm_version }}" >> ${GITHUB_STEP_SUMMARY}
echo "Rancher Manager Version: ${{ inputs.rancher_version }}" >> ${GITHUB_STEP_SUMMARY}
echo "CertManager Image: ${{ steps.component.outputs.cert_manager_version }}" >> ${GITHUB_STEP_SUMMARY}
echo "### Elemental" >> ${GITHUB_STEP_SUMMARY}
echo "Elemental ISO image: ${{ inputs.os_to_test }}" >> ${GITHUB_STEP_SUMMARY}
echo "Elemental OS version: ${{ steps.iso_version.outputs.image_tag }}" >> ${GITHUB_STEP_SUMMARY}
echo "Elemental Operator Image: ${{ steps.component.outputs.operator_version }}" >> ${GITHUB_STEP_SUMMARY}
echo "Elemental Backup/Restore Operator Image: ${{ steps.component.outputs.backup_restore_version }}" >> ${GITHUB_STEP_SUMMARY}
echo "### Kubernetes" >> ${GITHUB_STEP_SUMMARY}
echo "K3s on Rancher Manager: ${{ env.INSTALL_K3S_VERSION }}" >> ${GITHUB_STEP_SUMMARY}
echo "K8s version deployed on the cluster(s): ${{ inputs.k8s_version_to_provision }}" >> ${GITHUB_STEP_SUMMARY}
clean-runner:
if: ${{ always() }}
needs: e2e
runs-on: ubuntu-latest
steps:
# actions/checkout MUST come before auth
- name: Checkout
uses: actions/checkout@v3
- name: Authenticate to GCP
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.credentials }}
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v1
- name: Delete GCP secrets
run: |
gcloud --quiet secrets delete PAT_TOKEN_${{ needs.create-runner.outputs.uuid }} || true
gcloud --quiet secrets delete GH_REPO_${{ needs.create-runner.outputs.uuid }} || true
delete-runner:
if: ${{ always() && needs.create-runner.result == 'success' && inputs.destroy_runner == true }}
needs: [create-runner, clean-runner]
runs-on: ubuntu-latest
steps:
# actions/checkout MUST come before auth
- name: Checkout
uses: actions/checkout@v3
- name: Authenticate to GCP
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.credentials }}
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v1
- name: Delete runner
run: |
gcloud --quiet compute instances delete ${{ needs.create-runner.outputs.runner }} \
--delete-disks all \
--zone ${{ inputs.zone }}

0 comments on commit 695d850

Please sign in to comment.