This message was deleted.
# hobbyfarm
In one of the YouTube videos (β–Ύ

) Chris mentioned that the CRDs are abstracted. I tried to use "`kubectl explain Environment.spec --recursive`" , but didn't get much details from it. I'm looking for the answers of below. - What provider to use to connect vCenter - How to pass the vCenter FQDN/IP & credentials - How to add VM templates etc.. I'm familiar with the code we use in rancher repo, but here I'm kind of blind.
No operator for vSphere and we are not encouraging terraform module as well.
Is my understanding correct?
Hi Ansil - Your understanding is correct. We're in a sort of in-between state where the only providers we're encouraging right now are EC2, DigitalOcean, and Equinix. In the next week I am going to release the first draft of a machine provider spec which is our attempt to formalize that provisioning interface. Once we standardize and accept that, we can move forward on building new providers, which I am anxious to do.
πŸ‘ 1
However, that is not to say that Terraform won't work. You can absolutely use it today and I think there may be some vSphere examples floating around. I can try and dig them up or someone else can.
In the future having a 3rd party Terraform provider makes sense to me. It's just that today's implementation of it is poor and flawed.
Thanks @worried-fountain-60974.
I'm able to get the terraform controller running
Trying to get Hobbyfarm to work with vSphere cluster. The installation went fine.
Copy code
kubectl get pods -n hobbyfarm-system
NAME                                    READY   STATUS    RESTARTS   AGE
admin-ui-84998dfb4f-nqngj               1/1     Running   0          12m
gargantua-5ff9877d5c-f7lhh              1/1     Running   0          12m
gargantua-shell-c75f6b76d-wplnq         1/1     Running   0          12m
terraform-controller-6656988cd4-jvczh   1/1     Running   0          12m
ui-6468c8c688-qwfgq                     1/1     Running   0          12m
Got the UI , but not so sure about the next steps to configure the vSphere. During the installation, I've passed my custom terraform module path, but not so sure the parameters to configure the
for vSphere. The terraform works fine and I get the VM up in a vSAN cluster with that conde and it returns the IP.
Even the default installation give this UI for admin user. I've seen it gives other options, but now I can't see those as well 😞 .
The admin user will need a role + role binding giving access to the hobbyfarm api group + rbac api group.
The admin dashboard is provided by the admin ui pod. You will have to access that to get access to all available configuration options
Afterwards create an environment under the configuration tab.
Thanks @faint-optician-47536 I've installed hobbyfarm
Copy code
helm install hobbyfarm hobbyfarm/hobbyfarm --namespace hobbyfarm-system
The upgraded with overrides
Copy code
helm upgrade hobbyfarm hobbyfarm/hobbyfarm --namespace hobbyfarm-system --set ingress.className=nginx --set users.admin.password=${BCRYPT_PASS} -f values-custom.yaml
The custom values file
Copy code
  enabled: true
    enabled: true
      backend:    backend-tls-secret
      admin:      admin-tls-secret
      ui:         ui-tls-secret
      shell:      shell-tls-secret
    backend:    api.acloud.lab
    admin:      admin.acloud.lab
    shell:      shell.acloud.lab
    ui:         trainer.acloud.lab
   enabled: true
 enabled: true
 provider: vsphere
   image: rancher/terraform-controller-executor
   tag: "v0.0.13-alpha1"
   image: rancher/terraform-controller
   tag: "v0.0.13-alpha1"
   threads: 2
   module: tf-module
   module_repo: <>
I can see the admin user and rolebinding is also present
Copy code
[root@trainer ~]# k get users -n hobbyfarm-system
admin   admin

[root@trainer ~]# k get rolebinding hobbyfarm-admin-rolebinding -n hobbyfarm-system
NAME                          ROLE                   AGE
hobbyfarm-admin-rolebinding   Role/hobbyfarm-admin   3m10s
[root@trainer ~]# k get rolebinding hobbyfarm-admin-rolebinding -n hobbyfarm-system -o yaml
apiVersion: <|>
kind: RoleBinding
    <|>: hobbyfarm
    <|>: hobbyfarm-system
  creationTimestamp: "2023-06-07T11:52:17Z"
    <|>: Helm
  name: hobbyfarm-admin-rolebinding
  namespace: hobbyfarm-system
  resourceVersion: "4854"
  uid: 214c6904-05ff-4d37-84bc-3a2eed61b174
  apiGroup: <|>
  kind: Role
  name: hobbyfarm-admin
- apiGroup: <|>
  kind: User
  name: admin
But still I get the UI I pasted earlier
What happens if you do
k get roles -n hobbyfarm-system
Copy code
[root@trainer ~]# k get roles -n hobbyfarm-system
NAME              CREATED AT
gargantua         2023-06-07T11:51:49Z
hobbyfarm-admin   2023-06-07T11:52:17Z
When you open the developer console in the admin.acloud.lab UI, do you see any requests beside the inital one?
If so please send a screenshot or send the Headers + response
I think I should jumpoff from the cliff πŸ˜„ - I was trying https://trainer.acloud.lab/ all day
That was what i thought initially thats why i now wrote the whole URL :D
All good and I hope I can continue with next steps.
βœ… 1
Thanks for the help @faint-optician-47536
I think I'm almost there Only pending thing is to figure out how can I push a private key to the
. My terraform code can push the public key, but not so sure how to get the connection working with the shell component.
Copy code
I0607 15:02:25.016352       1 shell.go:529] Going to upgrade connection now... dynamic-eqyiwzp4zl-b1cd0ac7
E0607 15:02:25.052880       1 shell.go:579] did not connect ssh successfully: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
Have you used the variable "public_key" inside the module?
A SSH key will be generated by gargantua - it will be stored as a secret. When provisioning with terraform this is available as the variable "public_key"
Got it. Let me change my tf then πŸ‘πŸΌ
βœ… 1
oh and also add "ssh_username" to the VirtualMachineTemplate or environment.
βœ… 1
Otherwise it will default to "ubuntu" i think? I do not know why this is but better set it inside the VMT / env
thanks. I'll try and update
Yay..πŸŽ‰. Thanks @faint-optician-47536 @worried-fountain-60974
πŸŽ‰ 1
βœ… 1