diff --git a/.cloudbees/aws-nuke/bp-tf-ci-nuke.yaml b/.cloudbees/aws-nuke/bp-tf-ci-nuke.yaml
deleted file mode 100644
index 3198a3c6..00000000
--- a/.cloudbees/aws-nuke/bp-tf-ci-nuke.yaml
+++ /dev/null
@@ -1,141 +0,0 @@
-regions:
-- us-east-1
-- us-west-2
-- global
-
-account-blocklist:
-- "999999999999" # production
-
-# aws-nuke resource-types ==> to list supported resource types
-resource-types:
- targets:
- - ACMCertificate
- - CloudWatchLogsLogGroup
- - DynamoDBTable
- - EC2Instance
- - EC2InternetGateway
- - EC2LaunchTemplate
- - EC2NATGateway
- - EC2NetworkACL
- - EC2RouteTable
- - EC2SecurityGroup
- - EC2Snapshot
- - EC2Subnet
- - EC2Volume
- - ELBv2
- - ELBv2TargetGroup
- - KMSKey
- - KMSAlias
- - RDSSnapshot
- - S3Bucket
- - SecretsManagerSecret
- # - IAMPolicy
- # - IAMInstanceProfile
-
-accounts:
- 324005994172:
- filters:
- ACMCertificate:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- CloudWatchLogsLogGroup:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- DynamoDBTable:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2Instance:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2InternetGateway:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2LaunchTemplate:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2NATGateway:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2NetworkACL:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2RouteTable:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2SecurityGroup:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2Snapshot:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2Subnet:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- EC2Volume:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- ELBv2:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- ELBv2TargetGroup:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- KMSKey:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- KMSAlias:
- # - property: 'tag:cb-user'
- # type: exact
- # value: "cb-platform"
- # invert: true
- - property: 'Name'
- type: contains
- value: "-ci-"
- invert: true
- RDSSnapshot:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- S3Bucket:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
- SecretsManagerSecret:
- - property: 'tag:cb-user'
- type: exact
- value: "cb-platform"
- invert: true
diff --git a/.cloudbees/workflows/bp-agent-ecr.yaml b/.cloudbees/workflows/bp-agent-ecr.yaml
index 1ddc8ec9..6105f1b2 100644
--- a/.cloudbees/workflows/bp-agent-ecr.yaml
+++ b/.cloudbees/workflows/bp-agent-ecr.yaml
@@ -16,10 +16,10 @@ env:
RESPOSITORY: cloudbees-labs/tf-aws-cb-ci-eks-addon-agent
VERSION: latest
AWS_REGION: us-west-2
+ #TODO: Replace by rootless image when it is supported
DOCKERFILE: .docker/agent/agent.root.Dockerfile
jobs:
- #TODO: Verify if the repository is created before running this job. If not, create it (including tags).
build_and_push_images:
steps:
- name: Checkout code
@@ -36,7 +36,6 @@ jobs:
id: login-ecr
uses: cloudbees-io/configure-ecr-credentials@v1
- #TODO: Replace by rootless image when it is supported
- name: Build, tag, and push docker image to Amazon ECR
uses: cloudbees-io/kaniko@v1
with:
diff --git a/.cloudbees/workflows/bp-tf-cd.yaml b/.cloudbees/workflows/bp-tf-cd.yaml
deleted file mode 100644
index a2153a70..00000000
--- a/.cloudbees/workflows/bp-tf-cd.yaml
+++ /dev/null
@@ -1,257 +0,0 @@
-# Copyright (c) CloudBees, Inc.
-
-# Stages
-# CD: deploy,validate,onboarding
-# Nuke: wipeout
-
-apiVersion: automation.cloudbees.io/v1alpha1
-kind: workflow
-name: ci
-
-on:
- workflow_dispatch:
-
-env:
- AWS_REGION_TF_BUCKET: "us-east-1"
- BUCKET_NAME_TF_STATE: "cbci-eks-addon-tf-state-cd"
- AWS_ROLE_TO_ASSUME: "infra-admin-ci"
- TF_VAR_suffix: "ci-v11"
- TF_VAR_aws_region: "us-west-2"
- TF_AUTO_VARS_FILE: |
- tags = {
- "cb-owner" : "professional-services"
- "cb-user" : "cb-platform"
- "cb-purpose" : "cd"
- }
- trial_license = {
- first_name = "CloudBees.io"
- last_name = "Platform"
- email = "ci.user@cloudbees.io"
- company = "CloudBees Inc."
- }
- ci = true
-
-jobs:
- init:
- steps:
-
- - name: Configure AWS Credentials
- uses: cloudbees-io/configure-aws-credentials@v1
- with:
- aws-region: ${{ env.AWS_REGION_TF_BUCKET }}
- aws-access-key-id: ${{ secrets.AWS_TF_CBCI_EKS_AccessKeyID }}
- aws-secret-access-key: ${{ secrets.AWS_TF_CBCI_EKS_SecretAccessKey }}
- role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
- role-external-id: cloudbees
- role-duration-seconds: "3600"
-
- #TODO: Add tags for the bucket
- - name: Create Terraform Backend Bucket if not exists
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- shell: bash
- run: |
- set -x
- aws s3api create-bucket \
- --bucket ${{ env.BUCKET_NAME_TF_STATE }} \
- --region ${{ env.AWS_REGION_TF_BUCKET }} || echo "Bucket ${{ env.BUCKET_NAME_TF_STATE }} already exists"
-
- bp01:
- env:
- ROOT: 01-getting-started
- TF_VAR_hosted_zone: bp01-cd.aws.ps.beescloud.com
- STAGES: "wipeout"
- needs:
- - init
- steps:
-
- - name: Configure AWS Credentials
- uses: cloudbees-io/configure-aws-credentials@v1
- with:
- aws-region: ${{ env.TF_VAR_aws_region }}
- aws-access-key-id: ${{ secrets.AWS_TF_CBCI_EKS_AccessKeyID }}
- aws-secret-access-key: ${{ secrets.AWS_TF_CBCI_EKS_SecretAccessKey }}
- role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
- role-external-id: cloudbees
- role-duration-seconds: "3600"
-
- - name: Checkout code
- uses: cloudbees-io/checkout@v1
-
- - name: 01-getting-started - Set
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- shell: bash
- run : |
- cat <> blueprints/${{ env.ROOT }}/.auto.tfvars
- ${{ env.TF_AUTO_VARS_FILE }}
- EOT
- cat blueprints/${{ env.ROOT }}/.auto.tfvars
- cat <> blueprints/${{ env.ROOT }}/backend.tf
- terraform {
- backend "s3" {
- bucket = "${{ env.BUCKET_NAME_TF_STATE }}"
- key = "${{ env.ROOT }}/ci.terraform.tfstate"
- region = "${{ env.AWS_REGION_TF_BUCKET }}"
- }
- }
- EOT
-
- - name: 01-getting-started - Deploy
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'deploy')
- shell: bash
- run : |
- set -x
- aws kms delete-alias --alias-name alias/eks/cbci-bp01-${{ env.TF_VAR_suffix }}-eks --region ${{ env.TF_VAR_aws_region }} || echo "Alias alias/eks/cbci-bp01-${{ env.TF_VAR_suffix }}-eks does not exist"
- aws kms delete-alias --alias-name alias/eks/cbci-bp01-${{ env.TF_VAR_suffix }} --region ${{ env.TF_VAR_aws_region }} || echo "Alias alias/eks/cbci-bp01-${{ env.TF_VAR_suffix }} does not exist"
- CI=true make deploy
- aws s3api put-object \
- --bucket ${{ env.BUCKET_NAME_TF_STATE }} \
- --region ${{ env.AWS_REGION_TF_BUCKET }} \
- --key ${{ env.ROOT }}/${{ env.ROOT }}.terraform.output \
- --body blueprints/${{ env.ROOT }}/terraform.output
-
- - name: 01-getting-started - Validate
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'validate')
- shell: bash
- run : |
- CI=true make validate
-
- - name: 01-getting-started - Destroy
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'destroy')
- shell: bash
- run : |
- CI=true make destroy
-
- - name: 01-getting-started - Wipeout
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'wipeout')
- shell: bash
- run : |
- terraform -chdir=blueprints/${{ env.ROOT }} init -reconfigure && CI=true make destroy
-
- - name: 01-getting-started - Role Onboarding
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'onboarding')
- env:
- TARGET_ROLE: arn:aws:iam::324005994172:role/AWSReservedSSO_infra-admin_256addbf79cfacd1
- shell: bash
- run : |
- set -x
- cd blueprints/${{ env.ROOT }} && eval $(terraform output --raw kubeconfig_export)
- kubectl describe configmap aws-auth -n kube-system
- eksctl create iamidentitymapping \
- --cluster $(terraform output --raw eks_cluster_name) \
- --region ${{ env.TF_VAR_aws_region }} \
- --arn ${{ env.TARGET_ROLE }} \
- --username k8s-admin-rol \
- --group system:masters
- kubectl describe configmap aws-auth -n kube-system
-
- bp02:
- env:
- ROOT: 02-at-scale
- TF_VAR_hosted_zone: bp02-cd.aws.ps.beescloud.com
- STAGES: "wipeout"
- needs:
- - init
- steps:
-
- - name: Configure AWS Credentials
- uses: cloudbees-io/configure-aws-credentials@v1
- with:
- aws-region: ${{ env.TF_VAR_aws_region }}
- aws-access-key-id: ${{ secrets.AWS_TF_CBCI_EKS_AccessKeyID }}
- aws-secret-access-key: ${{ secrets.AWS_TF_CBCI_EKS_SecretAccessKey }}
- role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
- role-external-id: cloudbees
- role-duration-seconds: "3600"
-
- - name: Checkout code
- uses: cloudbees-io/checkout@v1
-
- - name: 02-at-scale - Set
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- shell: bash
- run : |
- cat <> blueprints/${{ env.ROOT }}/.auto.tfvars
- ${{ env.TF_AUTO_VARS_FILE }}
- dh_reg_secret_auth = {
- username = "${{ secrets.AWS_TF_CBCI_EKS_DHUser }}"
- password = "${{ secrets.AWS_TF_CBCI_EKS_DHPass }}"
- email = "${{ secrets.AWS_TF_CBCI_EKS_DHMail }}"
- }
- EOT
- cat blueprints/${{ env.ROOT }}/.auto.tfvars
- cat <> blueprints/${{ env.ROOT }}/backend.tf
- terraform {
- backend "s3" {
- bucket = "${{ env.BUCKET_NAME_TF_STATE }}"
- key = "${{ env.ROOT }}/ci.terraform.tfstate"
- region = "${{ env.AWS_REGION_TF_BUCKET }}"
- }
- }
- EOT
-
- - name: 02-at-scale - Deploy
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'deploy')
- shell: bash
- run : |
- set -x
- aws kms delete-alias --alias-name alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }}-eks --region ${{ env.TF_VAR_aws_region }} || echo "Alias alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }}-eks does not exist"
- aws kms delete-alias --alias-name alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }} --region ${{ env.TF_VAR_aws_region }} || echo "Alias alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }} does not exist"
- CI=true make deploy
- aws s3api put-object \
- --bucket ${{ env.BUCKET_NAME_TF_STATE }} \
- --region ${{ env.AWS_REGION_TF_BUCKET }} \
- --key ${{ env.ROOT }}/${{ env.ROOT }}.terraform.output \
- --body blueprints/${{ env.ROOT }}/terraform.output
- # TODO: Add vault init log to s3
- # cd blueprints/${{ env.ROOT }} && eval $(terraform output --raw kubeconfig_export)
- # cd blueprints/${{ env.ROOT }} && eval $(terraform output --raw vault_init)
- # aws s3api put-object \
- # --bucket ${{ env.BUCKET_NAME_TF_STATE }} \
- # --region ${{ env.AWS_REGION_TF_BUCKET }} \
- # --key ${{ env.ROOT }}/${{ env.ROOT }}.vault.init.log \
- # --body $(cd blueprints/${{ env.ROOT }} && terraform output --raw vault_init_log_file) || echo "No vault-init.log found"
-
- - name: 02-at-scale - Validate
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'validate')
- shell: bash
- run : |
- CI=true make validate
-
- - name: 02-at-scale - Destroy
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'destroy')
- shell: bash
- run : |
- CI=true make destroy
-
- - name: 02-at-scale - Wipeout
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'wipeout')
- shell: bash
- run : |
- terraform -chdir=blueprints/${{ env.ROOT }} init -reconfigure && CI=true make destroy
-
- - name: 02-at-scale - Role Onboarding
- uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
- if: contains(env.STAGES, 'onboarding')
- env:
- TARGET_ROLE: arn:aws:iam::324005994172:role/AWSReservedSSO_infra-admin_256addbf79cfacd1
- shell: bash
- run : |
- set -x
- cd blueprints/${{ env.ROOT }} && eval $(terraform output --raw kubeconfig_export)
- kubectl describe configmap aws-auth -n kube-system
- eksctl create iamidentitymapping \
- --cluster $(terraform output --raw eks_cluster_name) \
- --region ${{ env.TF_VAR_aws_region }} \
- --arn ${{ env.TARGET_ROLE }} \
- --username k8s-admin-rol \
- --group system:masters
- kubectl describe configmap aws-auth -n kube-system
diff --git a/.cloudbees/workflows/bp-tf-ci.yaml b/.cloudbees/workflows/bp-tf-ci.yaml
index f00812e1..292c0cfe 100644
--- a/.cloudbees/workflows/bp-tf-ci.yaml
+++ b/.cloudbees/workflows/bp-tf-ci.yaml
@@ -1,10 +1,5 @@
# Copyright (c) CloudBees, Inc.
-# Stages
-# CI: deploy,validate,destroy
-# Troubleshooting: deploy,validate,onboarding
-# Nuke (Delete Dangling resource): wipeout
-
apiVersion: automation.cloudbees.io/v1alpha1
kind: workflow
name: ci
@@ -19,10 +14,11 @@ on:
workflow_dispatch:
env:
- AWS_REGION_TF_BUCKET: "us-east-1"
- BUCKET_NAME_TF_STATE: "cbci-eks-addon-tf-state-ci"
+ BUCKET_NAME_TF_STATE: cbci-eks-addon-bp
+ AWS_REGION_TF_BUCKET: us-east-1
+ TAGS_TF_BUCKET: '[{Key=cb-owner,Value=professional-services},{Key=cb-user,Value=cb-platform},{Key=cb-purpose,Value=production shared cluster}]'
AWS_ROLE_TO_ASSUME: "infra-admin-ci"
- TF_VAR_suffix: "ci-v11"
+ TF_VAR_suffix: "ci"
TF_VAR_aws_region: "us-west-2"
TF_AUTO_VARS_FILE: |
tags = {
@@ -33,7 +29,7 @@ env:
trial_license = {
first_name = "CloudBees.io"
last_name = "Platform"
- email = "ci.user@cloudbees.io"
+ email = "ci.cbci.eks.bp@cloudbees.io"
company = "CloudBees Inc."
}
ci = true
@@ -58,15 +54,25 @@ jobs:
shell: bash
run: |
set -x
- aws s3api create-bucket \
- --bucket ${{ env.BUCKET_NAME_TF_STATE }} \
- --region ${{ env.AWS_REGION_TF_BUCKET }} || echo "Bucket ${{ env.BUCKET_NAME_TF_STATE }} already exists"
+ if aws s3api head-bucket --bucket ${{ env.BUCKET_NAME_TF_STATE }} 2>/dev/null; then
+ echo "Bucket ${{ env.BUCKET_NAME_TF_STATE }} already exists."
+ else
+ echo "Bucket ${{ env.BUCKET_NAME_TF_STATE }} does not exist. Creating now..."
+ aws s3api create-bucket --bucket ${{ env.BUCKET_NAME_TF_STATE }} \
+ --region ${{ env.AWS_REGION_TF_BUCKET }}
+ fi
+ aws s3api put-bucket-tagging --bucket ${{ env.BUCKET_NAME_TF_STATE }} \
+ --tagging 'TagSet=${{ env.TAGS_TF_BUCKET }}'
bp01:
env:
+ # Stages
+ # CI: deploy,validate,destroy
+ # Troubleshooting: deploy,validate,onboarding
+ # Nuke (Delete Dangling resource): wipeout
+ STAGES: "deploy,validate,destroy"
ROOT: 01-getting-started
TF_VAR_hosted_zone: bp01-ci.aws.ps.beescloud.com
- STAGES: "deploy,validate,destroy"
needs:
- init
steps:
@@ -96,30 +102,39 @@ jobs:
terraform {
backend "s3" {
bucket = "${{ env.BUCKET_NAME_TF_STATE }}"
- key = "${{ env.ROOT }}/ci.terraform.tfstate"
+ key = "${{ env.ROOT }}/ci/terraform.tfstate"
region = "${{ env.AWS_REGION_TF_BUCKET }}"
}
}
EOT
+ echo "Environment Variables:"
+ printenv
- name: 01-getting-started - Deploy
uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
if: contains(env.STAGES, 'deploy')
+ kind: build
shell: bash
run : |
set -x
- aws kms delete-alias --alias-name alias/eks/cbci-bp01-${{ env.TF_VAR_suffix }}-eks --region ${{ env.TF_VAR_aws_region }} || echo "Alias alias/eks/cbci-bp01-${{ env.TF_VAR_suffix }}-eks does not exist"
- aws kms delete-alias --alias-name alias/eks/cbci-bp01-${{ env.TF_VAR_suffix }} --region ${{ env.TF_VAR_aws_region }} || echo "Alias alias/eks/cbci-bp01-${{ env.TF_VAR_suffix }} does not exist"
+ # It Resolves Issue #66
+ aliases=("alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }}-eks" "alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }}")
+ for alias in "${aliases[@]}"; do
+ aws kms delete-alias \
+ --alias-name $alias \
+ --region ${{ env.TF_VAR_aws_region }} || echo "$alias does not exist"
+ done
CI=true make deploy
aws s3api put-object \
- --bucket ${{ env.BUCKET_NAME_TF_STATE }} \
- --region ${{ env.AWS_REGION_TF_BUCKET }} \
- --key ${{ env.ROOT }}/${{ env.ROOT }}.terraform.output \
- --body blueprints/${{ env.ROOT }}/terraform.output
+ --bucket "${{ env.BUCKET_NAME_TF_STATE }}" \
+ --region "${{ env.AWS_REGION_TF_BUCKET }}" \
+ --body blueprints/${{ env.ROOT }}/terraform.output \
+ --key ${{ env.ROOT }}/ci/${{ env.ROOT }}.terraform.output || echo "Failed to put $body object in ${{ env.BUCKET_NAME_TF_STATE }}"
- name: 01-getting-started - Validate
uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
if: contains(env.STAGES, 'validate')
+ kind: test
shell: bash
run : |
CI=true make validate
@@ -158,9 +173,13 @@ jobs:
bp02:
env:
+ # Stages
+ # CI: deploy,validate,destroy
+ # Troubleshooting: deploy,validate,onboarding
+ # Nuke (Delete Dangling resource): wipeout
+ STAGES: "deploy,validate,destroy"
ROOT: 02-at-scale
TF_VAR_hosted_zone: bp02-ci.aws.ps.beescloud.com
- STAGES: "deploy,validate,destroy"
needs:
- init
steps:
@@ -195,30 +214,39 @@ jobs:
terraform {
backend "s3" {
bucket = "${{ env.BUCKET_NAME_TF_STATE }}"
- key = "${{ env.ROOT }}/ci.terraform.tfstate"
+ key = "${{ env.ROOT }}/ci/terraform.tfstate"
region = "${{ env.AWS_REGION_TF_BUCKET }}"
}
}
EOT
+ echo "Environment Variables:"
+ printenv
- name: 02-at-scale - Deploy
uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
if: contains(env.STAGES, 'deploy')
+ kind: build
shell: bash
run : |
set -x
- aws kms delete-alias --alias-name alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }}-eks --region ${{ env.TF_VAR_aws_region }} || echo "Alias alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }}-eks does not exist"
- aws kms delete-alias --alias-name alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }} --region ${{ env.TF_VAR_aws_region }} || echo "Alias alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }} does not exist"
+ # It Resolves Issue #66
+ aliases=("alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }}-eks" "alias/eks/cbci-bp02-${{ env.TF_VAR_suffix }}")
+ for alias in "${aliases[@]}"; do
+ aws kms delete-alias \
+ --alias-name $alias \
+ --region ${{ env.TF_VAR_aws_region }} || echo "$alias does not exist"
+ done
CI=true make deploy
aws s3api put-object \
- --bucket ${{ env.BUCKET_NAME_TF_STATE }} \
- --region ${{ env.AWS_REGION_TF_BUCKET }} \
- --key ${{ env.ROOT }}/${{ env.ROOT }}.terraform.output \
- --body blueprints/${{ env.ROOT }}/terraform.output
+ --bucket "${{ env.BUCKET_NAME_TF_STATE }}" \
+ --region "${{ env.AWS_REGION_TF_BUCKET }}" \
+ --body blueprints/${{ env.ROOT }}/terraform.output \
+ --key ${{ env.ROOT }}/ci/${{ env.ROOT }}.terraform.output || echo "Failed to put $body object in ${{ env.BUCKET_NAME_TF_STATE }}"
- name: 02-at-scale - Validate
uses: docker://public.ecr.aws/r1n1q0e5/cloudbees-labs/tf-aws-cb-ci-eks-addon-agent:latest
if: contains(env.STAGES, 'validate')
+ kind: test
shell: bash
run : |
CI=true make validate
@@ -245,10 +273,10 @@ jobs:
shell: bash
run : |
set -x
- cd blueprints/${{ env.ROOT }} && eval $(terraform output --raw kubeconfig_export)
+ eval $(terraform -chdir="blueprints/${{ env.ROOT }}" output --raw --raw kubeconfig_export)
kubectl describe configmap aws-auth -n kube-system
eksctl create iamidentitymapping \
- --cluster $(terraform output --raw eks_cluster_name) \
+ --cluster $(terraform -chdir="blueprints/${{ env.ROOT }}" output --raw eks_cluster_name) \
--region ${{ env.TF_VAR_aws_region }} \
--arn ${{ env.TARGET_ROLE }} \
--username k8s-admin-rol \
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8c49e7ad..9918f5eb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -14,10 +14,10 @@ This document provides guidelines for contributing to the CloudBees CI add-on fo
- The `source` field in the `eks_blueprints_addon_cbci` at blueprints must point to the remote [terraform registry version](https://registry.terraform.io/modules/cloudbees/cloudbees-ci-eks-addon/aws/latest) and `version >= "x.x.x"`. It is important for the telemetry in https://registry.terraform.io/modules/cloudbees/cloudbees-ci-eks-addon/aws/latest.
- The CasC bundles SCM configuration must point to the https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon repository and its `main` branch.
- `develop` branch:
- - It is the integration branch and it is used for testing new features and updates before merging them into the `main` branch.
+ - It is the integration branch, and is used for testing new features and updates before merging them into the `main` branch.
- Requirements:
- - The `source` field in the `eks_blueprints_addon_cbci` in the blueprints folder must point to the local root of the https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon repository (for example, `source = "../../"`).
- - The CasC bundles SCM configuration must point to the https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon repository and its `develop` branch.
+ - The `source` field in the `eks_blueprints_addon_cbci` in the blueprints folder must point to the local root of the [terraform-aws-cloudbees-ci-eks-addon](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon) repository (for example, `source = "../../"`).
+ - The CasC bundles SCM configuration must point to the `develop` branch in the [terraform-aws-cloudbees-ci-eks-addon](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon) repository.
## Report bugs and feature requests
@@ -54,7 +54,7 @@ To submit a pull request:
7. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
> [!IMPORTANT]
-> If you make updates to embeded repository (e.g. CasC bundles), you must push the changes to the public upstream (repository/branch) before running `terraform apply` locally. The endpoint and/or branch can be updated via `set-casc-location` from the companion [Makefile](Makefile).
+> If you make updates to embedded repository (for example, CasC bundles), you must push the changes to the public upstream (repository/branch) before running `terraform apply` locally. The endpoint and/or branch can be updated via `set-casc-location` from the companion [Makefile](Makefile).
### Pre-commits: Linting, formatting and secrets scanning
@@ -73,7 +73,7 @@ Validate your pull request changes inside the blueprint agent described in the [
The [bp-tf-ci.yaml](.cloudbees/workflows/bp-tf-ci.yaml) blueprints are orchestrated into the [CloudBees platform](https://www.cloudbees.com/products/saas-platform) inside the [CloudBees Professional Services (PS) sub-organization](https://cloudbees.io/orgs/cloudbees~professional-services/components/94c50dcf-125e-4767-b9c5-58d6d669a1f6/runs).
> [!NOTE]
-> At the time of writing, the pipeline triggers on `push` events only and not for `pull_requests`. Although pull request event is supported, it is requires filters for file patters ()`*.tf`).
+> The pipeline triggers on `push` events only, and does not trigger for `pull_requests`. Although the `pull_requests` event is supported, it requires filters for file patters (for example, `*.tf`).
#### Prerequisites
@@ -82,7 +82,7 @@ The [bp-tf-ci.yaml](.cloudbees/workflows/bp-tf-ci.yaml) blueprints are orchestra
- AWS Route 53 zone name, to create DNS records.
> [!IMPORTANT]
-> CloudBees Platform currently only supports push events. Therefore, pull requests are sent to the `develop` branch for integration.
+> CloudBees platform currently only supports push events. Therefore, pull requests are sent to the `develop` branch for integration.
## Release
@@ -90,7 +90,7 @@ CloudBees CI Terraform EKS Addon versions try to be in sync with the [CloudBees
1. Ensure that `develop` branch follows its requisites from the [Design principles](#design-principles) section.
2. Test locally the (`develop`) for all the blueprints. Use the `test-all` target in the companion [Makefile](Makefile).
-3. Once all local tests passed successfully, create a PR against the `main` branch. **It requires to pass the COE Team validation**.
+3. Once all local tests passed successfully, create a PR against the `main` branch. It **must pass** the Center of Excellence (CoE) team validation.
4. Once the pull request is merged, update the `main` branch following its requisites from the [Design principles](#design-principles) section. The [Blueprint Terraform CI pipeline](#blueprint-terraform-ci-pipeline) must validate the changes.
5. Create a [new release](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/releases). The release version semantics follow the Helm chart convention.
diff --git a/Makefile b/Makefile
index 5af64978..c81d8d00 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ BP_AGENT_USER := bp-agent
MKFILEDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
CBCI_REPO ?= https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon.git
CBCI_BRANCH ?= main
-NUKE_DRY_RUN ?= true
+DESTROY_WL_ONLY ?= false
define helpers
source blueprints/helpers.sh && $(1)
@@ -57,13 +57,17 @@ endif
@$(call helpers,INFO "CloudBees CI Blueprint $(ROOT) Validation target finished succesfully.")
.PHONY: destroy
-destroy: ## Destroy Terraform Blueprint passed as parameter. Example: ROOT=02-at-scale make destroy
-destroy: tfChecks agentCheck
+destroy: ## Destroy Terraform Blueprint passed as parameter. Example: DESTROY_WL_ONLY=false ROOT=02-at-scale make destroy
+destroy: tfChecks agentCheck guard-DESTROY_WL_ONLY
ifeq ($(CI),false)
- @$(call helpers,ask-confirmation "Destroy $(ROOT)")
+ @$(call helpers,ask-confirmation "Destroy $(ROOT) with Destroy Workloads Only=$(DESTROY_WL_ONLY)")
endif
- @$(call helpers,tf-destroy $(ROOT) $(CBCI_ONLY))
- @$(call helpers,INFO "CloudBees CI Blueprint $(ROOT) Destroy target finished succesfully.")
+ifeq ($(DESTROY_WL_ONLY),false)
+ @$(call helpers,tf-destroy $(ROOT))
+else
+ @$(call helpers,tf-destroy-wl $(ROOT))
+endif
+ @$(call helpers,INFO "CloudBees CI Blueprint $(ROOT) Destroy target finished succesfully. Destroy Workloads Only=$(DESTROY_WL_ONLY)")
.PHONY: clean
clean: ## Clean Blueprint passed as parameter. Example: ROOT=02-at-scale make clean
@@ -77,7 +81,7 @@ clean: guard-ROOT agentCheck
.PHONY: test
test: ## Runs a test for blueprint passed as parameters throughout their Terraform Lifecycle. Example: ROOT=02-at-scale make test
-test: deploy validate destroy clean
+test: clean deploy validate destroy
@$(call helpers,INFO "Test target for $(ROOT) passed succesfully.")
.PHONY: test-all
@@ -102,15 +106,6 @@ set-cbci-location: agentCheck guard-CBCI_REPO guard-CBCI_BRANCH
@$(call helpers,set-cbci-location $(CBCI_REPO) $(CBCI_BRANCH))
@$(call helpers,INFO "Setting new Casc location to $(CBCI_REPO) $(CBCI_BRANCH) finished succesfully.")
-.PHONY: run-aws-nuke
-run-aws-nuke: ## Run aws nuke by https://github.com/rebuy-de/aws-nuke. Example: NUKE_DRY_RUN=true make run-aws-nuke
-run-aws-nuke: guard-NUKE_DRY_RUN
-ifeq ($(NUKE_DRY_RUN),false)
- @$(call helpers,ask-confirmation "Running AWS Nuke to destroy selected resources.")
-endif
- @$(call helpers,run-aws-nuke $(NUKE_DRY_RUN))
- @$(call helpers,INFO "AWS nuke finished successfully with DRY_RUN=$(NUKE_DRY_RUN).")
-
##########################
# Global
##########################
diff --git a/README.md b/README.md
index 1359fb05..a58f3aa8 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,14 @@
# CloudBees CI add-on for Amazon EKS blueprints
-
-
Deploy CloudBees CI to Amazon Web Services (AWS) Elastic Kubernetes Service (EKS) clusters
+
+
+
+
+
+
+
+Deploy CloudBees CI to Amazon Web Services (AWS) Elastic Kubernetes Service (EKS) clusters
---
@@ -24,7 +30,7 @@ The CloudBees CI [AWS partner add-on](https://aws-ia.github.io/terraform-aws-eks
## Usage
-Implementation examples are included in the [blueprints](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/tree/main/blueprints) folder, however this is the simplest example of usage:
+Implementation examples are included in the [blueprints](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/tree/main/blueprints) folder, however, this is the simplest example of usage:
```terraform
module "eks_blueprints_addon_cbci" {
@@ -81,6 +87,9 @@ The two main components of CloudBees CI - the operations center and managed cont
This module runs with a [trial license for CloudBees CI](https://docs.cloudbees.com/docs/cloudbees-ci-migration/latest/trial-guide/).
Once the trial has expired, refer to [CloudBees CI license expiration FAQ](https://docs.cloudbees.com/docs/general-kb/latest/faqs/jenkins-enterprise-license-expiration-faq) to determine your next steps.
+> [!NOTE]
+> This addon appends the string `[EKS_TF_ADDON]` to the Trial License last name for telemetry purposes.
+
## Compatibility
The CloudBees CI add-on uses `helms release` for its resources definition, making it compatible with [AWS EKS Blueprint v4](https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/v4.32.1) and [AWS EKS Blueprint v5](https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/v5.0.0). For more information, refer to [Amazon EKS Blueprints for Terraform: v4 to v5 migration](https://aws-ia.github.io/terraform-aws-eks-blueprints/v4-to-v5/motivation/).
@@ -100,8 +109,9 @@ The CloudBees CI add-on uses `helms release` for its resources definition, makin
| create_reg_secret | Create a Kubernetes dockerconfigjson secret for container registry authentication (cbci-sec-reg) for CI builds agents. | `bool` | `false` | no |
| helm_config | CloudBees CI Helm chart configuration. | `any` | { "values": [ "" ] } | no |
| prometheus_target | Creates a service monitor to discover the CloudBees CI Prometheus target dynamically. It is designed to be enabled with the AWS EKS Terraform Addon Kube Prometheus Stack. | `bool` | `false` | no |
+| prometheus_target_ns | Prometheus target namespace, designed to be enabled with the AWS EKS Terraform Addon Kube Prometheus Stack. It is required when prometheus_target is enabled. | `string` | `"observability"` | no |
| reg_secret_auth | Registry server authentication details for cbci-sec-reg secret. It is required when create_reg_secret is enabled. | `map(string)` | { "email": "foo.bar@acme.com", "password": "changeme1234", "server": "my-registry.acme:5000", "username": "foo" } | no |
-| reg_secret_ns | Agent namespace to allocate cbci-sec-reg secret. It is required when create_reg_secret is enabled. | `string` | `"cbci"` | no |
+| reg_secret_ns | Agent namespace to allocate the cbci-sec-reg secret. It is required when create_reg_secret is enabled. | `string` | `"cbci"` | no |
### Outputs
@@ -115,7 +125,7 @@ The CloudBees CI add-on uses `helms release` for its resources definition, makin
| cbci_oc_pod | Operations center pod for the CloudBees CI add-on. |
| cbci_oc_url | Operations center URL for the CloudBees CI add-on using a subdomain and certificates. |
| cbci_sec_casc | Optional. Kubernetes secrets name for CloudBees CI Casc. |
-| cbci_sec_registry | Optional. Kubernetes secrets name for CloudBees CI agents to autheticate to registry. |
+| cbci_sec_registry | Optional. Kubernetes secrets name for CloudBees CI agents to authenticate the registry. |
| merged_helm_config | (merged) Helm configuration for CloudBees CI. |
diff --git a/blueprints/.k8s.env b/blueprints/.k8s.env
index f3bab735..90468088 100644
--- a/blueprints/.k8s.env
+++ b/blueprints/.k8s.env
@@ -1,8 +1,9 @@
# Kubernetes #
# K8s version: https://kubernetes.io/releases/
# K8s support: https://docs.cloudbees.com/docs/cloudbees-common/latest/supported-platforms/cloudbees-ci-cloud#_kubernetes
-vK8=1.28
+vK8=1.29
# CloudBees CI Chart versions: https://artifacthub.io/packages/helm/cloudbees/cloudbees-core/
-vCBCI_Helm=3.18306.0+b5ad27c80a6b
+vCBCI_Helm=3.19313.0+1afe0458111d
# AWS Terraform EKS Blueprint Addons Module https://github.com/aws-ia/terraform-aws-eks-blueprints-addons/releases
-vEKSBpAddonsTFMod=1.15.1
+# Note: Validate cluster_autoscaler_image_tag contains the version of vK8
+vEKSBpAddonsTFMod=1.17.0
diff --git a/blueprints/01-getting-started/README.md b/blueprints/01-getting-started/README.md
index 0c11a238..dbee24e3 100644
--- a/blueprints/01-getting-started/README.md
+++ b/blueprints/01-getting-started/README.md
@@ -52,8 +52,8 @@ This blueprint presents the minimum setup to run CloudBees CI on Amazon EKS; one
| cbci_oc_url | URL of the CloudBees CI operations center for the CloudBees CI add-on. |
| eks_cluster_arn | Amazon EKS cluster ARN. |
| eks_cluster_name | Amazon EKS cluster Name. |
-| kubeconfig_add | Add kubeconfig to your local configuration to access the Kubernetes API. |
-| kubeconfig_export | Export the KUBECONFIG environment variable to access the Kubernetes API. |
+| kubeconfig_add | Adds kubeconfig to your local configuration to access the Kubernetes API. |
+| kubeconfig_export | Exports the KUBECONFIG environment variable to access the Kubernetes API. |
| vpc_arn | VPC ID. |
@@ -62,8 +62,8 @@ This blueprint presents the minimum setup to run CloudBees CI on Amazon EKS; one
When preparing to deploy, you must complete the following steps:
1. Customize your Terraform values by copying `.auto.tfvars.example` to `.auto.tfvars`.
-2. Initialize the root module and any associated configuration for providers.
-3. Create the resources and deploy CloudBees CI to an EKS cluster. Refer to [Amazon EKS Blueprints for Terraform - Deploy](https://aws-ia.github.io/terraform-aws-eks-blueprints/getting-started/#deploy).
+1. Initialize the root module and any associated configuration for providers.
+1. Create the resources and deploy CloudBees CI to an EKS cluster. Refer to [Amazon EKS Blueprints for Terraform - Deploy](https://aws-ia.github.io/terraform-aws-eks-blueprints/getting-started/#deploy).
For more information, refer to [The Core Terraform Workflow](https://www.terraform.io/intro/core-workflow) documentation.
@@ -94,13 +94,13 @@ Once you can access the Kubernetes API from your terminal, complete the followin
eval $(terraform output --raw cbci_oc_pod)
```
-2. Issue the following command to verify that the Ingress is ready and has assigned a valid `ADDRESS`:
+1. Issue the following command to verify that the Ingress is ready and has assigned a valid `ADDRESS`:
```sh
eval $(terraform output --raw cbci_oc_ing)
```
-3. Issue the following command to verify that the operations center service is running from inside the Kubernetes cluster:
+1. Issue the following command to verify that the operations center service is running from inside the Kubernetes cluster:
```sh
eval $(terraform output --raw cbci_liveness_probe_int)
@@ -108,7 +108,7 @@ Once you can access the Kubernetes API from your terminal, complete the followin
If the command is successful, no output is returned.
-4. Issue the following command to verify that the operations center service is running from outside the Kubernetes cluster:
+1. Issue the following command to verify that the operations center service is running from outside the Kubernetes cluster:
```sh
eval $(terraform output --raw cbci_liveness_probe_ext)
@@ -116,15 +116,15 @@ Once you can access the Kubernetes API from your terminal, complete the followin
If the command is successful, no output is returned.
-5. DNS propagation may take several minutes. Once propagation is complete, issue the following command, copy the output, and then paste it into a web browser.
+1. DNS propagation may take several minutes. Once propagation is complete, issue the following command, copy the output, and then paste it into a web browser.
```sh
terraform output cbci_oc_url
```
-6. Paste the output of the previous command into your browser to access the CloudBees CI setup wizard to complete the CloudBees CI operations center installation.
+1. Paste the output of the previous command into your browser to access the CloudBees CI setup wizard to complete the CloudBees CI operations center installation.
-7. Issue the following command to retrieve the first administrative user password (required):
+1. Issue the following command to retrieve the first administrative user password (required):
```sh
eval $(terraform output --raw cbci_initial_admin_password)
diff --git a/blueprints/01-getting-started/img/getting-started.k8s.drawio.svg b/blueprints/01-getting-started/img/getting-started.k8s.drawio.svg
index 2f732413..a9f00966 100644
--- a/blueprints/01-getting-started/img/getting-started.k8s.drawio.svg
+++ b/blueprints/01-getting-started/img/getting-started.k8s.drawio.svg
@@ -1,4 +1,4 @@
-
+
@@ -10,12 +10,12 @@
-
-
+
+
-
+
-
+
AWS Cloud
-
-
-
-
-
-
-
+
+
+
+
+
-
+
- EKS
+ Kubernetes cluster
+
+ on Amazon EKS
+
-
- EKS
+
+ Kubernetes...
-
-
-
+
+
+
-
+
-
+
Amazon EBS...
-
-
-
+
+
+
-
+
AWS
- Load Balancer
+ load balancer
@@ -97,17 +98,17 @@
-
+
AWS...
-
-
+
+
-
+
Amazon Route 53
@@ -117,20 +118,20 @@
-
+
Amazon Rout...
-
-
-
-
-
+
+
+
+
+
-
+
Application load
@@ -140,17 +141,17 @@
-
+
Applicatio...
-
-
+
+
-
+
-
+
Amazon E...
-
+
-
+
-
- kube-system
-
+ kube-system
-
+
kube-system
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
- external-dns
-
+ external-dns
-
+
external-dns
-
-
+
+
-
+
-
-
- cbci
-
+
+
+ CloudBees CI
+
-
- cbci
+
+ CloudBees CI
-
-
-
+
+
+
-
- cjoc
+
+ Operations center
+
diff --git a/blueprints/01-getting-started/k8s/extdns-values.yml b/blueprints/01-getting-started/k8s/extdns-values.yml
index 27f3dabd..9724a319 100644
--- a/blueprints/01-getting-started/k8s/extdns-values.yml
+++ b/blueprints/01-getting-started/k8s/extdns-values.yml
@@ -1,5 +1,5 @@
-#https://artifacthub.io/packages/helm/external-dns/external-dns
-#https://github.com/kubernetes-sigs/external-dns/tree/master/charts/external-dns/Chart.yaml
+# https://artifacthub.io/packages/helm/external-dns/external-dns
+# https://github.com/kubernetes-sigs/external-dns/tree/master/charts/external-dns/Chart.yaml
provider: "aws"
domainFilters: [ "${zoneDNS}" ]
policy: "sync"
diff --git a/blueprints/01-getting-started/main.tf b/blueprints/01-getting-started/main.tf
index a5589ef9..5749a035 100644
--- a/blueprints/01-getting-started/main.tf
+++ b/blueprints/01-getting-started/main.tf
@@ -31,8 +31,9 @@ locals {
# CloudBees CI Add-on
module "eks_blueprints_addon_cbci" {
- source = "cloudbees/cloudbees-ci-eks-addon/aws"
- version = ">= 3.18306.0"
+ #source = "cloudbees/cloudbees-ci-eks-addon/aws"
+ #version = ">= 3.18306.0"
+ source = "../../"
depends_on = [module.eks_blueprints_addons]
@@ -65,7 +66,7 @@ module "ebs_csi_driver_irsa" {
module "eks_blueprints_addons" {
source = "aws-ia/eks-blueprints-addons/aws"
#vEKSBpAddonsTFMod#
- version = "1.15.1"
+ version = "1.17.0"
cluster_name = module.eks.cluster_name
cluster_endpoint = module.eks.cluster_endpoint
@@ -112,7 +113,7 @@ module "eks" {
cluster_name = local.cluster_name
cluster_endpoint_public_access = true
#vK8#
- cluster_version = "1.28"
+ cluster_version = "1.29"
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
@@ -163,8 +164,8 @@ module "eks" {
}
}
- #https://docs.aws.amazon.com/eks/latest/userguide/choosing-instance-type.html
- #https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html
+ # https://docs.aws.amazon.com/eks/latest/userguide/choosing-instance-type.html
+ # https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html
eks_managed_node_groups = {
mg_start = {
node_group_name = "managed-start"
@@ -242,13 +243,13 @@ module "acm" {
source = "terraform-aws-modules/acm/aws"
version = "5.0.0"
- #Important: Application Services Hostname must be the same as the domain name or subject_alternative_names
+ # Important: Application Services Hostname must be the same as the domain name or subject_alternative_names
domain_name = var.hosted_zone
subject_alternative_names = [
"*.${var.hosted_zone}" # For subdomains example.${var.domain_name}
]
- #https://docs.aws.amazon.com/acm/latest/userguide/dns-validation.html
+ # https://docs.aws.amazon.com/acm/latest/userguide/dns-validation.html
zone_id = local.route53_zone_id
validation_method = "DNS"
@@ -269,8 +270,8 @@ module "vpc" {
enable_nat_gateway = true
single_nat_gateway = true
- #https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html
- #https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html
+ # https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html
+ # https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html
public_subnet_tags = {
"kubernetes.io/role/elb" = 1
}
diff --git a/blueprints/01-getting-started/outputs.tf b/blueprints/01-getting-started/outputs.tf
index 971a3474..50325dbe 100644
--- a/blueprints/01-getting-started/outputs.tf
+++ b/blueprints/01-getting-started/outputs.tf
@@ -1,10 +1,10 @@
output "kubeconfig_export" {
- description = "Export the KUBECONFIG environment variable to access the Kubernetes API."
+ description = "Exports the KUBECONFIG environment variable to access the Kubernetes API."
value = "export KUBECONFIG=${local.kubeconfig_file_path}"
}
output "kubeconfig_add" {
- description = "Add kubeconfig to your local configuration to access the Kubernetes API."
+ description = "Adds kubeconfig to your local configuration to access the Kubernetes API."
value = "aws eks update-kubeconfig --region ${var.aws_region} --name ${local.cluster_name}"
}
diff --git a/blueprints/02-at-scale/README.md b/blueprints/02-at-scale/README.md
index 286f4ce8..d89b4728 100644
--- a/blueprints/02-at-scale/README.md
+++ b/blueprints/02-at-scale/README.md
@@ -4,7 +4,7 @@ Once you have familiarized yourself with [CloudBees CI blueprint add-on: Get sta
- An [Amazon Elastic File System (Amazon EFS) drive](https://aws.amazon.com/efs/) that is required by CloudBees CI High Availability/Horizontal Scalability (HA/HS) controllers and is optional for non-HA/HS controllers.
- An [Amazon Simple Storage Service (Amazon S3) bucket](https://aws.amazon.com/s3/) to store assets from applications like CloudBees CI, Velero, and Fluent Bit.
-- [Amazon Elastic Kubernetes Service (Amazon EKS) managed node groups](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) for different workloads: shared services, CI applications, CI Linux on-demand agents, CI Linux spot agents, and CI Microsoft Windows on-demand agents.
+- [Amazon Elastic Kubernetes Service (Amazon EKS) managed node groups](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) for different workloads: shared services, CI applications, CI Linux on-demand agents, CI Linux Spot agents, and CI Microsoft Windows on-demand agents.
- [Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) to explode control plane logs and Fluent Bit logs.
- The following [Amazon EKS blueprints add-ons](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/):
@@ -13,22 +13,24 @@ Once you have familiarized yourself with [CloudBees CI blueprint add-on: Get sta
| [AWS EFS CSI Driver](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/aws-efs-csi-driver/)| Connects the Amazon Elastic File System (Amazon EFS) drive to the Amazon EKS cluster. |
| [AWS for Fluent Bit](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/aws-for-fluentbit/)| Acts as an applications log router for log observability in CloudWatch. |
| [Cluster Autoscaler](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/cluster-autoscaler/) | Watches Amazon EKS managed node groups to accomplish [CloudBees CI auto-scaling nodes on EKS](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/eks-auto-scaling-nodes). |
- | [Kube Prometheus Stack](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/kube-prometheus-stack/) | Used for metrics observability.|
+ | [Kube Prometheus Stack](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/kube-prometheus-stack/) | Observability backbone.|
| [Metrics Server](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/metrics-server/) | This is a requirement for CloudBees CI HA/HS controllers for horizontal pod autoscaling.|
| [Velero](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/velero/)| Backs up and restores Kubernetes resources and volume snapshots. It is only compatible with Amazon Elastic Block Store (Amazon EBS).|
- | [Bottlerocket Update Operator](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/bottlerocket/) | Coordinates Bottlerocket updates on hosts in a cluster. It is configured for CloudBees CI Applications and Agents Node Groups at a specific time according to `scheduler_cron_expression`, when the build workload is minimal (weekend). In a case where the CI service cannot be interrupted at any time by the Update Operator, it could be excluded from planned updates by removing the [bottlerocket.aws/updater-interface-version=2.0.0](https://github.com/bottlerocket-os/bottlerocket-update-operator#label-nodes) label.|
+ | [Bottlerocket Update Operator](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/bottlerocket/) | Coordinates Bottlerocket updates on hosts in a cluster. It is configured for CloudBees CI Applications and Agents Node Groups at a specific time according to `scheduler_cron_expression`, when the build workload is minimal (for example, on the weekend). In a case where the CI service cannot be interrupted at any time by the Update Operator, it could be excluded from planned updates by removing the [bottlerocket.aws/updater-interface-version=2.0.0](https://github.com/bottlerocket-os/bottlerocket-update-operator#label-nodes) label. [Cert-manager](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/cert-manager/) is required for the API server to use a CA certificate when communicating over SSL with the agents. |
-- [Amazon EKS blueprints Helm Release Add-on](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/helm-release/) is used to install the following applications:
+- [Amazon EKS blueprints Helm Release add-on](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/helm-release/) is used to install the following applications:
| Helm Chart | Description |
|-------------------------------|-------------|
| [Helm Openldap](https://github.com/jp-gouin/helm-openldap/tree/master) | LDAP server for Kubernetes. |
| [AWS Node Termination Handler](https://github.com/aws/aws-node-termination-handler) | Gracefully handles EC2 instance shutdown within Kubernetes. Note that this add-on is not compatible with managed instance groups. For more information, refer to [issue #23](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/issues/23). |
- | [Grafana Tempo](https://grafana.com/oss/tempo/) | Provides backend tracing for [Jenkins OpenTelemetry](https://plugins.jenkins.io/opentelemetry/). |
| [Hashicorp Vault](https://github.com/hashicorp/vault-helm) | Secrets management system that is integrated via [CloudBees HashiCorp Vault Plugin](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-secure-guide/hashicorp-vault-plugin). |
+ | [OTEL collector](https://grafana.com/oss/tempo/) | The collector for [Jenkins OpenTelemetry](https://plugins.jenkins.io/opentelemetry/) observability data. |
+ | [Jagger](https://www.jaegertracing.io/) | Provides tracing backend for [Jenkins OpenTelemetry](https://plugins.jenkins.io/opentelemetry/). |
+ | [Grafana Loki](https://grafana.com/oss/loki/) | Provides logs backend for [Jenkins OpenTelemetry](https://plugins.jenkins.io/opentelemetry/). |
- Cloudbees CI uses [Configuration as Code (CasC)](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-oc/casc-intro) (refer to the [casc](cbci/casc) folder) to enable [exciting new features for streamlined DevOps](https://www.cloudbees.com/blog/cloudbees-ci-exciting-new-features-for-streamlined-devops) and other enterprise features, such as [CloudBees CI hibernation](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/managing-controllers#hibernation-managed-controllers).
- - The operations center is using the [CasC Bundle Retriever](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-oc/bundle-retrieval-scm).
+ - The CloudBees operations center is using the [CasC Bundle Retriever](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-oc/bundle-retrieval-scm).
- Managed controller configurations are managed from the operations center using [source control management (SCM)](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-controller/add-bundle#_adding_casc_bundles_from_an_scm_tool).
- The managed controllers are using [CasC bundle inheritance](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-controller/advanced#_configuring_bundle_inheritance_with_casc) (refer to the [parent](cbci/casc/mc/parent) folder). This "parent" bundle is inherited by two types of "child" controller bundles: `ha` and `none-ha`, to accommodate [considerations about HA controllers](https://docs.cloudbees.com/docs/cloudbees-ci/latest/ha/ha-considerations).
@@ -43,13 +45,14 @@ This blueprint divides scalable node groups for different types of workloads:
- CloudBees CI node groups:
- CI services (role: `cb-apps`):
- Services instance type: [AWS Graviton Processor](https://aws.amazon.com/ec2/graviton/) and [Bottlerocket OS](https://aws.amazon.com/bottlerocket/) AMI type.
- - It uses an [instance profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) for operating with AWS services permissions (for example, S3 buckets). However, the recommended options are explained in [Issue 56](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/issues/56).
+ - Regarding storage classes, no HA/HS controllers use `gp3-aza` (an Amazon EBS type which is tightened to Availability Zone A to avoid issue [#195](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/issues/195)) or HA/HS controller `efs`.
- CI agents (ephemeral):
- Linux: [AWS Graviton Processor](https://aws.amazon.com/ec2/graviton/) and [Bottlerocket OS](https://aws.amazon.com/bottlerocket/) AMI type and includes on-demand (role: `build-linux`) and Spot (role: `build-linux-spot`) capacity types. The Spot agent node groups follow the principles described in [Building for Cost Optimization and Resilience for EKS with Spot Instances](https://aws.amazon.com/blogs/compute/cost-optimization-and-resilience-eks-with-spot-instances/).
+ - Amazon Elastic Container Registry (Amazon ECR) authentication is done via [instance profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) connected to `build-linux-spot` node pools.
- Windows (role: `build-windows`): Windows 2019 AMI type.
> [!IMPORTANT]
-> The launch time for Linux containers is faster than Windows containers. This can be improved by using a cache container image strategy. Refer to [Speeding up Windows container launch times with EC2 Image builder and image cache strategy](https://aws.amazon.com/blogs/containers/speeding-up-windows-container-launch-times-with-ec2-image-builder-and-image-cache-strategy/) and more about [Windows Container Best Practices](https://aws.github.io/aws-eks-best-practices/windows/docs/ami/)). Another potential alternative is to use Windows VMs with a [shared agent](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/shared-agents).
+> The launch time for Linux containers is faster than Windows containers. This can be improved by using a cache container image strategy. Refer to [Speeding up Windows container launch times with EC2 Image builder and image cache strategy](https://aws.amazon.com/blogs/containers/speeding-up-windows-container-launch-times-with-ec2-image-builder-and-image-cache-strategy/) and more about [Windows Container Best Practices](https://aws.github.io/aws-eks-best-practices/windows/docs/ami/). Another potential alternative is to use Windows VMs with a [shared agent](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/shared-agents).
![Architecture](img/at-scale.architect.drawio.svg)
@@ -57,7 +60,12 @@ This blueprint divides scalable node groups for different types of workloads:
![K8sApps](img/at-scale.k8s.drawio.svg)
-## Terraform Docs
+CloudBees CI Services uses [Pod identity](https://aws.amazon.com/blogs/aws/amazon-eks-pod-identity-simplifies-iam-permissions-for-applications-on-amazon-eks-clusters/) adquire permissions to operate with an AWS s3 services for backup, restore and cache operations.
+
+> [!IMPORTANT]
+> Known issues: Operation Center pod requires to be recreated to get injected AWS credentials.
+
+## Terraform documentation
### Inputs
@@ -66,9 +74,9 @@ This blueprint divides scalable node groups for different types of workloads:
|------|-------------|------|---------|:--------:|
| hosted_zone | Amazon Route 53 hosted zone. CloudBees CI applications are configured to use subdomains in this hosted zone. | `string` | n/a | yes |
| trial_license | CloudBees CI trial license details for evaluation. | `map(string)` | n/a | yes |
-| aws_region | AWS region to deploy resources to. It requires at minimun 3 AZs. | `string` | `"us-west-2"` | no |
+| aws_region | AWS region to deploy resources to. It requires a minimum of three availability zones. | `string` | `"us-west-2"` | no |
| ci | Running in a CI service versus running locally. False when running locally, true when running in a CI service. | `bool` | `false` | no |
-| dh_reg_secret_auth | Docker Hub Registry server authentication details for cbci-sec-reg secret. | `map(string)` | { "email": "foo.bar@acme.com", "password": "changeme1234", "username": "foo" } | no |
+| dh_reg_secret_auth | Docker Hub registry server authentication details for cbci-sec-reg secret. | `map(string)` | { "email": "foo.bar@acme.com", "password": "changeme1234", "username": "foo" } | no |
| suffix | Unique suffix to assign to all resources. When adding the suffix, changes are required in CloudBees CI for the validation phase. | `string` | `""` | no |
| tags | Tags to apply to resources. | `map(string)` | `{}` | no |
@@ -79,6 +87,7 @@ This blueprint divides scalable node groups for different types of workloads:
| acm_certificate_arn | AWS Certificate Manager (ACM) certificate for Amazon Resource Names (ARN). |
| aws_backup_efs_protected_resource | AWS description for the Amazon EFS drive that is used to back up protected resources. |
| aws_logstreams_fluentbit | AWS CloudWatch log streams from Fluent Bit. |
+| aws_region | AWS region. |
| cbci_agent_linuxtempl_events | Retrieves a list of events related to Linux template agents. |
| cbci_agent_sec_reg | Retrieves the container registry secret deployed in the agents namespace. |
| cbci_agent_windowstempl_events | Retrieves a list of events related to Windows template agents. |
@@ -100,20 +109,22 @@ This blueprint divides scalable node groups for different types of workloads:
| efs_access_points | Amazon EFS access points. |
| efs_arn | Amazon EFS ARN. |
| eks_cluster_arn | Amazon EKS cluster ARN. |
-| eks_cluster_name | Amazon EKS cluster Name. |
+| eks_cluster_name | Amazon EKS cluster name. |
| global_password | Random string that is used as the global password. |
-| grafana_dashboard | Provides access to Grafana dashboards. |
-| kubeconfig_add | Add kubeconfig to the local configuration to access the Kubernetes API. |
-| kubeconfig_export | Export the KUBECONFIG environment variable to access the Kubernetes API. |
-| prometheus_active_targets | Checks active Prometheus targets from the operations center. |
+| grafana_url | Grafana URL. |
+| kubeconfig_add | Adds kubeconfig to the local configuration to access the Kubernetes API. |
+| kubeconfig_export | Exports the KUBECONFIG environment variable to access the Kubernetes API. |
+| loki_labels | Lists all labels ingested in Loki. |
+| prometheus_active_targets | Checks active Prometheus targets from the CloudBees operations center. |
| prometheus_dashboard | Provides access to Prometheus dashboards. |
| s3_cbci_arn | CloudBees CI Amazon S3 bucket ARN. |
| s3_cbci_name | CloudBees CI Amazon S3 bucket name. It is required by CloudBees CI for workspace caching and artifact management. |
| s3_list_objects | Recursively lists all objects stored in the Amazon S3 bucket. |
-| vault_configure | Configure Vault with initial secrets and creates approle for integration with CloudBees CI (role-id and secret-id). It requires unseal keys and the root token from the vault_init output. |
+| tempo_tags | Lists all tags ingested in Tempo. |
+| vault_configure | Configures the vault with initial secrets and creates the application role for integration with CloudBees CI (role-id and secret-id). It requires unseal keys and the root token from the vault_init output. |
| vault_dashboard | Provides access to Hashicorp Vault dashboard. It requires the root token from the vault_init output. |
-| vault_init | Inicialization of Vault Service. |
-| vault_init_log_file | Vault Inicialization log file. |
+| vault_init | Initialization of the vault service. |
+| vault_init_log_file | Vault initialization log file. |
| velero_backup_on_demand | Takes an on-demand Velero backup from the schedule for the selected controller that is using block storage. |
| velero_backup_schedule | Creates a Velero backup schedule for the selected controller that is using block storage, and then deletes the existing schedule, if it exists. |
| velero_restore | Restores the selected controller that is using block storage from a backup. |
@@ -132,8 +143,8 @@ This blueprint uses [DockerHub](https://hub.docker.com/) as a container registry
When preparing to deploy, you must complete the following steps:
1. Customize your Terraform values by copying `.auto.tfvars.example` to `.auto.tfvars`.
-2. Initialize the root module and any associated configuration for providers.
-3. Create the resources and deploy CloudBees CI to an EKS cluster. Refer to [Amazon EKS Blueprints for Terraform - Deploy](https://aws-ia.github.io/terraform-aws-eks-blueprints/getting-started/#deploy).
+1. Initialize the root module and any associated configuration for providers.
+1. Create the resources and deploy CloudBees CI to an EKS cluster. Refer to [Amazon EKS Blueprints for Terraform - Deploy](https://aws-ia.github.io/terraform-aws-eks-blueprints/getting-started/#deploy).
For more information, refer to [The Core Terraform Workflow](https://www.terraform.io/intro/core-workflow) documentation.
@@ -152,13 +163,12 @@ Once the resources have been created, a `kubeconfig` file is created in the [/k8
eval $(terraform output --raw kubeconfig_export)
```
- If the command is successful, no output is returned.
+If the command is successful, no output is returned.
### CloudBees CI
1. Complete the steps to [validate CloudBees CI](../01-getting-started/README.md#cloudbees-ci), if you have not done so already.
-
-2. Authentication in this blueprint is based on LDAP using the `cn` user (available in [k8s/openldap-stack-values.yml](./k8s/openldap-stack-values.yml)) and the global password. The authorization level defines a set of permissions configured using [RBAC](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-secure-guide/rbac). Additionally, the operations center and controller use [single sign-on (SS0)](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-secure-guide/using-sso), including a [fallback mechanism](https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/operations-center/how-ldap-plugin-works-on-cjoc-sso-context) that is enabled by default. Issue the following command to retrieve the global password (valid for all users):
+1. Authentication in this blueprint is based on LDAP using the `cn` user (available in [k8s/openldap-stack-values.yml](./k8s/openldap-stack-values.yml)) and the global password. The authorization level defines a set of permissions configured using [RBAC](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-secure-guide/rbac). Additionally, the operations center and controller use [single sign-on (SS0)](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-secure-guide/using-sso), including a [fallback mechanism](https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/operations-center/how-ldap-plugin-works-on-cjoc-sso-context) that is enabled by default. Issue the following command to retrieve the global password (valid for all users):
```sh
eval $(terraform output --raw global_password)
@@ -166,7 +176,7 @@ Once the resources have been created, a `kubeconfig` file is created in the [/k8
There are differences in CloudBees CI permissions and folder restrictions when signed in as a user of the Admin group versus the Development group. For example, only Admin users have access to the agent validation jobs.
-3. CasC is enabled for the [operations center](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-oc/) (`cjoc`) and [controllers](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-controller/) (`team-b` and `team-c-ha`). `team-a` is not using CasC, to illustrate the difference between the two approaches. Issue the following command to verify that all controllers are running:
+1. CasC is enabled for the [operations center](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-oc/) (`cjoc`) and [controllers](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-controller/) (`team-b` and `team-c-ha`). `team-a` is not using CasC, to illustrate the difference between the two approaches. Issue the following command to verify that all controllers are running:
```sh
eval $(terraform output --raw cbci_controllers_pods)
@@ -174,7 +184,7 @@ Once the resources have been created, a `kubeconfig` file is created in the [/k8
If successful, it should indicate that 2 replicas are running for `team-c-ha` since [CloudBees CI HA/HS](https://docs.cloudbees.com/docs/cloudbees-ci/latest/ha-install-guide/) is enabled on this controller.
-4. Issue the following command to verify that horizontal pod autoscaling is enabled for `team-c-ha`:
+1. Issue the following command to verify that horizontal pod autoscaling is enabled for `team-c-ha`:
```sh
eval $(terraform output --raw cbci_controller_c_hpa)
@@ -184,11 +194,11 @@ Once the resources have been created, a `kubeconfig` file is created in the [/k8
##### Kubernetes secret
-This blueprint Kubernetes secrets for different purposes.
+This blueprint uses Kubernetes secrets for different purposes.
> [!NOTE]
-> - Beyond the CloudBees CI add-on (used for demo purposes), Kubernetes secrets can be managed via [External Secret Operators](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/external-secrets/).
-> - Kubernetes secrets could be also be retrived as Jenkins Credentials via using the [Kubernetes Credentials Provider plugin](https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/).
+> - Beyond the CloudBees CI add-on that is used for demo purposes, Kubernetes secrets can be managed via [External Secret Operators](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/external-secrets/).
+> - Kubernetes secrets can be also be retrieved as Jenkins credentials using the [Kubernetes Credentials Provider plugin](https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/).
###### CasC secrets
@@ -203,7 +213,7 @@ DockerHub authentication is stored as Kubernetes secrets (`cbci-agent-sec-reg`)
```
> [!NOTE]
-> ECR authentication is done via instance profile connected to `build-linux-spot` Node pools.
+> Amazon Elastic Container Registry (Amazon ECR) authentication is done via an instance profile connected to `build-linux-spot` node pools.
##### HashiCorp Vault
@@ -215,13 +225,13 @@ HashiCorp Vault is used as a credential provider for CloudBees CI Pipelines in t
eval $(terraform output --raw vault_init)
```
-2. Run the configure Hashicorp Vault script. It configures Vault with initial secrets and creates `approle` for integration with CloudBees CI (role-id and secret-id)
+1. Run the configure Hashicorp Vault script. It configures Vault with initial secrets and creates `approle` for integration with CloudBees CI (role-id and secret-id)
```sh
eval $(terraform output --raw vault_configure)
```
-3. Access the HashiCorp Vault UI by issuing the following command. Enter the root token to log in from the _step 1_.
+1. Access the HashiCorp Vault UI by issuing the following command. Enter the root token to log in from the _step 1_.
```sh
eval $(terraform output --raw vault_dashboard)
@@ -229,13 +239,13 @@ HashiCorp Vault is used as a credential provider for CloudBees CI Pipelines in t
If successful, the Vault web service should be available at `http://localhost:50003` and you can view the secrets that were created in _step 2_.
-4. Sign in to the CloudBees CI operations center as a user with the admin role.
+1. Sign in to the CloudBees CI operations center as a user with the admin role.
-5. Navigate to **Manage Jenkins > Credentials Providers > HashiCorp Vault Credentials Provider** and complete the configuration for the CloudBees CI Vault Plugin by entering the role ID and secret ID for the `cbci-oc` application role from _step 1_.
+1. Navigate to **Manage Jenkins > Credentials Providers > HashiCorp Vault Credentials Provider** and complete the configuration for the CloudBees CI Vault Plugin by entering the role ID and secret ID for the `cbci-oc` application role from _step 1_.
-6. Select **Test Connection** to verify the inputs are correct.
+1. Select **Test Connection** to verify the inputs are correct.
-7. Move to `team-b` or `team-c-ha` to run the Pipeline (**admin > validations > vault-credentials**) and validate that credentials are fetched correctly from the Hashicorp Vault.
+1. Move to `team-b` or `team-c-ha` to run the Pipeline (**admin > validations > vault-credentials**) and validate that credentials are fetched correctly from the Hashicorp Vault.
> [!NOTE]
> Hashicorp Vault can be also be configured to be used for [Configuration as Code - Handling Secrets - Vault](https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/docs/features/secrets.adoc#hashicorp-vault-secret-source).
@@ -258,7 +268,7 @@ HashiCorp Vault is used as a credential provider for CloudBees CI Pipelines in t
eval $(terraform output --raw cbci_liveness_probe_ext)
```
-2. Once you have retrieved the API token, issue the following commands to trigger builds using the [POST queue for hibernation API endpoint](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/managing-controllers#_post_queue_for_hibernation). If successful, an `HTTP/2 201` response is returned, indicating the REST API call has been correctly received by the CloudBees CI controller.
+1. Once you have retrieved the API token, issue the following commands to trigger builds using the [POST queue for hibernation API endpoint](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/managing-controllers#_post_queue_for_hibernation). If successful, an `HTTP/2 201` response is returned, indicating the REST API call has been correctly received by the CloudBees CI controller.
- For Linux node pools use:
@@ -282,17 +292,17 @@ HashiCorp Vault is used as a credential provider for CloudBees CI Pipelines in t
Note that the first build for a new Windows image container can take up to 10 minutes to run; subsequent builds should take seconds to run. This behavior can be improved, as explained in the section [Architecture](#architecture).
-3. Right after triggering the builds, issue the following to validate pod agent provisioning to build the Pipeline code:
+1. Right after triggering the builds, issue the following to validate pod agent provisioning to build the Pipeline code:
```sh
eval $(terraform output --raw cbci_agents_pods)
```
-4. Check build logs by signing in to the `team-b` and `team-c-ha` controllers, respectively. Navigate to the Pipeline jobs and select the first build, indicated by the `#1` build number. [CloudBees Pipeline Explorer](https://docs.cloudbees.com/docs/cloudbees-ci/latest/pipelines/cloudbees-pipeline-explorer-plugin) is enabled by default.
+1. Check build logs by signing in to the `team-b` and `team-c-ha` controllers, respectively. Navigate to the Pipeline jobs and select the first build, indicated by the `#1` build number. [CloudBees Pipeline Explorer](https://docs.cloudbees.com/docs/cloudbees-ci/latest/pipelines/cloudbees-pipeline-explorer-plugin) is enabled by default.
##### Container Registry
-This blueprints use a couple of container registries for different purposes.
+This blueprint use a couple of container registries for different purposes:
- The public registry uses DockerHub.
- The private registry uses AWS ECR.
@@ -300,10 +310,12 @@ This blueprints use a couple of container registries for different purposes.
> [!NOTE]
> Other Container Registry services can be used for the same purposes.
-Sign in to the CloudBees CI to `team-b` or `team-c-ha` controllers with admin access. Run the **admin > validations > kaniko** Pipeline and enter (using parameters) an existing DockerHub organization and an existing AWS ECR Repository to test that building and pushing to all repositories works as expected.
+1. In the CloudBees CI UI, sign in to the `team-b` or `team-c-ha` controllers with admin access.
+1. Navigate to the **admin > validations > kaniko** Pipeline.
+1. Using parameters, enter an existing DockerHub organization and an existing Amazon ECR repository to test that building and pushing to all repositories works as expected.
> [!NOTE]
-> Besides Kaniko, there are [other alternitives tools](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/using-kaniko#_alternatives).
+> Besides Kaniko, there are [other alternative tools](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/using-kaniko#_alternatives) for building images in K8s.
#### Back up and restore
@@ -312,8 +324,8 @@ For backup and restore operations, you can use the [preconfigured CloudBees CI C
[Velero](#create-a-velero-backup-schedule) is an alternative for services only for controllers using Amazon EBS. Velero commands and configuration in this blueprint follow [Using Velero back up and restore Kubernetes cluster resources](https://docs.cloudbees.com/docs/cloudbees-ci/latest/backup-restore/velero-dr).
> [!NOTE]
-> - An installation that has been completely converted to CasC may not need traditional backups; a restore operation could consist simply of running a CasC bootstrap script. This is only an option for a customer who has translated every significant system setting and job configuration to CasC. Even then it may be desirable to perform a filesystem-level restore from backup in order to preserve transient data such as build history.
-> - There is no alternative for services using Amazon EFS storage. Although [AWS Backup](https://aws.amazon.com/backup/) includes this Amazon EFS drive as a protected resource, there is not currently a best practice to dynamically restore Amazon EFS PVCs. For more information, refer to [Issue 39](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/issues/39).
+> - An installation that has been completely converted to CasC may not need traditional backups; a restore operation could consist simply of running a CasC bootstrap script. This is only an option if you have translated every significant system setting and job configuration to CasC. Even then, it may be desirable to perform a filesystem-level restore from backup to preserve transient data, such as build history.
+> - There is no alternative for services using Amazon EFS storage. Although [AWS Backup](https://aws.amazon.com/backup/) includes the Amazon EFS drive as a protected resource, there is not currently a best practice to dynamically restore Amazon EFS PVCs. For more information, refer to [Issue 39](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/issues/39).
##### Create daily backups using a CloudBees CI Cluster Operations job
@@ -322,8 +334,8 @@ The [CloudBees Backup plugin](https://docs.cloudbees.com/docs/cloudbees-ci/lates
To view the **backup-all-controllers** job:
1. Sign in to the CloudBees CI operations center UI as a user with **Administer** privileges. Note that access to back up jobs is restricted to admin users via RBAC.
-2. From the operations center dashboard, select **All** to view all folders on the operations center.
-3. Navigate to the **admin** folder, and then select the **backup-all-controllers** Cluster Operations job.
+1. From the operations center dashboard, select **All** to view all folders on the operations center.
+1. Navigate to the **admin** folder, and then select the **backup-all-controllers** Cluster Operations job.
Restore operations can be done on-demand at the controller level from the preconfigured restore job.
@@ -356,12 +368,14 @@ Issue the following command to restore the controller from the last backup:
### Observability
-#### Metrics and Tracing
+> [!IMPORTANT]
+> Regarding the observability stack described in the following sections, note that the CloudBees Prometheus plugin is a CloudBees Tier 1 plugin, while the Jenkins OpenTelemetry plugin is a Tier 3 plugin. For more information, refer to the [CloudBees plugin support policies](https://docs.cloudbees.com/docs/cloudbees-common/latest/plugin-support-policies).
+
+#### Metrics
-Grafana is used to visualize and query:
+Prometheus is used to store metrics that are retrieved from the [Jenkins Metrics plugin](https://plugins.jenkins.io/metrics/) and the [Jenkins OpenTelemetry plugin](https://github.com/jenkinsci/opentelemetry-plugin/blob/main/docs/monitoring-metrics.md).
-- [Jenkins Metrics](https://plugins.jenkins.io/metrics/) that are stored in Prometheus.
-- [Jenkins Tracing via OpenTelemetry](https://plugins.jenkins.io/opentelemetry/) that stored into Grafana Tempo.
+Grafana imports Prometheus as a datasource and provides metrics dashboards for CloudBees CI.
1. Issue the following command to verify that the CloudBees CI targets are connected to Prometheus:
@@ -369,55 +383,71 @@ Grafana is used to visualize and query:
eval $(terraform output --raw prometheus_active_targets) | jq '.data.activeTargets[] | select(.labels.container=="jenkins") | {job: .labels.job, instance: .labels.instance, status: .health}'
```
-2. Issue the following command to access Kube Prometheus Stack dashboards from your web browser and verify that [Jenkins metrics](https://plugins.jenkins.io/metrics/) are available.
+1. Issue the following command to access Kube Prometheus Stack dashboards from your web browser and verify that targets are correctly collecting metrics.
```sh
eval $(terraform output --raw prometheus_dashboard)
```
- If successful, the Prometheus web service is available at `http://localhost:50001` and you can view the configured alerts for CloudBees CI. Additionally, check _Status_ > _Targets_ shows targets in `UP` status.
+ If successful, the Prometheus web service is available at `http://localhost:50001` and you can view the configured alerts for CloudBees CI. Additionally, you can select **Status > Targets** to show targets with an `UP` status.
-3. Issue the following command to access Grafana dashboards at `localhost:50002`. For the username, use `admin` and set the password using the `global_password` terraform variable:
+1. Issue the following command to access the Grafana URL. For the username, use `admin` and set the password using the `global_password` terraform variable:
```sh
- eval $(terraform output --raw grafana_dashboard)
+ eval $(terraform output --raw grafana_url)
```
- If successful, the Grafana web service is available `http://localhost:50002`.
+1. To explore Metrics dashboards, navigate to **Home > Dashboards > CloudBees CI**, and then select the controller pod to view the metrics. The following image shows metrics for `team-b`:
- - For Jenkins Metrics Dashboards navigate to **Home > Dashboards > CloudBees CI**. Then, select the controller pod to view the metrics. The following image shows metrics for team-b.
+ ![CloudBees CI Metrics Dashboard](img/observability/cbci-metrics-dashboard.png)
- ![CloudBees CI Dashboard](img/observability/cbci-dashboard.png)
+##### Tracing
- - For Tracing Data, navigate to **Home > Explore > Select Tempo > Select `Query Type: Search`**. Then, select the `service name: jenkins` and the desired `Span Name` to `Run Query`. The following image shows an example of the ws-cache pipeline build.
+Tempo is used as the Tracing/APM backend for Jenkins tracing data via the Jenkins OpenTelemetry plugin: [HTTP](https://github.com/jenkinsci/opentelemetry-plugin/blob/main/docs/http-requests-traces.md) and [Jobs](https://github.com/jenkinsci/opentelemetry-plugin/blob/main/docs/job-traces.md).
- ![CloudBees CI Tracing Example](img/observability/cbci-tracing-example.png)
+Grafana imports Tempo as a datasource and provides tracing dashboards per a CI/CD pipeline Trace ID.
-> [!NOTE]
-> Grafana Ingress can be enabled as explained in Issue [#165](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/issues/165), but currently is incompatible with `terrafrom destroy`.
+In CloudBees CI, the Jenkins OpenTelemetry plugin is configured to use Grafana as a visualization backend. Then, it offers a **View pipeline with Grafana** link for every pipeline run, which redirects to Grafana Explorer using Tempo as a datasource and passing a Trace ID. Other system traces can be visualized in Grafana Explorer as well.
+
+![CloudBees CI Tracing Tempo](img/observability/cbci-tracing-tempo.png)
-#### Logs
+##### Logs
-For application logs, Fluent Bit acts as a router.
+###### Build Logs
-- Short-term application logs live in the [Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) group, under `/aws/eks//aws-fluentbit-logs` and contains log streams for all the Kubernetes services running in the cluster, including CloudBees CI applications and agents. The following image shows an example of team b controller logs.
+The recommended approach for build logs is using [CloudBees Pipeline Explorer](https://docs.cloudbees.com/docs/cloudbees-ci/latest/pipelines/cloudbees-pipeline-explorer-plugin).
+
+> [!IMPORTANT]
+> Although [pipeline build logs can be sent to external storage via the Jenkins OpenTelemetry plugin](https://github.com/jenkinsci/opentelemetry-plugin/blob/main/docs/build-logs.md), it is not compatible with CloudBees Pipeline Explorer.
+
+###### Container logs
+
+Fluent Bit acts as a router for container logs.
+
+- Short-term logs and log aggregation systems:
+
+ - [Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) group: Stores log streams for all the Kubernetes services running in the cluster, including CloudBees CI applications and agents in `/aws/eks//aws-fluentbit-logs`.
```sh
eval $(terraform output --raw aws_logstreams_fluentbit) | jq '.[] '
```
- ![CloudBees CI Logs Example](img/observability/cbci-fluenbit-example.png)
+ The following image shows an example of `team b` controller logs:
+
+ ![CloudBees CI logs from CloudWatch](img/observability/cbci-logs-cloudwatch.png)
+
+ - CloudWatch log group: Stores control plane logs in `/aws/eks/CLUSTER_NAME>/cluster`.
-- Long-term application logs live in an Amazon S3 bucket.
+ - [Loki](https://grafana.com/oss/loki/): In Grafana, navigate to the **Explore** section, select **Loki** as the datasource, filter by `com_cloudbees_cje_tenants`, and then select a CloudBees CI application log.
-For CloudBees CI build logs:
+ ![CloudBees CI logs from Loki](img/observability/cbci-logs-loki.png)
-- Short-term build logs live in the CloudBees CI controller and are managed using the [Build Discarder](https://plugins.jenkins.io/build-discarder/) Jenkins plugin, which is installed and configured using CasC.
-- Long-term logs can be handled (like any other artifact that is sent to an Amazon S3 bucket) using the [Artifact Manager on Amazon S3](https://plugins.jenkins.io/artifact-manager-s3/) Jenkins plugin, which is installed and configured by CasC.
+- Long-term logs are stored in an Amazon S3 bucket under the `fluentbit` path.
## Destroy
To tear down and remove the resources created in the blueprint, refer to [Amazon EKS Blueprints for Terraform - Destroy](https://aws-ia.github.io/terraform-aws-eks-blueprints/getting-started/#destroy).
> [!TIP]
-> The `destroy` phase can be orchestrated via the companion [Makefile](../../Makefile).
+> - To avoid [#165](https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/issues/165), run `kube-prometheus-destroy.sh` after destroying the EKS cluster.
+> - The `destroy` phase can be orchestrated via the companion [Makefile](../../Makefile).
diff --git a/blueprints/02-at-scale/cbci/casc/mc/ha/bundle.yaml b/blueprints/02-at-scale/cbci/casc/mc/ha/bundle.yaml
index dbb47c13..59927d65 100644
--- a/blueprints/02-at-scale/cbci/casc/mc/ha/bundle.yaml
+++ b/blueprints/02-at-scale/cbci/casc/mc/ha/bundle.yaml
@@ -7,3 +7,5 @@ allowCapExceptions: true
jcascMergeStrategy: "errorOnConflict"
jcasc:
- jcasc
+variables:
+ - variables
diff --git a/blueprints/02-at-scale/cbci/casc/mc/ha/jcasc/main.yaml b/blueprints/02-at-scale/cbci/casc/mc/ha/jcasc/main.yaml
index b5dbc48f..5e0ae815 100644
--- a/blueprints/02-at-scale/cbci/casc/mc/ha/jcasc/main.yaml
+++ b/blueprints/02-at-scale/cbci/casc/mc/ha/jcasc/main.yaml
@@ -1,3 +1,20 @@
unclassified:
globalDefaultFlowDurabilityLevel:
durabilityHint: MAX_SURVIVABILITY
+ globalLibraries:
+ libraries:
+ - defaultVersion: ${sharedLibBranch}
+ name: "common"
+ retriever:
+ modernSCM:
+ clone: true
+ libraryPath: ${sharedLibPath}
+ scm:
+ git:
+ remote: ${sharedLibRepo}
+ traits:
+ - cloneOption:
+ extension:
+ depth: 1
+ noTags: false
+ shallow: true
diff --git a/blueprints/02-at-scale/cbci/casc/mc/ha/variables/variables.yaml b/blueprints/02-at-scale/cbci/casc/mc/ha/variables/variables.yaml
new file mode 100644
index 00000000..4930abbf
--- /dev/null
+++ b/blueprints/02-at-scale/cbci/casc/mc/ha/variables/variables.yaml
@@ -0,0 +1,4 @@
+variables:
+ - sharedLibRepo: "https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon.git"
+ - sharedLibBranch: develop
+ - sharedLibPath: "blueprints/02-at-scale/cbci/shared-lib"
diff --git a/blueprints/02-at-scale/cbci/casc/mc/none-ha/bundle.yaml b/blueprints/02-at-scale/cbci/casc/mc/none-ha/bundle.yaml
index 750e7631..69ededd1 100644
--- a/blueprints/02-at-scale/cbci/casc/mc/none-ha/bundle.yaml
+++ b/blueprints/02-at-scale/cbci/casc/mc/none-ha/bundle.yaml
@@ -7,3 +7,5 @@ allowCapExceptions: true
jcascMergeStrategy: "errorOnConflict"
jcasc:
- jcasc
+variables:
+ - variables
diff --git a/blueprints/02-at-scale/cbci/casc/mc/none-ha/jcasc/main.yaml b/blueprints/02-at-scale/cbci/casc/mc/none-ha/jcasc/main.yaml
index 265cf97b..b413baa0 100644
--- a/blueprints/02-at-scale/cbci/casc/mc/none-ha/jcasc/main.yaml
+++ b/blueprints/02-at-scale/cbci/casc/mc/none-ha/jcasc/main.yaml
@@ -1,3 +1,15 @@
unclassified:
globalDefaultFlowDurabilityLevel:
durabilityHint: PERFORMANCE_OPTIMIZED
+ globalLibraries:
+ libraries:
+ - defaultVersion: ${sharedLibBranch}
+ name: "common"
+ retriever:
+ modernSCM:
+ libraryPath: ${sharedLibPath}
+ scm:
+ git:
+ remote: ${sharedLibRepo}
+ cachingConfiguration:
+ refreshTimeMinutes: 0
diff --git a/blueprints/02-at-scale/cbci/casc/mc/none-ha/variables/variables.yaml b/blueprints/02-at-scale/cbci/casc/mc/none-ha/variables/variables.yaml
new file mode 100644
index 00000000..4930abbf
--- /dev/null
+++ b/blueprints/02-at-scale/cbci/casc/mc/none-ha/variables/variables.yaml
@@ -0,0 +1,4 @@
+variables:
+ - sharedLibRepo: "https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon.git"
+ - sharedLibBranch: develop
+ - sharedLibPath: "blueprints/02-at-scale/cbci/shared-lib"
diff --git a/blueprints/02-at-scale/cbci/casc/mc/parent/items/admin-folder.yaml b/blueprints/02-at-scale/cbci/casc/mc/parent/items/admin-folder.yaml
index a407cf25..d0ef8f69 100644
--- a/blueprints/02-at-scale/cbci/casc/mc/parent/items/admin-folder.yaml
+++ b/blueprints/02-at-scale/cbci/casc/mc/parent/items/admin-folder.yaml
@@ -216,9 +216,13 @@ items:
sandbox: true
script: |
pipeline {
+ options {
+ retry(3)
+ timeout(time: 1, unit: 'HOURS')
+ }
agent any
environment {
- U1=credentials('cbci-oc-secret-a')
+ U1=credentials('cbci-oc_secret-a')
S1=credentials('cbci-oc_secret-b')
}
stages {
@@ -244,6 +248,10 @@ items:
@Library('common') _
pipeline {
+ options {
+ retry(3)
+ timeout(time: 1, unit: 'HOURS')
+ }
agent {
label 'linux-mavenAndKaniko-XL'
}
diff --git a/blueprints/02-at-scale/cbci/casc/mc/parent/jcasc/k8s-agents.yaml b/blueprints/02-at-scale/cbci/casc/mc/parent/jcasc/k8s-agents.yaml
index 882410ca..5752c18f 100644
--- a/blueprints/02-at-scale/cbci/casc/mc/parent/jcasc/k8s-agents.yaml
+++ b/blueprints/02-at-scale/cbci/casc/mc/parent/jcasc/k8s-agents.yaml
@@ -48,12 +48,13 @@ kube:
path: config.json
nodeSelector:
kubernetes.io/os: linux
- role: "build-linux"
+ role: "build-linux-l"
+ size: "2x"
tolerations:
- effect: "NoSchedule"
key: "dedicated"
operator: "Equal"
- value: "build-linux"
+ value: "build-linux-l"
- name: "linux-mavenAndKaniko-XL"
label: "linux-mavenAndKaniko-XL"
nodeUsageMode: "NORMAL"
@@ -114,12 +115,13 @@ kube:
path: config.json
nodeSelector:
kubernetes.io/os: linux
- role: "build-linux-spot"
+ role: "build-linux-xl"
+ size: "4x"
tolerations:
- effect: "NoSchedule"
key: "dedicated"
operator: "Equal"
- value: "build-linux-spot"
+ value: "build-linux-xl"
- name: "windows-powershell"
label: "windows-powershell"
yaml: |-
diff --git a/blueprints/02-at-scale/cbci/casc/mc/parent/jcasc/main.yaml b/blueprints/02-at-scale/cbci/casc/mc/parent/jcasc/main.yaml
index 301da1c9..d672234c 100644
--- a/blueprints/02-at-scale/cbci/casc/mc/parent/jcasc/main.yaml
+++ b/blueprints/02-at-scale/cbci/casc/mc/parent/jcasc/main.yaml
@@ -36,18 +36,14 @@ unclassified:
gracePeriod: 3600
openTelemetry:
endpoint: ${ot_endpoint}
+ observabilityBackends:
+ - grafana:
+ grafanaBaseUrl: ${sec_grafana_url}
+ tempoDataSourceIdentifier: ${tempoDatasource}
+ #Note: Not compatible with CPE
+ #grafanaLogsBackend: "grafanaLogsBackendBackendWithLogMirroringInJenkins"
cascItemsConfiguration:
variableInterpolationEnabledForAdmin: true
- globalLibraries:
- libraries:
- - defaultVersion: ${sharedLibBranch}
- name: "common"
- retriever:
- modernSCM:
- libraryPath: ${sharedLibPath}
- scm:
- git:
- remote: ${sharedLibRepo}
aws:
awsCredentials:
region: "${sec_awsRegion}"
diff --git a/blueprints/02-at-scale/cbci/casc/mc/parent/variables/variables.yaml b/blueprints/02-at-scale/cbci/casc/mc/parent/variables/variables.yaml
index 37fe9a7f..80977cdd 100644
--- a/blueprints/02-at-scale/cbci/casc/mc/parent/variables/variables.yaml
+++ b/blueprints/02-at-scale/cbci/casc/mc/parent/variables/variables.yaml
@@ -1,7 +1,5 @@
variables:
- - ot_endpoint: "http://tempo.kube-prometheus-stack.svc.cluster.local:4317"
+ - ot_endpoint: "http://otel-collector-opentelemetry-collector.observability.svc.cluster.local:4317"
- s3bucketPreffix: "cbci"
- regSecretsName: "cbci-sec-reg"
- - sharedLibRepo: "https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon.git"
- - sharedLibBranch: main
- - sharedLibPath: "blueprints/02-at-scale/cbci/shared-lib"
+ - tempoDatasource: "tempoDatasource"
diff --git a/blueprints/02-at-scale/cbci/casc/oc/items/admin-folder.yaml b/blueprints/02-at-scale/cbci/casc/oc/items/admin-folder.yaml
index 00735694..475cc726 100644
--- a/blueprints/02-at-scale/cbci/casc/oc/items/admin-folder.yaml
+++ b/blueprints/02-at-scale/cbci/casc/oc/items/admin-folder.yaml
@@ -72,12 +72,9 @@ items:
- jobConfigurationSubject: {
}
- systemConfigurationSubject:
- omitMasterKey: false
+ omitMasterKey: true
format:
- zipFormat: {
- }
- retentionPolicy:
- noRetentionPolicy: {
+ tarGzFormat: {
}
safeDelaySeconds: 0
store:
@@ -85,9 +82,40 @@ items:
bucketName: "${sec_s3bucketName}"
bucketFolder: "${s3bucketPreffix}/backup"
region: "${sec_awsRegion}"
+ retentionPolicy:
+ upToNRetentionPolicy:
+ n: 5
itemSource:
jenkinsRootItemSource: {
}
filters:
- isMasterOnlineFilter: {
}
+ - kind: backupAndRestore
+ name: backup-cjoc
+ triggers:
+ - cron:
+ spec: '@daily'
+ buildersList:
+ - backupBuilder:
+ subjects:
+ - buildRecordSubject: {
+ }
+ - jobConfigurationSubject: {
+ }
+ - systemConfigurationSubject:
+ omitMasterKey: true
+ format:
+ tarGzFormat: {
+ }
+ exclusive: false
+ store:
+ s3Store:
+ bucketName: "${sec_s3bucketName}"
+ bucketFolder: "${s3bucketPreffix}/backup"
+ region: "${sec_awsRegion}"
+ retentionPolicy:
+ upToNRetentionPolicy:
+ n: 5
+ safeDelaySeconds: 0
+ concurrentBuild: false
diff --git a/blueprints/02-at-scale/cbci/casc/oc/items/root.yaml b/blueprints/02-at-scale/cbci/casc/oc/items/root.yaml
index 9a0be7ca..9f2f4646 100644
--- a/blueprints/02-at-scale/cbci/casc/oc/items/root.yaml
+++ b/blueprints/02-at-scale/cbci/casc/oc/items/root.yaml
@@ -9,7 +9,7 @@ items:
kubernetes:
memory: 2048
cpus: 1.0
- disk: 20
+ disk: 10
storageClassName: "gp3"
# Casc, Non-HA
- kind: managedController
@@ -53,7 +53,7 @@ items:
"cloudbees.prometheus": "true"
properties:
- configurationAsCode:
- bundle: "main/none-ha"
+ bundle: "develop/none-ha"
# Casc, HA
- kind: managedController
name: team-c-ha
@@ -62,6 +62,7 @@ items:
memory: 6144
cpus: 2.0
disk: 5
+ storageClassName: "efs"
replication:
config:
maxReplicas: 4
@@ -100,4 +101,4 @@ items:
"cloudbees.prometheus": "true"
properties:
- configurationAsCode:
- bundle: "main/ha"
+ bundle: "develop/ha"
diff --git a/blueprints/02-at-scale/cbci/casc/oc/jcasc/main.yaml b/blueprints/02-at-scale/cbci/casc/oc/jcasc/main.yaml
index 36a52eb3..a6f3c506 100644
--- a/blueprints/02-at-scale/cbci/casc/oc/jcasc/main.yaml
+++ b/blueprints/02-at-scale/cbci/casc/oc/jcasc/main.yaml
@@ -1,6 +1,7 @@
jenkins:
systemMessage: "${message}"
- numExecutors: 0
+ # Setting 1 executor for Backup OC
+ numExecutors: 1
unclassified:
cascItemsConfiguration:
variableInterpolationEnabledForAdmin: true
@@ -32,7 +33,7 @@ unclassified:
logRotator:
numToKeepStr: "3"
cloudBeesCasCServer:
- defaultBundle: "main/none-ha"
+ defaultBundle: ${cascBranch}/none-ha
visibility: true
beekeeper:
enabled: true
@@ -55,9 +56,9 @@ masterprovisioning:
kind: "StatefulSet"
spec:
template:
- spec:
- tolerations:
- - key: "dedicated"
- operator: "Equal"
- value: "cb-apps"
- effect: "NoSchedule"
+ spec:
+ tolerations:
+ - key: "dedicated"
+ operator: "Equal"
+ value: "cb-apps"
+ effect: "NoSchedule"
diff --git a/blueprints/02-at-scale/cbci/casc/oc/variables/variables.yaml b/blueprints/02-at-scale/cbci/casc/oc/variables/variables.yaml
index 5d887643..82f69637 100644
--- a/blueprints/02-at-scale/cbci/casc/oc/variables/variables.yaml
+++ b/blueprints/02-at-scale/cbci/casc/oc/variables/variables.yaml
@@ -1,7 +1,7 @@
variables:
- message: "Welcome to the CloudBees CI blueprint add-on: At scale!"
- cascRepo: "https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon.git"
- - cascBranch: main
+ - cascBranch: develop
- cascPathController: "/blueprints/02-at-scale/cbci/casc/mc/"
- ldapManagerDN: "cn=admin,dc=acme,dc=org"
- ldapRootDN: "dc=acme,dc=org"
diff --git a/blueprints/02-at-scale/img/at-scale.architect.drawio.svg b/blueprints/02-at-scale/img/at-scale.architect.drawio.svg
index 1561c961..0a76581c 100644
--- a/blueprints/02-at-scale/img/at-scale.architect.drawio.svg
+++ b/blueprints/02-at-scale/img/at-scale.architect.drawio.svg
@@ -1,4 +1,4 @@
-
+
@@ -22,70 +22,124 @@
-
-
+
+
-
-
-
- Region
+
-
- Region
+
+ AWS Cloud
-
-
+
+
-
-
-
-
- Custom VPC
-
+
-
- Custom VPC
+
+ Availability zone a
-
-
+
+
-
+
+
+
+ Availability zone c
+
+
+
+
+
+ Availability zone c
+
+
+
+
+
+
+
+
+
+
+
+ Availability zone b
+
+
+
+
+
+ Availability zone b
+
+
+
+
+
+
+
+
+
+
+
+ Region
+
+
+
+
+
+
+
+
+
-
- AWS Cloud
+
+ Custom VPC
-
- AWS Cloud
+
+ Custom VPC
-
-
+
+
-
+
Amazon Route 53
@@ -95,17 +149,17 @@
-
+
Amazon Rou...
-
-
+
+
-
+
K8s Cluster
@@ -115,17 +169,17 @@
-
+
K8s Cluste...
-
-
+
+
-
+
Amazon EFS
@@ -133,17 +187,17 @@
-
+
Amazon EFS
-
-
+
+
-
+
Amazon S3 bucket
@@ -151,17 +205,17 @@
-
+
Amazon S3...
-
-
+
+
-
+
CloudWatch
@@ -169,17 +223,17 @@
-
+
CloudWatch
-
-
+
+
-
+
Application load
@@ -189,16 +243,16 @@
-
+
Application...
-
+
-
+
Text
@@ -206,17 +260,17 @@
-
+
Text
-
-
+
+
-
+
AWS certificate
@@ -226,18 +280,18 @@
-
+
AWS certif...
-
-
-
+
+
+
-
+
-
+
Internet...
-
-
+
+
-
+
Amazon EBS
- gp3
+ gp3-aza
-
+
Amazon EB...
-
-
+
+
-
+
Public subnet
@@ -288,17 +342,17 @@
-
+
Public subnet
-
-
+
+
-
+
NAT
@@ -308,17 +362,17 @@
-
+
NAT...
-
-
+
+
-
+
Private Subnet
@@ -326,17 +380,17 @@
-
+
Private Subnet
-
-
+
+
-
+
shared
@@ -344,35 +398,17 @@
-
+
shared
-
-
+
+
-
-
-
- build-lin...
-
-
-
-
-
-
-
-
-
+
cb-apps
@@ -380,98 +416,40 @@
-
+
cb-apps
-
-
-
-
-
-
-
-
- Availability zone 1
-
-
-
-
-
- Availability zone 1
-
-
-
-
-
-
+
+
-
+
-
-
- build-win...
-
-
-
-
-
-
-
-
-
-
- build-lin...
-
-
-
-
-
-
-
-
-
-
-
-
-
Amazon EBS
- gp3
+ gp3-azb
-
+
Amazon EB...
-
-
+
+
-
+
Public subnet
@@ -479,17 +457,17 @@
-
+
Public subnet
-
-
+
+
-
+
NAT
@@ -499,17 +477,17 @@
-
+
NAT...
-
-
+
+
-
+
Private Subnet
@@ -517,17 +495,17 @@
-
+
Private Subnet
-
-
+
+
-
+
shared
@@ -535,35 +513,17 @@
-
+
shared
-
-
+
+
-
-
-
- build-lin...
-
-
-
-
-
-
-
-
-
+
cb-apps
@@ -571,55 +531,16 @@
-
+
cb-apps
-
-
-
-
-
-
-
-
- Availability zone 2
-
-
-
-
-
- Availability zone 2
-
-
-
-
-
-
-
-
-
-
-
-
-
- build-windows
-
-
-
-
-
-
- build-win...
-
-
-
-
+
-
+
build-linux-spot
@@ -627,42 +548,42 @@
-
+
build-lin...
-
-
-
-
+
+
+
+
-
+
Amazon EBS
- gp3
+ gp3-azc
-
+
Amazon EB...
-
-
+
+
-
+
Public subnet
@@ -670,17 +591,17 @@
-
+
Public subnet
-
-
+
+
-
+
NAT
@@ -690,17 +611,17 @@
-
+
NAT...
-
-
+
+
-
+
Private Subnet
@@ -708,17 +629,17 @@
-
+
Private Subnet
-
-
+
+
-
+
shared
@@ -726,35 +647,17 @@
-
+
shared
-
-
-
-
-
-
-
-
- build-lin...
-
-
-
-
-
+
+
-
+
cb-apps
@@ -762,75 +665,76 @@
-
+
cb-apps
-
-
+
-