From bd2675999456e23872741616f59cee5995cd9c19 Mon Sep 17 00:00:00 2001 From: Olga Naidjonoka Date: Thu, 28 Mar 2024 15:00:02 +0200 Subject: [PATCH] added k8s env setup --- .../deploy/kubernetes/scripts/install-kind.sh | 0 .../kubernetes/scripts/install-kubectl.sh | 0 .../deploy/kubernetes/scripts/kind-setup.sh | 0 .buildkite/deploy/kubernetes/scripts/make.sh | 0 .../deploy/kubernetes/scripts/setup-k8s-env.sh | 0 .buildkite/hooks/pre-command | 18 +++++++++++++----- 6 files changed, 13 insertions(+), 5 deletions(-) mode change 100644 => 100755 .buildkite/deploy/kubernetes/scripts/install-kind.sh mode change 100644 => 100755 .buildkite/deploy/kubernetes/scripts/install-kubectl.sh mode change 100644 => 100755 .buildkite/deploy/kubernetes/scripts/kind-setup.sh mode change 100644 => 100755 .buildkite/deploy/kubernetes/scripts/make.sh mode change 100644 => 100755 .buildkite/deploy/kubernetes/scripts/setup-k8s-env.sh diff --git a/.buildkite/deploy/kubernetes/scripts/install-kind.sh b/.buildkite/deploy/kubernetes/scripts/install-kind.sh old mode 100644 new mode 100755 diff --git a/.buildkite/deploy/kubernetes/scripts/install-kubectl.sh b/.buildkite/deploy/kubernetes/scripts/install-kubectl.sh old mode 100644 new mode 100755 diff --git a/.buildkite/deploy/kubernetes/scripts/kind-setup.sh b/.buildkite/deploy/kubernetes/scripts/kind-setup.sh old mode 100644 new mode 100755 diff --git a/.buildkite/deploy/kubernetes/scripts/make.sh b/.buildkite/deploy/kubernetes/scripts/make.sh old mode 100644 new mode 100755 diff --git a/.buildkite/deploy/kubernetes/scripts/setup-k8s-env.sh b/.buildkite/deploy/kubernetes/scripts/setup-k8s-env.sh old mode 100644 new mode 100755 diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index c5a43d44f8d..5f625b35c59 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -9,7 +9,7 @@ source .buildkite/env-scripts/util.sh AWS_SERVICE_ACCOUNT_SECRET_PATH="kv/ci-shared/platform-ingest/aws_account_auth" PRIVATE_CI_GCS_CREDENTIALS_PATH="kv/ci-shared/platform-ingest/gcp-platform-ingest-ci-service-account" DOCKER_REGISTRY_SECRET_PATH="kv/ci-shared/platform-ingest/docker_registry_prod" -PRIVATE_CI_GCS_CREDENTIALS_PATH="kv/ci-shared/platform-ingest/private_ci_artifacts_gcs_credentials" +#PRIVATE_CI_GCS_CREDENTIALS_PATH="kv/ci-shared/platform-ingest/private_ci_artifacts_gcs_credentials" GITHUB_TOKEN_VAULT_PATH="kv/ci-shared/platform-ingest/github_token" if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats" || "$BUILDKITE_PIPELINE_SLUG" == "filebeat" || "$BUILDKITE_PIPELINE_SLUG" == "auditbeat" || "$BUILDKITE_PIPELINE_SLUG" == "heartbeat" || "$BUILDKITE_PIPELINE_SLUG" == "deploy-k8s" ]]; then @@ -24,7 +24,7 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats" || "$BUILDKITE_PIPELINE_SLUG" == "fi fi # To prevent "OSError: [Errno 24] Too many open files" - ulimit -Sn 80000 + ulimit -Sn 150000 echo "--- Ulimit: $(ulimit)" echo "--- Setting up environment" @@ -40,9 +40,13 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats" || "$BUILDKITE_PIPELINE_SLUG" == "fi fi if [[ "$BUILDKITE_STEP_KEY" == package* ]]; then - export DOCKER_USERNAME_SECRET=$(retry_with_count 5 vault kv get -field user "${DOCKER_REGISTRY_SECRET_PATH}") - export DOCKER_PASSWORD_SECRET=$(retry_with_count 5 vault kv get -field password "${DOCKER_REGISTRY_SECRET_PATH}") - export GITHUB_TOKEN_SECRET=$(retry_with_count 5 vault kv get -field token ${GITHUB_TOKEN_VAULT_PATH}) + DOCKER_USERNAME_SECRET=$(retry_with_count 5 vault kv get -field user "${DOCKER_REGISTRY_SECRET_PATH}") + DOCKER_PASSWORD_SECRET=$(retry_with_count 5 vault kv get -field password "${DOCKER_REGISTRY_SECRET_PATH}") + GITHUB_TOKEN_SECRET=$(retry_with_count 5 vault kv get -field token ${GITHUB_TOKEN_VAULT_PATH}) + + export DOCKER_USERNAME_SECRET + export DOCKER_PASSWORD_SECRET + export GITHUB_TOKEN_SECRET docker login -u "${DOCKER_USERNAME_SECRET}" -p "${DOCKER_PASSWORD_SECRET}" "${DOCKER_REGISTRY}" 2>/dev/null @@ -52,6 +56,10 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats" || "$BUILDKITE_PIPELINE_SLUG" == "fi git config user.name "$github_username" git config user.email "$github_email" fi + + if [[ "$BUILDKITE_STEP_KEY" == k8s-test* ]]; then + .buildkite/deploy/kubernetes/scripts/setup-k8s-env.sh + fi fi ENABLED_BEATS_PIPELINES_SLUGS=(