Skip to content

Commit

Permalink
Merge pull request #25 from Ajay-sops/main
Browse files Browse the repository at this point in the history
did changes in vpc-cni module for updating its envirnoment variable
  • Loading branch information
Ajay-sops authored Apr 8, 2024
2 parents 1b024d4 + a455b49 commit 40f9a5a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This example is useful for users who are new to a module and want to quickly lea
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.43.0 |
| <a name="requirement_kubectl"></a> [kubectl](#requirement\_kubectl) | >= 1.7.0 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.0.2 |

## Providers
Expand Down
7 changes: 7 additions & 0 deletions examples/complete/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ provider "helm" {
token = data.aws_eks_cluster_auth.cluster.token
}
}

provider "kubectl" {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.cluster.token
load_config_file = false
}
4 changes: 4 additions & 0 deletions examples/complete/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ terraform {
source = "hashicorp/kubernetes"
version = ">= 2.0.2"
}
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.7.0"
}
}
}
3 changes: 3 additions & 0 deletions modules/kubernetes-addons/aws-vpc-cni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ The Amazon VPC CNI plugin for Kubernetes is the networking plugin for pod networ
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.10 |
| <a name="requirement_kubectl"></a> [kubectl](#requirement\_kubectl) | >= 1.7.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.10 |
| <a name="provider_kubectl"></a> [kubectl](#provider\_kubectl) | >= 1.7.0 |

## Modules

Expand All @@ -29,6 +31,7 @@ The Amazon VPC CNI plugin for Kubernetes is the networking plugin for pod networ
|------|------|
| [aws_eks_addon.vpc_cni](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
| [aws_iam_policy.cni_ipv6_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [kubectl_manifest.update_aws_vpc_cni](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource |
| [aws_eks_addon_version.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_addon_version) | data source |
| [aws_iam_policy_document.ipv6_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |

Expand Down
22 changes: 22 additions & 0 deletions modules/kubernetes-addons/aws-vpc-cni/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,25 @@ data "aws_iam_policy_document" "ipv6_policy" {
resources = ["arn:${var.addon_context.aws_partition_id}:ec2:*:*:network-interface/*"]
}
}



resource "kubectl_manifest" "update_aws_vpc_cni" {
yaml_body = <<-EOT
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: aws-node
namespace: kube-system
spec:
template:
spec:
containers:
- name: aws-node
env:
- name: ENABLE_PREFIX_DELEGATION
value: "true"
EOT

depends_on = [aws_eks_addon.vpc_cni]
}
4 changes: 4 additions & 0 deletions modules/kubernetes-addons/aws-vpc-cni/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ terraform {
source = "hashicorp/aws"
version = ">= 4.10"
}
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.7.0"
}
}
}

0 comments on commit 40f9a5a

Please sign in to comment.