Skip to content

Commit

Permalink
First version of at-scale
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosrodlop committed Dec 18, 2023
1 parent e9ba08c commit 6b43a71
Show file tree
Hide file tree
Showing 19 changed files with 681 additions and 15 deletions.
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
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 6b43a71

Please sign in to comment.