Skip to content

Commit

Permalink
Move controller to TF-service (hobbyfarm#438)
Browse files Browse the repository at this point in the history
* Move controller to TF-service

* Add RBAC rights
  • Loading branch information
jggoebel authored Jul 11, 2024
1 parent a551ddf commit 24180b0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
6 changes: 6 additions & 0 deletions charts/hobbyfarm/templates/terraform-service/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ rules:
- apiGroups: ["terraformcontroller.cattle.io"]
resources: ["*"]
verbs: ["*"]
- apiGroups: ["hobbyfarm.io"]
resources: ["virtualmachines", "virtualmachines/status"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["statefulsets"]
verbs: ["list", "get", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{{ if .Values.terraform.enabled }}
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: terraform-service
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ $.Values.terraform.service.replicas }}
serviceName: terraform-service-grpc
selector:
matchLabels:
component: terraform-service
Expand All @@ -32,6 +33,10 @@ spec:
value: {{ .Release.Namespace | quote }}
- name: GRPC_PORT
value: "8080"
- name: STATEFULSET_NAME
value: "terraform-service"
- name: CONTROLLER_THREAD_COUNT
value: {{ .Values.terraform.service.controllerWorkerThreadCount | quote }}
ports:
- containerPort: 8080
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
apiVersion: apps/v1
kind: StatefulSet
kind: Deployment
metadata:
name: vm-service
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ $.Values.vm.replicas }}
serviceName: "vm-service"
selector:
matchLabels:
component: vm-service
Expand Down
6 changes: 0 additions & 6 deletions charts/hobbyfarm/templates/vm-service/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ rules:
- apiGroups: [""]
resources: ["*"]
verbs: ["*"]
- apiGroups: ["hobbyfarm.io"]
resources: ["virtualmachines", "virtualmachines/status"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["statefulsets"]
verbs: ["list", "get", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
2 changes: 1 addition & 1 deletion charts/hobbyfarm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ terraform:
service:
image: hobbyfarm/terraform-service:v3.2.0
replicas: 1
controllerWorkerThreadCount: 1
logLevel: "0"
serviceAccountName: "hobbyfarm-terraform"
user:
Expand All @@ -135,7 +136,6 @@ user:
vm:
image: hobbyfarm/vm-service:v3.2.0
replicas: 1
controllerWorkerThreadCount: 1
logLevel: "0"
apiPort: 80
serviceAccountName: "hobbyfarm-vm"
Expand Down

0 comments on commit 24180b0

Please sign in to comment.