Skip to content

Commit

Permalink
Merge pull request #18 from cloudbees/02-at-scale
Browse files Browse the repository at this point in the history
Adding Blueprint 02-At Scale
  • Loading branch information
carlosrodlop committed Dec 18, 2023
2 parents e9ba08c + ee454e1 commit 9776473
Show file tree
Hide file tree
Showing 22 changed files with 693 additions and 32 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/terraform-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ jobs:
output-method: inject
git-push: true

- name: Render documentation for `getting-started/v4` example and push changes back to branch
- name: Render documentation for `01-getting-started` example and push changes back to branch
uses: terraform-docs/gh-actions@f6d59f89a280fa0a3febf55ef68f146784b20ba0 # v1.0.0
with:
config-file: "../../../.terraform-docs.yml"
config-file: ".terraform-docs.yml"
output-file: "README.md"
git-push: true
working-dir: "./blueprints/getting-started/v4"
working-dir: "./blueprints/01-getting-started"

- name: Render documentation for `getting-started/v5` example and push changes back to branch
- name: Render documentation for `02-at-scale` example and push changes back to branch
uses: terraform-docs/gh-actions@f6d59f89a280fa0a3febf55ef68f146784b20ba0 # v1.0.0
with:
config-file: "../../../.terraform-docs.yml"
config-file: ".terraform-docs.yml"
output-file: "README.md"
git-push: true
working-dir: "./blueprints/getting-started/v5"
working-dir: "./blueprints/02-at-scale"
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document provides guidelines for contributing to the module.

