This message was deleted.
# hobbyfarm
a
b
In one of the YouTube videos (

https://youtu.be/_Sn_5soElhM?t=1665β–Ύ

) 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 https://github.com/rancher/machine 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?
w
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.
b
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
Environment
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 😞 .
f
The admin user will need a role + role binding giving access to the hobbyfarm api group + rbac api group. https://hobbyfarm.github.io/docs/setup/post_install/#initial-admin-user
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.
b
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
ingress:
  enabled: true
  tls:
    enabled: true
    secrets:
      backend:    backend-tls-secret
      admin:      admin-tls-secret
      ui:         ui-tls-secret
      shell:      shell-tls-secret
  hostnames:
    backend:    api.acloud.lab
    admin:      admin.acloud.lab
    shell:      shell.acloud.lab
    ui:         trainer.acloud.lab
users:
 admin:
   enabled: true
terraform:
 enabled: true
 provider: vsphere
 executor:
   image: rancher/terraform-controller-executor
   tag: "v0.0.13-alpha1"
 controller:
   image: rancher/terraform-controller
   tag: "v0.0.13-alpha1"
   threads: 2
 vsphere:
   module: tf-module
   module_repo: <https://github.com/ansilh/hobbyfarm-tools>
I can see the admin user and rolebinding is also present
Copy code
[root@trainer ~]# k get users -n hobbyfarm-system
NAME    EMAIL
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: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
kind: RoleBinding
metadata:
  annotations:
    <http://meta.helm.sh/release-name|meta.helm.sh/release-name>: hobbyfarm
    <http://meta.helm.sh/release-namespace|meta.helm.sh/release-namespace>: hobbyfarm-system
  creationTimestamp: "2023-06-07T11:52:17Z"
  labels:
    <http://app.kubernetes.io/managed-by|app.kubernetes.io/managed-by>: Helm
  name: hobbyfarm-admin-rolebinding
  namespace: hobbyfarm-system
  resourceVersion: "4854"
  uid: 214c6904-05ff-4d37-84bc-3a2eed61b174
roleRef:
  apiGroup: <http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>
  kind: Role
  name: hobbyfarm-admin
subjects:
- apiGroup: <http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>
  kind: User
  name: admin
But still I get the UI I pasted earlier
f
What happens if you do
k get roles -n hobbyfarm-system
?
b
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
f
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
b
I think I should jumpoff from the cliff πŸ˜„ - I was trying https://trainer.acloud.lab/ all day
f
That was what i thought initially thats why i now wrote the whole URL :D
b
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
gargantua-shell
. 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
f
Have you used the variable "public_key" inside the module? https://github.com/svalabs/hf-tf-module-hcloud/blob/master/main.tf#L2
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"
b
Got it. Let me change my tf then πŸ‘πŸΌ
βœ… 1
f
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
b
thanks. I'll try and update
Yay..πŸŽ‰. Thanks @faint-optician-47536 @worried-fountain-60974
πŸŽ‰ 1
βœ… 1
w
Woohoo!!