terraform-vsphere-kubespray icon indicating copy to clipboard operation
terraform-vsphere-kubespray copied to clipboard

Deploy k8s-cluster without VMware compute cluster

Open semaph0r opened this issue 5 years ago • 7 comments

Is it possible to use this pipelines on VMware without the need of a compute cluster and all the vMotion stuff? I don't need that.

I've looked into vsphere-kubespray.tf and it seems that the compute cluster variable is only used to navigate through the VCenter ressource graph more efficiently.

semaph0r avatar Dec 18 '19 10:12 semaph0r

Hi, Do you mean deploying Kubernetes on standalone ESXi (without a vCenter)?

sguyennet avatar Jan 08 '20 10:01 sguyennet

Hello, The thing is, terraform is just an API client, pretty much modular. So, in your case, if you wish you can create your own VMs without Terraform. You can try to use ansible to create your own VMs and customize them. Or you can check other Terraform Modules, I didn't check but maybe someone created Terraform modules for ESXi nodes directly.

Karakas, Gokhan

Freelance IT advisor, Security Investigator Mobile Turkey: +90 506 904 90 59

On Wed, Jan 8, 2020 at 1:01 PM Simon Guyennet [email protected] wrote:

Hi, Do you mean deploying Kubernetes on standalone ESXi (without a vCenter)?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sguyennet/terraform-vsphere-kubespray/issues/25?email_source=notifications&email_token=ADH6T3DUCUYX6ZUE765SKFDQ4WP63A5CNFSM4J4I6MGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIL23UY#issuecomment-571977171, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADH6T3DCRWDDTRKLL4CMLLDQ4WP63ANCNFSM4J4I6MGA .

Harsun avatar Jan 08 '20 10:01 Harsun

Hi, Do you mean deploying Kubernetes on standalone ESXi (without a vCenter)?

No, I am using vCenter but did not licenzed vMotion, so compute clusters are not available. Actually I do not plan to use compute clusters either. My questions is, if there are any side effects by refactor the scripts not to use compute clusters.

The refactoring would remove all compute cluster resources and it's references from the terraform script and should tie all subsequent resources directly together.

As of now, the only places where the compute cluster is use are:

resource "vsphere_resource_pool" "resource_pool" {
  name                    = "${var.vsphere_resource_pool}"
  parent_resource_pool_id = "${data.vsphere_compute_cluster.cluster.resource_pool_id}"
}
# Create anti affinity rule for the Kubernetes master VMs #
resource "vsphere_compute_cluster_vm_anti_affinity_rule" "master_anti_affinity_rule" {
  count               = "${var.vsphere_enable_anti_affinity == "true" ? 1 : 0}"
  name                = "${var.vm_name_prefix}-master-anti-affinity-rule"
  compute_cluster_id  = "${data.vsphere_compute_cluster.cluster.id}"
  virtual_machine_ids = ["${vsphere_virtual_machine.master.*.id}"]

  depends_on = ["vsphere_virtual_machine.master"]
}

I'd remove these resources from the script. Also parent_resource_pool_id was probably declared obsolete, at least there is nothing in the documentation: https://www.terraform.io/docs/providers/vsphere/d/resource_pool.html. See https://github.com/sguyennet/terraform-vsphere-kubespray/issues/26

semaph0r avatar Jan 08 '20 10:01 semaph0r

Ohh ok. I am not an expert in VCenter, but I assume it can work as you expected. The best thing, in this case, you can test it and see results.

Karakas, Gokhan

Freelance IT advisor, Security Investigator Mobile Turkey: +90 506 904 90 59

On Wed, Jan 8, 2020 at 1:44 PM Patrik Schmidt [email protected] wrote:

Hi, Do you mean deploying Kubernetes on standalone ESXi (without a vCenter)?

No, I am using vCenter but did not licenzed vMotion, so compute clusters are not available. Actually I do not plan to use compute clusters either. My questions is, if there are any side effects by refactor the scripts not to use compute clusters.

The refactoring would remove all compute cluster resources and it's references from the terraform script and should tie all subsequent resources directly together.

As of now, the only places where the compute cluster is use are:

resource "vsphere_resource_pool" "resource_pool" { name = "${var.vsphere_resource_pool}" parent_resource_pool_id = "${data.vsphere_compute_cluster.cluster.resource_pool_id}" }

Create anti affinity rule for the Kubernetes master VMs

resource "vsphere_compute_cluster_vm_anti_affinity_rule" "master_anti_affinity_rule" { count = "${var.vsphere_enable_anti_affinity == "true" ? 1 : 0}" name = "${var.vm_name_prefix}-master-anti-affinity-rule" compute_cluster_id = "${data.vsphere_compute_cluster.cluster.id}" virtual_machine_ids = ["${vsphere_virtual_machine.master.*.id}"]

depends_on = ["vsphere_virtual_machine.master"] }

I'd remove these resources from the script. Also parent_resource_pool_id was probably declared obsolete, at least there is nothing in the documentation: https://www.terraform.io/docs/providers/vsphere/d/resource_pool.html

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sguyennet/terraform-vsphere-kubespray/issues/25?email_source=notifications&email_token=ADH6T3BUC6T36FHPCOLSY3TQ4WU7TA5CNFSM4J4I6MGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIL6ZAQ#issuecomment-571993218, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADH6T3D4KYLAJYWT2YJFUOTQ4WU7TANCNFSM4J4I6MGA .

Harsun avatar Jan 08 '20 12:01 Harsun

I have a single ESXi server under a vCenter and would like to know if I can deploy without a cluster.

cbg-teamomni avatar Jan 13 '20 23:01 cbg-teamomni

I'll test in the next few days, if it is possible to refactor the scripts for deployment of the k8s-cluster without a dependency of a compute cluster in vCenter

semaph0r avatar Jan 14 '20 09:01 semaph0r

Thanks in advance. It would be handy especially for prototyping and demo purposes.

cbg-teamomni avatar Jan 14 '20 12:01 cbg-teamomni