Skip to content

Commit

Permalink
Helm chart fixes (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
justcoon authored Jun 12, 2024
1 parent 044fa0d commit 7e51579
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 93 deletions.
2 changes: 1 addition & 1 deletion kube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ helm upgrade --install golem-default golem-chart -n golem

show kube files
```shell
helm component golem-chart
helm template golem-chart
```

delete
Expand Down
2 changes: 2 additions & 0 deletions kube/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ sleep 30
echo ""
echo "Installing golem to namespace $NAMESPACE"

kubectl create serviceaccount -n $NAMESPACE golem-sa-default

helm upgrade --install golem-default golem-chart -n $NAMESPACE

echo ""
Expand Down
97 changes: 41 additions & 56 deletions kube/golem-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,35 +179,29 @@ spec:
value: "{{ .Values.workerService.ports.grpc }}"
- name: GOLEM__PUBLIC_WORKER_API__ACCESS_TOKEN
value: "2A354594-7A63-4091-A46B-CC58D379F677"
{{- if eq .Values.componentCompiledStore.type "pvc" }}
- name: GOLEM__COMPILED_COMPONENT_SERVICE__TYPE
value: "Local"
- name: GOLEM__COMPILED_COMPONENT_SERVICE__CONFIG__ROOT
value: "/golem/component/compiled"
{{- end }}
{{- if eq .Values.componentCompiledStore.type "s3" }}
- name: GOLEM__COMPILED_COMPONENT_SERVICE__TYPE
value: "Enabled"
- name: GOLEM__COMPILED_COMPONENT_SERVICE__CONFIG__REGION
value: {{ .Values.componentCompiledStore.s3.region }}
- name: GOLEM__COMPILED_COMPONENT_SERVICE__CONFIG__OBJECT_PREFIX
value: {{ .Values.componentCompiledStore.s3.objectPrefix }}
- name: GOLEM__COMPILED_COMPONENT_SERVICE__CONFIG__BUCKET
value: {{ .Values.componentCompiledStore.s3.bucket }}
{{- end }}
{{- if eq .Values.workerBlobStore.type "pvc" }}
{{- if eq .Values.workerExecutorStore.type "pvc" }}
- name: GOLEM__BLOB_STORAGE__TYPE
value: "LocalFileSystem"
- name: GOLEM__BLOB_STORAGE__CONFIG__ROOT
value: "/golem"
value: "/golem/worker"
{{- end }}
{{- if eq .Values.workerBlobStore.type "s3" }}
{{- if eq .Values.workerExecutorStore.type "s3" }}
- name: GOLEM__BLOB_STORAGE__TYPE
value: "S3"
- name: GOLEM__BLOB_STORAGE__CONFIG__REGION
value: {{ .Values.workerBlobStore.s3.region }}
- name: GOLEM__BLOB_STORAGE__CONFIG__BUCKET_PREFIX
value: {{ .Values.workerBlobStore.s3.bucketPrefix }}
value: {{ .Values.workerExecutorStore.s3.region }}
- name: GOLEM__BLOB_STORAGE__CONFIG__OBJECT_PREFIX
value: {{ .Values.workerExecutorStore.s3.objectPrefix }}
- name: GOLEM__BLOB_STORAGE__CONFIG__COMPILATION_CACHE_BUCKET
value: {{ .Values.workerExecutorStore.s3.compilationCacheBucket }}
- name: GOLEM__BLOB_STORAGE__CONFIG__CUSTOM_DATA_BUCKET
value: {{ .Values.workerExecutorStore.s3.customDataBucket }}
- name: GOLEM__BLOB_STORAGE__CONFIG__OPLOG_PAYLOAD_BUCKET
value: {{ .Values.workerExecutorStore.s3.oplogPayloadBucket }}
- name: GOLEM__BLOB_STORAGE__CONFIG__COMPRESSED_OPLOG_BUCKETS
value: "{{ .Values.workerExecutorStore.s3.compressedOplogBuckets }}"
{{- end }}
- name: POD_NAME
valueFrom:
Expand All @@ -226,32 +220,17 @@ spec:
failureThreshold: 5
initialDelaySeconds: 45
timeoutSeconds: 2
{{- if or (eq .Values.componentCompiledStore.type "pvc") (eq .Values.workerBlobStore.type "pvc") }}
{{- if eq .Values.workerExecutorStore.type "pvc" }}
volumeMounts:
- name: golem-worker-executor-store-{{.Values.env}}
mountPath: /golem/worker
{{- end }}
{{- if eq .Values.componentCompiledStore.type "pvc" }}
- name: golem-component-compiled-store-{{.Values.env}}
mountPath: /golem/component/compiled
{{- end }}
{{- if eq .Values.workerBlobStore.type "pvc" }}
- name: golem-worker-blob-store-{{.Values.env}}
mountPath: /golem/worker/blob
{{- end }}
{{- if or (eq .Values.componentCompiledStore.type "pvc") (eq .Values.workerBlobStore.type "pvc") }}
{{- if eq .Values.workerExecutorStore.type "pvc" }}
volumes:
{{- end }}
{{- if eq .Values.componentCompiledStore.type "pvc" }}
- name: golem-component-compiled-store-{{.Values.env}}
- name: golem-worker-executor-store-{{.Values.env}}
persistentVolumeClaim:
claimName: golem-component-compiled-store-{{.Values.env}}
claimName: golem-worker-executor-store-{{.Values.env}}
{{- end }}
{{- if eq .Values.workerBlobStore.type "pvc" }}
- name: golem-worker-blob-store-{{.Values.env}}
persistentVolumeClaim:
claimName: golem-worker-blob-store-{{.Values.env}}
{{- end }}


---

apiVersion: apps/v1
Expand Down Expand Up @@ -526,23 +505,29 @@ spec:
value: "{{ .Values.componentCompilationService.ports.http }}"
- name: GOLEM__GRPC_PORT
value: "{{ .Values.componentCompilationService.ports.grpc }}"
{{- if eq .Values.componentCompiledStore.type "pvc" }}
- name: GOLEM__COMPILED_COMPONENT_SERVICE__TYPE
value: "Enabled"
{{- if eq .Values.workerExecutorStore.type "pvc" }}
- name: GOLEM__BLOB_STORAGE__TYPE
value: "LocalFileSystem"
- name: GOLEM__BLOB_STORAGE__CONFIG__ROOT
value: "/golem"
value: "/golem/worker"
{{- end }}
{{- if eq .Values.componentCompiledStore.type "s3" }}
- name: GOLEM__COMPILED_COMPONENT_SERVICE__TYPE
value: "Enabled"
{{- if eq .Values.workerExecutorStore.type "s3" }}
- name: GOLEM__BLOB_STORAGE__TYPE
value: "S3"
- name: GOLEM__BLOB_STORAGE__CONFIG__REGION
value: {{ .Values.componentCompiledStore.s3.region }}
- name: GOLEM__BLOB_STORAGE__CONFIG__BUCKET_PREFIX
value: {{ .Values.componentCompiledStore.s3.objectPrefix }}
value: {{ .Values.workerExecutorStore.s3.region }}
- name: GOLEM__BLOB_STORAGE__CONFIG__OBJECT_PREFIX
value: {{ .Values.workerExecutorStore.s3.objectPrefix }}
- name: GOLEM__BLOB_STORAGE__CONFIG__COMPILATION_CACHE_BUCKET
value: {{ .Values.workerExecutorStore.s3.compilationCacheBucket }}
- name: GOLEM__BLOB_STORAGE__CONFIG__CUSTOM_DATA_BUCKET
value: {{ .Values.workerExecutorStore.s3.customDataBucket }}
- name: GOLEM__BLOB_STORAGE__CONFIG__OPLOG_PAYLOAD_BUCKET
value: {{ .Values.workerExecutorStore.s3.oplogPayloadBucket }}
- name: GOLEM__BLOB_STORAGE__CONFIG__COMPRESSED_OPLOG_BUCKETS
value: "{{ .Values.workerExecutorStore.s3.compressedOplogBuckets }}"
{{- end }}
ports:
- name: http
Expand All @@ -557,14 +542,14 @@ spec:
failureThreshold: 5
initialDelaySeconds: 45
timeoutSeconds: 2
{{- if eq .Values.componentCompiledStore.type "pvc" }}
{{- if eq .Values.workerExecutorStore.type "pvc" }}
volumeMounts:
- name: golem-component-compiled-store-{{.Values.env}}
mountPath: /golem/component/compiled
- name: golem-worker-executor-store-{{.Values.env}}
mountPath: /golem/worker
{{- end }}
{{- if eq .Values.componentCompiledStore.type "pvc" }}
{{- if eq .Values.workerExecutorStore.type "pvc" }}
volumes:
- name: golem-component-compiled-store-{{.Values.env}}
- name: golem-worker-executor-store-{{.Values.env}}
persistentVolumeClaim:
claimName: golem-component-compiled-store-{{.Values.env}}
{{- end }}
claimName: golem-worker-executor-store-{{.Values.env}}
{{- end }}
27 changes: 5 additions & 22 deletions kube/golem-chart/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,16 @@ spec:
---
{{- end }}


{{- if eq .Values.componentCompiledStore.type "pvc" }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: golem-component-compiled-store-{{.Values.env}}
spec:
storageClassName: {{ .Values.componentCompiledStore.pvc.storageClassName }}
accessModes:
- {{ .Values.componentCompiledStore.pvc.accessMode }}
resources:
requests:
storage: {{ .Values.componentCompiledStore.pvc.storageSize }}
---
{{- end }}


{{- if eq .Values.workerBlobStore.type "pvc" }}
{{- if eq .Values.workerExecutorStore.type "pvc" }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: golem-worker-blob-store-{{.Values.env}}
name: golem-worker-executor-store-{{.Values.env}}
spec:
storageClassName: {{ .Values.workerBlobStore.pvc.storageClassName }}
storageClassName: {{ .Values.workerExecutorStore.pvc.storageClassName }}
accessModes:
- {{ .Values.workerBlobStore.pvc.accessMode }}
- {{ .Values.workerExecutorStore.pvc.accessMode }}
resources:
requests:
storage: {{ .Values.workerBlobStore.pvc.storageSize }}
storage: {{ .Values.workerExecutorStore.pvc.storageSize }}
{{- end }}
22 changes: 8 additions & 14 deletions kube/golem-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ shardManager:
image: golemservices/golem-shard-manager:latest
imagePullPolicy: Always
ports:
http: 8080
http: 8081
grpc: 9001
service:
type: ClusterIP
worker:
healthCheckType: "Grpc"
healthCheckType: "K8s"
redis:
port: 6379
host: golem-redis-master
Expand Down Expand Up @@ -99,7 +99,7 @@ componentCompilationService:
logging:
json: false

#serviceAccountName: golem-sa-default
serviceAccountName: golem-sa-default

env: default

Expand All @@ -114,26 +114,20 @@ componentStore:
bucket: ""
region: "us-east-1"

componentCompiledStore:
workerExecutorStore:
type: pvc
pvc:
storageClassName: hostpath
storageSize: 5Gi
accessMode: ReadWriteOnce
s3:
objectPrefix: ""
bucket: ""
region: "us-east-1"
compilationCacheBucket: "compilation-cache"
customDataBucket: "custom-data"
oplogPayloadBucket: "oplog-payload"
compressedOplogBuckets: "[oplog-archive-1]"

workerBlobStore:
type: pvc
pvc:
storageClassName: hostpath
storageSize: 5Gi
accessMode: ReadWriteOnce
s3:
bucketPrefix: ""
region: "us-east-1"

ingress:
type: nginx
Expand Down

0 comments on commit 7e51579

Please sign in to comment.