Skip to content

Commit 4ff2e8c

Browse files
Pothulapatiroboquat
authored andcommitted
[single-cluster/aws] Make self-signed work
Fixes #12979 This PR adds a new `post_bootstrap_user_data` variable to the EKS terraform modules that changes the containerd config to accept new self signed SSL Certificates, and restarting `containerd` to make the same work. Signed-off-by: Tarun Pothulapati <[email protected]>
1 parent b1b658e commit 4ff2e8c

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

install/infra/modules/eks/kubernetes.tf

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ module "eks" {
103103
enable_bootstrap_user_data = true
104104
vpc_security_group_ids = [aws_security_group.nodes.id]
105105
ebs_optimized = true
106+
107+
post_bootstrap_user_data = <<-EOT
108+
#!/bin/bash
109+
cat << CONFIG >> /etc/containerd/config.toml
110+
111+
[plugins."io.containerd.grpc.v1.cri".registry]
112+
config_path = "/etc/containerd/certs.d"
113+
114+
CONFIG
115+
116+
service containerd restart
117+
EOT
106118
}
107119

108120
eks_managed_node_groups = {
@@ -144,7 +156,7 @@ module "eks" {
144156
export CONTAINER_RUNTIME="containerd"
145157
export USE_MAX_PODS=false
146158
EOF
147-
# Source extra environment 5ariables in bootstrap script
159+
# Source extra environment variables in bootstrap script
148160
sed -i '/^set -o errexit/a\\nsource /etc/profile.d/bootstrap.sh' /etc/eks/bootstrap.sh
149161
EOT
150162
}
@@ -170,7 +182,7 @@ module "eks" {
170182
desired_size = 2
171183
enable_bootstrap_user_data = true
172184
labels = {
173-
"gitpod.io/workload_workspace_regular" = true
185+
"gitpod.io/workload_workspace_regular" = true
174186
}
175187

176188
tags = {
@@ -262,14 +274,14 @@ resource "null_resource" "kubeconfig" {
262274

263275
data "aws_iam_policy_document" "eks_policy" {
264276
statement {
265-
actions = [
277+
actions = [
266278
"eks:DescribeCluster",
267279
"eks:ListClusters"
268280
]
269281
resources = [
270282
"*",
271283
]
272-
effect = "Allow"
284+
effect = "Allow"
273285
}
274286
}
275287

@@ -281,7 +293,7 @@ resource "aws_iam_policy" "eks_policy" {
281293

282294
resource "aws_iam_user" "eks_user" {
283295
force_destroy = true
284-
name = "eks-user-${var.cluster_name}"
296+
name = "eks-user-${var.cluster_name}"
285297
}
286298

287299
resource "aws_iam_user_policy_attachment" "eks_attachment" {
@@ -290,5 +302,5 @@ resource "aws_iam_user_policy_attachment" "eks_attachment" {
290302
}
291303

292304
resource "aws_iam_access_key" "eks_user_key" {
293-
user = aws_iam_user.eks_user.name
305+
user = aws_iam_user.eks_user.name
294306
}

0 commit comments

Comments
 (0)