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

Implement separate kube proxy add-on outside of blueprints #172

Merged
merged 3 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- replaced terraform-aws-eks-blueprint addon ingress-nginx with module `modules/k8s_eks_addons/ingress-nginx.tf`
- replaced terraform-aws-eks-blueprint addon cluster-autoscaler with module `modules/k8s_eks_addons/cluster-autoscaler.tf`
- replaced terraform-aws-eks-blueprint addon coredns with module `modules/k8s_eks_addons/coredns.tf`
- replaced terraform-aws-eks-blueprint addon kube_proxy with module `modules/k8s_eks_addons/kube-proxy.tf`

## v0.2.0

Expand Down
22 changes: 22 additions & 0 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,25 @@ moved {
terraform apply
```
4. Remove `move.tf` file

# Migrate kube_proxy addon to the module
To migrate from terraform-aws-eks-blueprint addon kube_proxy to custom module `modules/k8s_eks_addons/kube-proxy.tf` follow steps:

1. create 'move.tf' in repository root
2. Add following code:
```
moved {
from = module.eks-addons.module.aws_kube_proxy[0].data.aws_eks_addon_version.this
to = module.k8s_eks_addons.data.aws_eks_addon_version.kube_proxy
}
moved {
from = module.eks-addons.module.aws_kube_proxy[0].aws_eks_addon.kube_proxy
to = module.k8s_eks_addons.aws_eks_addon.kube_proxy
}
```
3. Run command:
```
terraform apply
```
4. Remove `move.tf` file

1 change: 0 additions & 1 deletion k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module "eks-addons" {
source = "git::https://github.com/aws-ia/terraform-aws-eks-blueprints.git//modules/kubernetes-addons?ref=v4.32.1"
eks_cluster_id = module.eks.eks_cluster_id
enable_amazon_eks_vpc_cni = true
enable_amazon_eks_kube_proxy = true
enable_aws_efs_csi_driver = true
enable_amazon_eks_aws_ebs_csi_driver = true
enable_aws_load_balancer_controller = false
Expand Down
18 changes: 18 additions & 0 deletions modules/k8s_eks_addons/kube-proxy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
locals {
kube_proxy_addon_name = "kube-proxy"
}

data "aws_eks_addon_version" "kube_proxy" {
addon_name = local.kube_proxy_addon_name
kubernetes_version = var.addon_context.eks_cluster_version
}

resource "aws_eks_addon" "kube_proxy" {
cluster_name = var.addon_context.eks_cluster_id
addon_name = local.kube_proxy_addon_name
addon_version = data.aws_eks_addon_version.kube_proxy.version
preserve = true
resolve_conflicts_on_create = "OVERWRITE"
resolve_conflicts_on_update = "OVERWRITE"
tags = var.addon_context.tags
}
Loading