sguyennet / terraform-vsphere-kubespray

Deploy a Kubernetes HA cluster on VMware vSphere
https://blog.inkubate.io/install-and-manage-automatically-a-kubernetes-cluster-on-vmware-vsphere-with-terraform-and-kubespray/
Apache License 2.0
174 stars 89 forks source link

Deploy k8s-cluster without VMware compute cluster #25

Open semaph0r opened 4 years ago

semaph0r commented 4 years ago

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.

sguyennet commented 4 years ago

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

Harsun commented 4 years ago

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 notifications@github.com 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 .

semaph0r commented 4 years ago

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

Harsun commented 4 years ago

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 notifications@github.com 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 .

cbg-teamomni commented 4 years ago

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

semaph0r commented 4 years ago

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

cbg-teamomni commented 4 years ago

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