File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ module "operator" {
64
64
install_helm_from_repo = var. operator_install_helm_from_repo
65
65
install_oci_cli_from_repo = var. operator_install_oci_cli_from_repo
66
66
install_istioctl = var. operator_install_istioctl
67
+ install_k8sgpt = var. operator_install_k8sgpt
67
68
install_k9s = var. operator_install_k9s
68
69
install_kubectx = var. operator_install_kubectx
69
70
install_kubectl_from_repo = var. operator_install_kubectl_from_repo
Original file line number Diff line number Diff line change @@ -137,6 +137,25 @@ data "cloudinit_config" "operator" {
137
137
}
138
138
}
139
139
140
+ # k8sgpt installation
141
+ dynamic "part" {
142
+ for_each = var. install_k8sgpt ? [1 ] : []
143
+ content {
144
+ content_type = " text/cloud-config"
145
+ content = jsonencode ({
146
+ runcmd = [
147
+ " CLI_ARCH='${ local . arch_amd } '" ,
148
+ " if [ \"$(uname -m)\" = ${local.arch_arm} ]; then CLI_ARCH= 'arm64'; fi" ,
149
+ " if [ - f / etc / os-release ]; then os_id =$(grep '^ID=' / etc/ os- release | awk - F= '{print $2 }' | tr - d '\" '); fi" ,
150
+ " if [ \" $os_id\" == \" ubuntu\" ]; then curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/latest/download/k8sgpt_$CLI_ARCH.deb; dpkg -i k8sgpt_$CLI_ARCH.deb; rm k8sgpt_$CLI_ARCH.deb; fi" ,
151
+ " if [ \" $os_id\" == \" ol\" ]; then while fuser /var/lib/rpm/.rpm.lock >/dev/null 2>&1; do sleep 5; done; rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/latest/download/k8sgpt_$CLI_ARCH.rpm; fi"
152
+ ]
153
+ })
154
+ filename = " 20-k8sgpt.yml"
155
+ merge_type = local.default_cloud_init_merge_type
156
+ }
157
+ }
158
+
140
159
# kubectx/kubens installation
141
160
dynamic " part" {
142
161
for_each = var.install_kubectx ? [1 ] : []
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ variable "install_oci_cli_from_repo" { type = bool }
20
20
variable "install_helm" { type = bool }
21
21
variable "install_helm_from_repo" { type = bool }
22
22
variable "install_istioctl" { type = bool }
23
+ variable "install_k8sgpt" { type = bool }
23
24
variable "install_k9s" { type = bool }
24
25
variable "install_kubectl_from_repo" {
25
26
type = bool
Original file line number Diff line number Diff line change @@ -83,6 +83,12 @@ variable "operator_install_istioctl" {
83
83
type = bool
84
84
}
85
85
86
+ variable "operator_install_k8sgpt" {
87
+ default = false
88
+ description = " Whether to install k8sgpt on the created operator host. NOTE: Provided only as a convenience and not supported by or sourced from Oracle - use at your own risk."
89
+ type = bool
90
+ }
91
+
86
92
variable "operator_install_k9s" {
87
93
default = false
88
94
description = " Whether to install k9s on the created operator host. NOTE: Provided only as a convenience and not supported by or sourced from Oracle - use at your own risk."
You can’t perform that action at this time.
0 commit comments