Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates according to comments from Carlos. #20

Merged
merged 11 commits into from
May 14, 2024
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ This [AWS Partner Addon](https://aws-ia.github.io/terraform-aws-eks-blueprints-a
- Encapsulating the Deployment of [CloudBees CD Modern in AWS EKS](https://docs.cloudbees.com/docs/cloudbees-cd/latest/install-k8s/) into a Terraform module.
- Providing a series of [Blueprints](blueprints) implementing the mentioned CloudBees CD Addon module on top of [AWS Terraform EKS Addons](https://aws-ia.github.io/terraform-aws-eks-blueprints-addons/main/) which are aligned with [EKS Best Practices Guides](https://aws.github.io/aws-eks-best-practices/).

## CD License
You'll need a valid license to operate the Cloudbees CD server. By default the product use the Server License type. Please visit the [CloudBees CD Licensing](https://docs.cloudbees.com/docs/cloudbees-cd/latest/set-up-cdro/licenses) for more information.

## Usage

There are examples of implementation included in the [blueprint](blueprints) folder but the simplest example of usage is as follows:
Expand Down Expand Up @@ -87,6 +90,8 @@ The main components of CloudBees CD, use a file system to persist data. Data is
|------|-------------|
| cbcd_domain_name | Route 53 Domain Name to host CloudBees CD Services. |
| cbcd_flowserver_pod | Flow Server Pod for CloudBees CD Add-on. |
| cbcd_ing | Ingress for the CloudBees CD add-on. |
| cbcd_liveness_probe_int | CD service internal liveness probe for the CloudBees CD add-on. |
| cbcd_namespace | Namespace for CloudBees CD Addon. |
| cbcd_password | Command to get the admin password of Cloudbees CD |
| cbcd_url | URL for CloudBees CD Add-on. |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
499 changes: 366 additions & 133 deletions blueprints/01-getting-started/img/getting-started.k8s.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions blueprints/01-getting-started/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,42 @@ resource "aws_resourcegroups_group" "bp_rg" {
JSON
}
}

# Storage Classes

resource "kubernetes_annotations" "gp2" {
api_version = "storage.k8s.io/v1"
kind = "StorageClass"
# This is true because the resources was already created by the ebs-csi-driver addon
force = "true"

metadata {
name = "gp2"
}

annotations = {
"storageclass.kubernetes.io/is-default-class" = "false"
}
}

resource "kubernetes_storage_class_v1" "gp3" {
metadata {
name = "gp3"

annotations = {
"storageclass.kubernetes.io/is-default-class" = "true"
}
}

storage_provisioner = "ebs.csi.aws.com"
allow_volume_expansion = true
reclaim_policy = "Delete"
volume_binding_mode = "WaitForFirstConsumer"

parameters = {
encrypted = "true"
fsType = "ext4"
type = "gp3"
}

}
21 changes: 10 additions & 11 deletions blueprints/02-at-scale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Once you have familiarized yourself with the [Getting Started blueprint](../01-g
> [!TIP]
> A [Resource Group](https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html) is added to get a full list with all resources created by this blueprint.

## CD License
A initial license is required to use CloudBees CD. Please refer to the [CloudBees CD Licensing](https://docs.cloudbees.com/docs/cloudbees-cd/latest/set-up-cdro/licenses) for more information.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you need a Enterprise License

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## Architecture

![Architecture](img/at-scale.architect.drawio.svg)
Expand All @@ -40,17 +43,20 @@ Once you have familiarized yourself with the [Getting Started blueprint](../01-g
| Name | Description |
|------|-------------|
| acm_certificate_arn | ACM certificate ARN |
| aws_backup_efs_protected_resource | AWS Backup Protected Resource descriction for EFS Drive. |
| cbcd_helm | Helm configuration for CloudBees CD Add-on. It is accesible only via state files. |
| cbcd_ing | CD Ingress for the CloudBees CI add-on. |
| cbcd_liveness_probe_int | CD service internal liveness probe for the CloudBees CD add-on. |
| cbcd_namespace | Namespace for CloudBees CD Add-on. |
| cbcd_password | command to get the admin password of Cloudbees CD |
| cbcd_url | URL of the CloudBees CD Operations Center for CloudBees CD Add-on. |
| efs_access_points | EFS Access Points. |
| efs_arn | EFS ARN. |
| eks_cluster_arn | EKS cluster ARN |
| kubeconfig_add | Add Kubeconfig to local configuration to access the K8s API. |
| kubeconfig_export | Export KUBECONFIG environment variable to access to access the K8s API. |
| rds_arn | DB ARN for CloudBees CD Add-on. |
| rds_backup_cmd | command to do DB backup. |
| rds_instance_id | DB identifier for CloudBees CD Add-on. |
| rds_restore_cmd | command to do DB restore from snapshot. |
| rds_snapshot_id | DB snapshot identifier for CloudBees CD Add-on. |
| s3_cbcd_arn | cbcd s3 Bucket Arn |
| s3_cbcd_name | cbcd s3 Bucket Name. It is required by Velero for backup |
Expand Down Expand Up @@ -90,11 +96,11 @@ Additionally, the following is required:
- Create a snapshot of the RDS instance.

```sh
aws rds create-db-snapshot --db-instance-identifier $(terraform output --raw rds_instance_id) --db-snapshot-identifier $(terraform output --raw rds_snapshot_id)
eval $(terraform output -raw rds_backup_cmd)
```
- Restore the RDS instance from the snapshot.
```sh
aws rds restore-db-instance-from-db-snapshot --db-instance-identifier $(terraform output --raw rds_instance_id) --db-snapshot-identifier $(terraform output --raw rds_snapshot_id)
eval $(terraform output -raw rds_restore_cmd)
```

- For EBS Storage is based on Velero.
Expand All @@ -117,13 +123,6 @@ Additionally, the following is required:
eval $(terraform output --raw velero_restore_team_cd)
```

- EFS Storage is protected in [AWS Backup](https://aws.amazon.com/backup/) with a regular Backup Plan. Additional On-Demand Backup can be created. Restore can be performed and item level (Access Points) or full restore.
- Protected Resource

```sh
eval $(terraform output --raw aws_backup_efs_protected_resource) | . jq
```

- EFS Access point (they match with CloudBees CI `pvc`)

```sh
Expand Down
Loading
Loading