Validate your changes inside the blueprint agent described in the [Dockerfile](blueprints/Dockerfile). which is using tooling listed in the [asdf](https://asdf-vm.com/) [tool-versions](blueprints/.tool-versions).

> **_NOTE:_** The agent and dependecies can be automated via [Makefile](../../Makefile) at the root of the project under the target `dRun`.
> **_NOTE:_** The agent and dependecies can be automated via [Makefile](Makefile) at the root of the project under the target `dRun`.
## Pre-commits: Linting, Formatting and Secrets Scanning

Expand All @@ -21,4 +21,4 @@ Run `pre-commit run --all-files`

## Release Drafter

This repository uses [Release Drafter](https://github.com/release-drafter/release-drafter) thus it is recommended to use [Semantic Commit Messages](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716) to ease labelling your Pull Request accordingly.
This repository uses [Release Drafter](https://github.com/release-drafter/release-drafter) do not forget to label Pull Request accordingly.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ If you would like to override any defaults with the chart, you can do so by pass

Easing adoption of CloudBees CI by:

- Provide just the terraform code to deploy [CloudBees CI in EKS](https://docs.cloudbees.com/docs/cloudbees-ci/latest/eks-install-guide/) on top of the [AWS Terraform EKS Addons](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/) maintained by AWS.
- Providing the HCL code to deploy [CloudBees CI in EKS](https://docs.cloudbees.com/docs/cloudbees-ci/latest/eks-install-guide/).
- Using [AWS Terraform EKS Addons](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/) as the single point of truth for the required/recommended EKS Addons.
- Provide a series of blueprints to deploy [CloudBees CI in EKS](https://docs.cloudbees.com/docs/cloudbees-ci/latest/eks-install-guide/).

## License
## CloudBees License

This module runs with a [Trial License for CloudBees CI](https://docs.cloudbees.com/docs/cloudbees-ci-migration/latest/trial-guide/).

Expand All @@ -36,7 +36,7 @@ CloudBees CI Add-on uses for its resources definition `helms release` which make
| cert_arn | Certificate ARN from AWS ACM | `string` | n/a | yes |
| hostname | Route53 Hosted zone name | `string` | n/a | yes |
| temp_license | Temporary license details | `map(string)` | n/a | yes |
| helm_config | CloudBees CI Helm chart configuration | `any` | `{}` | no |
| helm_config | CloudBees CI Helm chart configuration | `any` | <pre>{<br> "values": [<br> ""<br> ]<br>}</pre> | no |

### Outputs

Expand Down
13 changes: 4 additions & 9 deletions blueprints/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
kubectl 1.28.3
awscli 2.11.21
terraform 1.5.1
terraform-docs 0.16.0
tfupdate 0.6.5
pre-commit 3.3.2
shfmt 3.6.0
shellcheck 0.9.0
terraform-ls 0.30.3
kubectl 1.29.0
awscli 2.15.2
terraform 1.6.6
k9s 0.29.1
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# CloudBees CI Add-on getting started Blueprint

Get started with the CloudBees CI add-on by reviewing this example which deploys the minimum set of resources to install [CloudBees CI on EKS](https://docs.cloudbees.com/docs/cloudbees-ci/latest/eks-install-guide/) following its [prerequisites](https://docs.cloudbees.com/docs/cloudbees-ci/latest/eks-install-guide/installing-eks-using-helm#_prerequisites):
Get started with the CloudBees CI add-on by reviewing this example which deploys the **minimum set of required resources** to install [CloudBees CI on EKS](https://docs.cloudbees.com/docs/cloudbees-ci/latest/eks-install-guide/) following its [prerequisites](https://docs.cloudbees.com/docs/cloudbees-ci/latest/eks-install-guide/installing-eks-using-helm#_prerequisites):

- AWS Certificate Manager
- [AWS Load Balancer Controller](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/aws-load-balancer-controller/)
- [External DNS](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/external-dns/)

Additionally, it deploys the [EBS CSI Driver](https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html) to allocate EBS volumes for hosting [$JENKINS_HOME](https://docs.cloudbees.com/docs/cloudbees-ci/latest/backup-restore/jenkins-home).

The code in this directory demonstrates its compatibility 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) (Additional info on [v4 to v5 migration guide](https://aws-ia.github.io/terraform-aws-eks-blueprints/v4-to-v5/motivation/)).

- [v4](v4/README.md)
- [v5](v5/README.md)

## Prerequisites

### Tooling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data "aws_route53_zone" "this" {
data "aws_availability_zones" "available" {}

locals {
name = "cbci-start-v5-i${random_integer.ramdom_id.result}"
name = "cbci-bp01-i${random_integer.ramdom_id.result}"
region = "us-east-1"

vpc_name = "${local.name}-vpc"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions blueprints/02-at-scale/.auto.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
domain_name = "example.domain.com" # Required. Domain name used by the CloudBees CI instance.

temp_license = { # Required. Temporary license details.
first_name = "Foo"
last_name = "Bar"
email = "[email protected]"
company = "Acme Inc."
}

# tags = { # Optional. Tags for the resources created. Default set to empty. Shared among all.
# "cb-owner" : "professional-services"
# "cb-user" : "crodriguezlopez"
# "cb-environment" : "demo"
# }
59 changes: 59 additions & 0 deletions blueprints/02-at-scale/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# CloudBees CI Add-on at scale Blueprint

Once you have familiarized yourself with the [Getting Started blueprint](../01-getting-started/README.md), this blueprint presents a more scalable architecture adding the following features to the previous blueprint:

- [Cluster Autoscaler](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/cluster-autoscaler/)
<!-- - [Node Termination Handler](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/aws-node-termination-handler/) -->
- [EFS CSI Driver](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/aws-efs-csi-driver/). CloudBees CI HA/HS requirement.
- [Metrics Server](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/addons/aws-efs-csi-driver/). CloudBees CI HA/HS requirement for Horizontal Pod Autoscaling.

Additionally, it uses [CloudBees Configuration as Code](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-oc/casc-intro) for configuring the [Operation Center](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-oc/) and [Controllers](https://docs.cloudbees.com/docs/cloudbees-ci/latest/casc-controller/).

## Prerequisites

Refer to the [Getting Started Blueprint - Prerequisites](../01-getting-started/README.md#prerequisites) section.

## Terraform Docs

<!-- BEGIN_TF_DOCS -->
### Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| domain_name | Desired domain name (e.g. example.com) used as suffix for CloudBees CI subdomains (e.g. cjoc.example.com). It requires to be mapped within an existing Route 53 Hosted Zone. | `string` | n/a | yes |
| temp_license | Temporary license details | `map(string)` | n/a | yes |
| tags | Tags to apply to resources | `map(string)` | `{}` | no |

### Outputs

| Name | Description |
|------|-------------|
| acm_certificate_arn | ACM certificate ARN |
| cjoc_url | URL of the CloudBees CI Operations Center |
| eks_bp_addon_cbci_helm | Helm configuration for CloudBees CI Add-on. It is accesible only via state files. |
| eks_bp_addon_cbci_initial_admin_password | Operation Center Service Initial Admin Password for CloudBees CI Add-on. |
| eks_bp_addon_cbci_liveness_probe_ext | Operation Center Service External Liveness Probe for CloudBees CI Add-on. |
| eks_bp_addon_cbci_liveness_probe_int | Operation Center Service Internal Liveness Probe for CloudBees CI Add-on. |
| eks_bp_addon_cbci_namepace | Namespace for CloudBees CI Add-on. |
| eks_bp_addon_cbci_oc_ing | Operation Center Ingress for CloudBees CI Add-on. |
| eks_bp_addon_cbci_oc_pod | Operation Center Pod for CloudBees CI Add-on. |
| eks_cluster_arn | EKS cluster ARN |
| export_kubeconfig | Export KUBECONFIG environment variable to access the EKS cluster. |
| vpc_arn | VPC ID |
<!-- END_TF_DOCS -->

## Deploy

Refer to the [Getting Started Blueprint - Prerequisites](../01-getting-started/README.md#deploy) section.

## Validate

Refer to the [Getting Started Blueprint - Prerequisites](../01-getting-started/README.md#validate) section.

## Destroy

Refer to the [Getting Started Blueprint - Prerequisites](../01-getting-started/README.md#destroy) section.

## Architecture

![Architecture]()
25 changes: 25 additions & 0 deletions blueprints/02-at-scale/cbci-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) CloudBees, Inc.

#https://artifacthub.io/packages/helm/cloudbees/cloudbees-core/
#https://docs.cloudbees.com/docs/cloudbees-ci/latest/eks-install-guide/installing-eks-using-helm

OperationsCenter:
Ingress:
Annotations:
alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true
NodeSelector:
ci_type: cb-apps
Tolerations:
- key: dedicated
operator: Equal
value: cb-apps
effect: NoSchedule
Persistence:
StorageClass: efs
Hibernation:
Enabled: true
Agents:
SeparateNamespace:
Enabled: true
Create: true
Name: cbci-agents
6 changes: 6 additions & 0 deletions blueprints/02-at-scale/extdns-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#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"
logLevel: "debug"
Loading

0 comments on commit 9776473

Please sign in to comment.