From 792c90c6725a3f03b0561aee2d2b33fccdb21f37 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Thu, 10 Oct 2024 07:57:43 +0200 Subject: [PATCH] Fix ci and add sa name tp the job --- .woodpecker/helmfile.yaml | 3 +-- scripts/get_kubeconfig_from_sa.sh | 12 +++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) mode change 100644 => 100755 scripts/get_kubeconfig_from_sa.sh diff --git a/.woodpecker/helmfile.yaml b/.woodpecker/helmfile.yaml index c877121..309f841 100644 --- a/.woodpecker/helmfile.yaml +++ b/.woodpecker/helmfile.yaml @@ -27,8 +27,7 @@ steps: exclude: - main commands: - - kubectl config view - - kubectl cluster-info + - yq - helmfile -e "${ENV}" diff diff: !!merge <<: *opts diff --git a/scripts/get_kubeconfig_from_sa.sh b/scripts/get_kubeconfig_from_sa.sh old mode 100644 new mode 100755 index c85d1f8..e4d4ec3 --- a/scripts/get_kubeconfig_from_sa.sh +++ b/scripts/get_kubeconfig_from_sa.sh @@ -1,13 +1,15 @@ -# The script returns a kubeconfig for the ServiceAccount given +#!/usr/bin/env bash + + # you need to have kubectl on PATH with the context set to the cluster you want to create the config for # Cosmetics for the created config -clusterName='some-cluster' +clusterName="${CLUSTER_NAME}" # your server address goes here get it via `kubectl cluster-info` -server='https://157.90.17.72:6443' +server="${CLUSTER_URL}" # the Namespace and ServiceAccount name that is used for the config -namespace='kube-system' -serviceAccount='developer' +export namespace='pipelines' +export serviceAccount='woodpecker-ci' # The following automation does not work from Kubernetes 1.24 and up. # You might need to