Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I deploy without resource pool? #29

Open
Piyaphong opened this issue Jan 24, 2020 · 3 comments
Open

How can I deploy without resource pool? #29

Piyaphong opened this issue Jan 24, 2020 · 3 comments

Comments

@Piyaphong
Copy link

I try to deploy k8s on vsphere. My Vsphere cluster is not have DRS license It's mean I cannot create resource pool. How can I modify configure to deploy k8s cluster.

@pierreyves-lebrun
Copy link

Same problem here, is there a way to use this project without a DRS license?

@gregjan
Copy link

gregjan commented May 6, 2020

Here is a diff that captures the two things I changed.. First I skipped the creation of a dedicated resource for k8s. Then I made all subsequent nodes have a parent of the "default" resource. So this eliminates the cluster resource in the middle that requires DRS.

diff --git a/vsphere-kubespray.tf b/vsphere-kubespray.tf
index 31d3f14..0ac714f 100644
--- a/vsphere-kubespray.tf
+++ b/vsphere-kubespray.tf
@@ -419,16 +419,16 @@ resource "vsphere_folder" "folder" {
 }
 
 # Create a resource pool for the Kubernetes VMs #
-resource "vsphere_resource_pool" "resource_pool" {
-  name                    = "${var.vsphere_resource_pool}"
-  parent_resource_pool_id = "${data.vsphere_compute_cluster.cluster.resource_pool_id}"
-}
+# resource "vsphere_resource_pool" "resource_pool" {
+#   name                    = "${var.vsphere_resource_pool}"
+#   parent_resource_pool_id = "${data.vsphere_compute_cluster.cluster.resource_pool_id}"
+# }
 
 # Create the Kubernetes master VMs #
 resource "vsphere_virtual_machine" "master" {
   count            = "${length(var.vm_master_ips)}"
   name             = "${var.vm_name_prefix}-master-${count.index}"
-  resource_pool_id = "${vsphere_resource_pool.resource_pool.id}"
+  resource_pool_id = "${data.vsphere_compute_cluster.cluster.resource_pool_id}"
   datastore_id     = "${data.vsphere_datastore.datastore.id}"
   folder           = "${vsphere_folder.folder.path}"
 
@@ -488,7 +488,7 @@ resource "vsphere_compute_cluster_vm_anti_affinity_rule" "master_anti_affinity_r
 resource "vsphere_virtual_machine" "worker" {
   count            = "${length(var.vm_worker_ips)}"
   name             = "${var.vm_name_prefix}-worker-${count.index}"
-  resource_pool_id = "${vsphere_resource_pool.resource_pool.id}"
+  resource_pool_id = "${data.vsphere_compute_cluster.cluster.resource_pool_id}"
   datastore_id     = "${data.vsphere_datastore.datastore.id}"
   folder           = "${vsphere_folder.folder.path}"
 
@@ -556,7 +556,7 @@ resource "vsphere_virtual_machine" "worker" {
 resource "vsphere_virtual_machine" "haproxy" {
   count            = "${length(var.vm_haproxy_ips)}"
   name             = "${var.vm_name_prefix}-haproxy-${count.index}"
-  resource_pool_id = "${vsphere_resource_pool.resource_pool.id}"
+  resource_pool_id = "${data.vsphere_compute_cluster.cluster.resource_pool_id}"
   datastore_id     = "${data.vsphere_datastore.datastore.id}"
   folder           = "${vsphere_folder.folder.path}"
 
-- 

@pierreyves-lebrun
Copy link

I eventually figured it out, thanks anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants