Skip to content

Commit

Permalink
Fix create-kubeconfig command
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapha-Borges committed Jan 25, 2024
1 parent 8644862 commit 6702039
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kubeconfig/kubeconfig.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "null_resource" "create_kubeconfig" {
provisioner "local-exec" {
command = "oci ce cluster create-kubeconfig --cluster-id ${var.cluster_id} --file ~/.kube/config --token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT"
command = "oci ce cluster create-kubeconfig --cluster-id ${var.cluster_id} --file ~/.kube/config --token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT --profile ${var.oci_profile}"
}
}
3 changes: 3 additions & 0 deletions kubeconfig/variables.tf
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
variable "cluster_id" {
}

variable "oci_profile" {
}
1 change: 1 addition & 0 deletions terrafile.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module "loadbalancer" {
module "kubeconfig" {
source = "./kubeconfig"
cluster_id = module.cluster.cluster_id
oci_profile = var.oci_profile
depends_on = [ module.loadbalancer ]
}

Expand Down
6 changes: 5 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ variable "listerner_port" {
default = 80
}

# ----------> SSH <----------
# ----------> Auth <----------

variable "ssh_public_key" {
type = string
Expand All @@ -100,3 +100,7 @@ variable "tenancy_ocid" {
variable "user_ocid" {
type = string
}

variable "oci_profile" {
type = string
}

0 comments on commit 6702039

Please sign in to comment.