mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-10-30 02:22:44 +00:00
WIFI-13821 rework gh CGW deploy action
Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com>
This commit is contained in:
86
.github/workflows/cgw-dev-deployment.yaml
vendored
86
.github/workflows/cgw-dev-deployment.yaml
vendored
@@ -5,37 +5,55 @@ defaults:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
AWS_EKS_NAME: tip-wlan-main
|
||||
#AWS_EKS_NAME: tip-wlan-qa
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
#AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_DEFAULT_REGION: ap-south-1
|
||||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }}
|
||||
|
||||
# https://stackoverflow.com/questions/59977364/github-actions-how-use-strategy-matrix-with-script
|
||||
# Required object fiels per environment:
|
||||
# - namespace - namespace suffix that will used added for the Kubernetes environment (i.e. if you pass 'test', kubernetes namespace will be named 'openlan-test')
|
||||
# - deploy_repo_version - wlan_cloud_ucentral_deploy repo version to use
|
||||
# - cgw_version - OpenLAN Cloud Gateway version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
|
||||
# - just_component - if true then deploy only cgw chart
|
||||
testbeds: '[
|
||||
{
|
||||
"namespace": "cgw01",
|
||||
"deploy_repo_version": "main",
|
||||
"cgw_version": "next",
|
||||
"just_component": "false"
|
||||
"deploy_repo_version": "main"
|
||||
}
|
||||
]'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
just_component:
|
||||
default: 'false'
|
||||
description: 'Just deploy component, not all the other services'
|
||||
cgw_version:
|
||||
default: 'main'
|
||||
description: 'openlan-cgw branch'
|
||||
required: false
|
||||
cgw_image:
|
||||
default: 'latest'
|
||||
description: 'Image tag'
|
||||
required: false
|
||||
config_name:
|
||||
default: 'cgw01'
|
||||
#other: 'default'
|
||||
description: 'Helmfile Config/environment name'
|
||||
required: true
|
||||
namespace:
|
||||
default: 'openlan-cgw01'
|
||||
#other: 'openwifi-devcgw'
|
||||
description: 'Namespace (normally openlan-CONFIGNAME)'
|
||||
required: false
|
||||
cluster:
|
||||
default: "tip-wlan-main"
|
||||
#other: "tip-wlan-qa"
|
||||
description: "AWS cluster name: tip-wlan-main or tip-wlan-qa"
|
||||
required: false
|
||||
region:
|
||||
default: "ap-south-1"
|
||||
#other: "us-east-1"
|
||||
description: 'AWS Region'
|
||||
required: false
|
||||
just_component:
|
||||
default: 'true'
|
||||
description: 'Just deploy CGW component, not all the other services'
|
||||
required: false
|
||||
id:
|
||||
description: 'run identifier'
|
||||
required: false
|
||||
@@ -72,6 +90,13 @@ jobs:
|
||||
strategy:
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
fail-fast: false
|
||||
env:
|
||||
IMG_TAG: ${{ github.events.inputs.cgw_image }}
|
||||
VERSION: ${{ github.events.inputs.cgw_version }}
|
||||
CONFIG_NAME: ${{ github.events.inputs.config_name }}
|
||||
NAMESPACE: ${{ github.events.inputs.namespace }}
|
||||
AWS_EKS_NAME: ${{ github.events.inputs.cluster }}
|
||||
AWS_DEFAULT_REGION: ${{ github.events.inputs.region }}
|
||||
steps:
|
||||
- name: Checkout repo with Helm values
|
||||
uses: actions/checkout@v4
|
||||
@@ -85,7 +110,7 @@ jobs:
|
||||
with:
|
||||
repository: Telecominfraproject/openlan-cgw
|
||||
path: openlan-cgw
|
||||
ref: ${{ matrix.cgw_version }}
|
||||
ref: ${{ env.VERSION }}
|
||||
|
||||
- name: Fetch kubeconfig
|
||||
run: |
|
||||
@@ -117,14 +142,14 @@ jobs:
|
||||
working-directory: wlan-cloud-ucentral-deploy/cgw
|
||||
run: |
|
||||
# service components can't be reinstalled easily
|
||||
helm ls -n ${{ matrix.namespace }}
|
||||
if ! helm ls -n ${{ matrix.namespace }} | grep "^kafka" >/dev/null ; then
|
||||
helmfile --environment ${{ matrix.namespace }} \
|
||||
--state-values-set "cgw.tag={{ matrix.cgw_version }}"
|
||||
helm ls -n ${{ env.FULL_NAMESPACE }}
|
||||
if ! helm ls -n ${{ env.FULL_NAMESPACE }} | grep "^kafka" >/dev/null ; then
|
||||
helmfile --environment ${{ env.CONFIG_NAME }} \
|
||||
--state-values-set "cgw.tag={{ env.IMG_TAG }}" \
|
||||
apply
|
||||
else
|
||||
helmfile --environment ${{ matrix.namespace }} -l app=cgw \
|
||||
--state-values-set "cgw.tag={{ matrix.cgw_version }}" \
|
||||
helmfile --environment ${{ env.CONFIG_NAME }} -l app=cgw \
|
||||
--state-values-set "cgw.tag={{ env.IMG_TAG }}" \
|
||||
apply
|
||||
fi
|
||||
|
||||
@@ -132,22 +157,21 @@ jobs:
|
||||
if: ${{ github.event.inputs.just_component }} == "true"
|
||||
working-directory: wlan-cloud-ucentral-deploy/cgw
|
||||
run: |
|
||||
helmfile --environment ${{ matrix.namespace }} -l app=cgw \
|
||||
--state-values-set "cgw.tag={{ matrix.cgw_version }}" \
|
||||
helm ls -n ${{ env.FULL_NAMESPACE }}
|
||||
helmfile --environment ${{ env.CONFIG_NAME }} -l app=cgw \
|
||||
--state-values-set "cgw.tag={{ env.IMG_TAG }}" \
|
||||
apply
|
||||
|
||||
- name: Show resource state on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
echo "Deploy/STS:"
|
||||
kubectl get deploy,sts --namespace {{ env.FULL_NAMESPACE }} -o wide
|
||||
echo "Pods:"
|
||||
kubectl get pods --namespace openlan-${{ matrix.namespace }}
|
||||
kubectl get pods --namespace {{ env.FULL_NAMESPACE }} -o wide
|
||||
echo "Pod Descriptions:"
|
||||
kubectl describe pods --namespace openlan-${{ matrix.namespace }}
|
||||
kubectl describe pods --namespace {{ env.FULL_NAMESPACE }}
|
||||
echo "Services:"
|
||||
kubectl get services --namespace openlan-${{ matrix.namespace }}
|
||||
kubectl get services --namespace {{ env.FULL_NAMESPACE }} -o wide
|
||||
echo "Service Descriptions:"
|
||||
kubectl describe services --namespace openlan-${{ matrix.namespace }}
|
||||
echo "PVCs:"
|
||||
kubectl get persistentvolumeclaims --namespace openlan-${{ matrix.namespace }}
|
||||
echo "PVC Descriptions:"
|
||||
kubectl describe persistentvolumeclaims --namespace openlan-${{ matrix.namespace }}
|
||||
kubectl describe services --namespace {{ env.FULL_NAMESPACE }}
|
||||
|
||||
Reference in New Issue
Block a user