Skip to content

Conversation

@samidbb
Copy link
Contributor

@samidbb samidbb commented Dec 12, 2025

This pull request introduces a new Terraform module for managing cert-manager manifests and IAM roles through GitOps, integrating cert-manager into the Kubernetes services deployment pipeline. The changes automate the creation of necessary Kubernetes and Flux CD resources, as well as the required IAM role for DNS01 challenges, and expose new configuration variables for cert-manager.

The most important changes are:

Cert-Manager Module Introduction and Integration

  • Added a new Terraform module at _sub/security/cert-manager to generate cert-manager manifests and manage their deployment via Flux CD, including resources for ClusterRoleBinding and Kustomization. [1] [2] [3]
  • Integrated the new cert-manager module into the main Kubernetes services pipeline (compute/k8s-services/main.tf), including its configuration and dependencies, and created an IAM role for cert-manager with Route53 permissions.

Configuration and Variables

  • Introduced new variables for cert-manager configuration (e.g., ACME email, domain name, IAM role ARN) in both the cert-manager submodule (_sub/security/cert-manager/vars.tf) and the main services variables file (compute/k8s-services/vars.tf). [1] [2]
  • Updated integration test configuration to supply a test ACME email for cert-manager.

Supporting Infrastructure and Defaults

  • Added provider and version constraints for Terraform and the GitHub provider in the cert-manager module (_sub/security/cert-manager/versions.tf).
  • Defined local variables for cert-manager namespace and service account in the main services dependencies file (compute/k8s-services/dependencies.tf).

Repository and Branch Management

  • Added logic to dynamically determine the default branch and repository information for manifest storage using the GitHub provider (_sub/security/cert-manager/dependencies.tf).

Issue ticket number and link

Checklist before requesting a review

Is it a new release?

  • Apply a release tag release:(major|minor|patch), following semantic versioning in this guide or norelease if there is no changes to the Terraform code

@samidbb samidbb added the release:minor Triggers a minor release label Dec 12, 2025
Copy link
Contributor

@wcarlsen wcarlsen left a comment

Choose a reason for hiding this comment

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

Very good, but there are few things that needs adjustments.

Also I think cert-manager would need an AWS IAM role at some point and that is not present in the current setup. Consider adding one using this module https://github.com/terraform-aws-modules/terraform-aws-iam/tree/master/modules/iam-role-for-service-accounts

@wcarlsen
Copy link
Contributor

Also I think cert-manager would need an AWS IAM role at some point and that is not present in the current setup. Consider adding one using this module https://github.com/terraform-aws-modules/terraform-aws-iam/tree/master/modules/iam-role-for-service-accounts

Really important for DNSChallenge

@samidbb
Copy link
Contributor Author

samidbb commented Dec 12, 2025

Also I think cert-manager would need an AWS IAM role at some point and that is not present in the current setup. Consider adding one using this module https://github.com/terraform-aws-modules/terraform-aws-iam/tree/master/modules/iam-role-for-service-accounts

Really important for DNSChallenge

I think it will be relevant only when deploying (cluster)issuer(s). so not really needed for the deployment of the cert-manager itself

@wcarlsen
Copy link
Contributor

Also I think cert-manager would need an AWS IAM role at some point and that is not present in the current setup. Consider adding one using this module https://github.com/terraform-aws-modules/terraform-aws-iam/tree/master/modules/iam-role-for-service-accounts

Really important for DNSChallenge

I think it will be relevant only when deploying (cluster)issuer(s). so not really needed for the deployment of the cert-manager itself

Of course with cert-manager you can do self signed certs, but the strength will come from giving it AWS access to Route53. I also think this is the main driver for putting it in, so it makes little sense that it is not there.

@samidbb
Copy link
Contributor Author

samidbb commented Dec 12, 2025

cert-manager can run without issuer for now. I can ofcorse deploy the clusterissuer in namespace cert-manager if that what you are talking but I wanted to postpone it until I know how to handle certificate requests in namespaces/or on loadbalancer level

@wcarlsen
Copy link
Contributor

wcarlsen commented Dec 12, 2025

cert-manager can run without issuer for now. I can ofcorse deploy the clusterissuer in namespace cert-manager if that what you are talking but I wanted to postpone it until I know how to handle certificate requests in namespaces/or on loadbalancer level

This is a decent argument. But I guess you could also just test this in your sandbox cluster now right.

@samidbb samidbb added release:major Triggers a major release and removed release:minor Triggers a minor release labels Jan 16, 2026
@samidbb samidbb marked this pull request as ready for review January 16, 2026 14:45
@samidbb samidbb requested a review from a team as a code owner January 16, 2026 14:45
@samidbb samidbb requested a review from wcarlsen January 16, 2026 14:47
# --------------------------------------------------
# Cert-Manager
# --------------------------------------------------
variable "cert_manager_acme_email" {
Copy link
Contributor

@wcarlsen wcarlsen Jan 16, 2026

Choose a reason for hiding this comment

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

DFDS email supports plus domains, eg. itbuildsourcedevex+${var.cluster_name}@dfds.com, so in my mind this is not a direct requirement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to use alias then it would be ${var.cluster_name}+itbuildsourcedevex@dfds.com but I have a slight concern with having hardcoded mail and dns information in modules


module "cert_manager_role" {
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts"
version = "6.2.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

The newest is "6.3.0" released 8th of January. This is a minor improvement and can be omitted.

name = "${var.eks_cluster_name}-cert-manager"
policy_name = "${var.eks_cluster_name}-cert-manager"
attach_cert_manager_policy = true
cert_manager_hosted_zone_arns = [
Copy link
Contributor

Choose a reason for hiding this comment

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

could this just be data.aws_route53_zone.core.arn and not data.aws_route53_zone.core[0].arn, since the previous is already a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it throws an error because there is a count on the data resource

description = "The domain name to be used by cert-manager"
}

variable "acme_email" {
Copy link
Contributor

Choose a reason for hiding this comment

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

If plus domains is used, it can derived from cluster_name, so I think we can remove this variable.

helm_repo_path = local.helm_repo_path
prune = var.prune
domain_name = var.domain_name
email = var.acme_email
Copy link
Contributor

Choose a reason for hiding this comment

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

pass cluster_name in stead.

external_dns_traefik_alb_auth_core_alias = ["test3.qa.dfds.cloud"]
external_dns_traefik_alb_anon_core_alias = ["test4.qa.dfds.cloud"]

cert_manager_acme_email = "itbuildsourcedevex@dfds.com"
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed if we derive it from cluster_name.

Copy link
Contributor

@wcarlsen wcarlsen left a comment

Choose a reason for hiding this comment

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

In my mind this is definitely not a major release, since an email can be almost hardcoded and use cluster_name in plus domain, to distinguish between cluster. This means that we pass cluster_name in postBuildSubstitution and define it in platform-apps.

Once we have gone over the comments we need to see if cert-manager should support a single domain or maybe a list of domains, because I think the current implementation only supports one domain. Please correct me if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:major Triggers a major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants