Skip to content

Commit

Permalink
Use --helm-set to configure AKS BYOCNI installation
Browse files Browse the repository at this point in the history
We will not add these Azure specific flags for Helm installation mode.
Update the CI scripts to use the --helm-set flag instead.

Ref: #1566

Signed-off-by: Michi Mutsuzaki <[email protected]>
  • Loading branch information
michi-covalent committed May 5, 2023
1 parent a1ad5a3 commit e0d7b5e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 35 deletions.
3 changes: 1 addition & 2 deletions .github/in-cluster-test-scripts/aks-byocni-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ set -e
# Install Cilium
cilium install \
--version "${CILIUM_VERSION}" \
--disable-check=az-binary \
--datapath-mode=aks-byocni \
--wait=false \
--helm-set loadBalancer.l7.backend=envoy \
--helm-set tls.secretsBackend=k8s \
--config monitor-aggregation=none
--helm-set bpf.monitorAggregation=none
29 changes: 17 additions & 12 deletions .github/workflows/aks-byocni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ on:
# will disappear from the PR checks: please provide a direct link to the
# successful workflow run (can be found from Actions tab) in a comment.
#
# pull_request: {}
pull_request: {}
###
pull_request_target: {}
# pull_request_target: {}
# Run every 6 hours
schedule:
- cron: '0 0/6 * * *'
Expand All @@ -36,7 +36,6 @@ concurrency:
cancel-in-progress: true

env:
name: ${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }}
location: westeurope
cost_reduction: --node-vm-size Standard_B2s --node-osdisk-size 30
cilium_version: v1.13.2
Expand All @@ -47,6 +46,9 @@ jobs:
if: ${{ github.repository == 'cilium/cilium-cli' }}
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
matrix:
mode: ["classic", "helm"]
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
Expand Down Expand Up @@ -89,19 +91,20 @@ jobs:
echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo "owner=${OWNER}" >> $GITHUB_OUTPUT
echo "name=${{ github.event.repository.name }}-${{ github.run_id }}-${{ matrix.mode }}" >> $GITHUB_OUTPUT
- name: Create AKS cluster
run: |
# Create group
az group create \
--name ${{ env.name }} \
--name ${{ steps.vars.outputs.name }} \
--location ${{ env.location }} \
--tags usage=${{ github.repository_owner }}-${{ github.event.repository.name }} owner=${{ steps.vars.outputs.owner }}
# Create AKS cluster
az aks create \
--resource-group ${{ env.name }} \
--name ${{ env.name }} \
--resource-group ${{ steps.vars.outputs.name }} \
--name ${{ steps.vars.outputs.name }} \
--location ${{ env.location }} \
--network-plugin none \
--node-count 2 \
Expand All @@ -111,8 +114,8 @@ jobs:
- name: Get cluster credentials
run: |
az aks get-credentials \
--resource-group ${{ env.name }} \
--name ${{ env.name }}
--resource-group ${{ steps.vars.outputs.name }} \
--name ${{ steps.vars.outputs.name }}
- name: Create kubeconfig and load it in configmap
run: |
Expand All @@ -130,7 +133,8 @@ jobs:
--set job_name=cilium-cli-install \
--set test_script_cm=cilium-cli-test-script-install \
--set tag=${{ steps.vars.outputs.sha }} \
--set cilium_version=${{ env.cilium_version }}
--set cilium_version=${{ env.cilium_version }} \
--set cilium_cli_mode=${{ matrix.mode }}
- name: Wait for install job
env:
Expand Down Expand Up @@ -163,11 +167,12 @@ jobs:
--generate-name \
--set job_name=cilium-cli \
--set test_script_cm=cilium-cli-test-script \
--set tag=${{ steps.vars.outputs.sha }}
--set tag=${{ steps.vars.outputs.sha }} \
--set cilium_cli_mode=${{ matrix.mode }}
- name: Wait for test job
env:
timeout: 15m
timeout: 30m
run: |
# Background wait for job to complete or timeout
kubectl -n kube-system wait job/cilium-cli --for=condition=complete --timeout=${{ env.timeout }} &
Expand Down Expand Up @@ -205,7 +210,7 @@ jobs:
- name: Clean up AKS
if: ${{ always() }}
run: |
az group delete --name ${{ env.name }} --yes --no-wait
az group delete --name ${{ steps.vars.outputs.name }} --yes --no-wait
shell: bash {0} # Disable default fail-fast behaviour so that all commands run independently

- name: Upload artifacts
Expand Down
6 changes: 2 additions & 4 deletions install/autodetect.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package install
import (
"context"
"fmt"
"os"
"regexp"
"strconv"
"strings"
Expand All @@ -28,9 +29,6 @@ var (
k8s.KindKind: {
&kindVersionValidation{},
},
k8s.KindAKS: {
&azureVersionValidation{},
},
}

clusterNameValidation = regexp.MustCompile(`^[a-z0-9]([-a-z0-9]*[a-z0-9])$`)
Expand Down Expand Up @@ -112,7 +110,7 @@ func (k *K8sInstaller) autodetect(ctx context.Context) {
func (k *K8sInstaller) autodetectAndValidate(ctx context.Context) error {
k.autodetect(ctx)

if len(validationChecks[k.flavor.Kind]) > 0 {
if len(validationChecks[k.flavor.Kind]) > 0 && os.Getenv("CILIUM_CLI_MODE") != "helm" {
k.Log("✨ Running %q validation checks", k.flavor.Kind)
for _, check := range validationChecks[k.flavor.Kind] {
name := check.Name()
Expand Down
17 changes: 0 additions & 17 deletions install/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ import (
"github.com/cilium/cilium-cli/internal/utils"
)

type azureVersionValidation struct{}

func (m *azureVersionValidation) Name() string {
return "az-binary"
}

func (m *azureVersionValidation) Check(_ context.Context, k *K8sInstaller) error {
_, err := k.azExec("version")
if err != nil {
return err
}

k.Log("✅ Detected az binary")

return nil
}

type accountInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Expand Down

0 comments on commit e0d7b5e

Please sign in to comment.