Skip to content

Commit

Permalink
Added kubectl image to eks for use by other modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
zawac002 committed Sep 20, 2023
1 parent 0017cb3 commit 1097976
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
10 changes: 10 additions & 0 deletions copy_images.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
locals {
autoscaler_key = format("%v#%v", "cluster-autoscaler", var.cluster_autoscaler_tag)
kubectl_key = format("%v#%v", "kubectl", var.kubectl_image_tag)

image_config = [
{
Expand All @@ -11,6 +12,15 @@ locals {
source_tag = null
tag = var.cluster_autoscaler_tag
},
{
enabled = true
dest_path = null
name = "kubectl"
source_image = "bitnami/kubectl"
source_registry = "docker.io"
source_tag = var.kubectl_image_tag
tag = var.kubectl_image_tag
},
]
}

Expand Down
20 changes: 20 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,23 @@ output "self_managed_node_groups_autoscaling_group_names" {
# Additional
################################################################################

output "kubectl_image_full_path" {
description = "The full URI to access the kubectl image including the registry/repository:tag"
value = module.images.images[local.kubectl_key].dest_full_path
}

output "kubectl_image_registry" {
description = "The registry portion of the URI to access the kubectl image"
value = module.images.images[local.kubectl_key].dest_registry
}

output "kubectl_image_repository" {
description = "The repository portion of the URI to access the kubectl image"
value = module.images.images[local.kubectl_key].dest_repository
}

output "kubectl_image_tag" {
description = "The tag portion of the URI to access the kubectl image"
value = module.images.images[local.kubectl_key].tag
}

6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ variable "cluster_autoscaler_tag" {
default = "v1.27.2"
}

variable "kubectl_image_tag" {
description = "The version of bitnami/kubectl image to use."
type = string
default = "1.27.1"
}

variable "eks_instance_disk_size" {
description = "The size of the disk of the worker nodes in gigabytes. 40 is the approximate minimum. Needs to hold the all of the normal operating system files plus every image that will be used in the cluster."
type = number
Expand Down

0 comments on commit 1097976

Please sign in to comment.