Skip to content

Commit

Permalink
ipfs-cluster: put volumeMounts on the right container and fix indenta…
Browse files Browse the repository at this point in the history
…tion (#251)

* ipfs-cluster: put volumeMounts on the right container and follow standard indentation

* ipfs-cluster: always have init-d-configmap volume

* ipfs-cluster: try fix init script permissions
  • Loading branch information
skylenet authored Nov 3, 2023
1 parent 9734d46 commit af54cf1
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 63 deletions.
2 changes: 1 addition & 1 deletion charts/ipfs-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: ipfs-cluster
description: Run ipfs cluster along with kubo (go-ipfs)
type: application
version: 0.1.10
version: 0.1.11
maintainers:
- name: skylenet
email: rafael@skyle.net
2 changes: 1 addition & 1 deletion charts/ipfs-cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ipfs-cluster

![Version: 0.1.10](https://img.shields.io/badge/Version-0.1.10-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.1.11](https://img.shields.io/badge/Version-0.1.11-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Run ipfs cluster along with kubo (go-ipfs)

Expand Down
114 changes: 53 additions & 61 deletions charts/ipfs-cluster/templates/ipfs.statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,45 @@ spec:
mountPath: /env
- name: init-d
mountPath: /container-init.d
{{- end }}
containers:
- name: ipfs
image: {{ .Values.ipfs.image.repository }}:{{ .Values.ipfs.image.tag }}
{{- if gt (len .Values.ipfs.customCommand) 0 }}
command:
{{- toYaml .Values.ipfs.customCommand | nindent 12}}
{{- end }}
{{- if gt (len .Values.ipfs.extraArgs) 0 }}
args:
{{- toYaml .Values.ipfs.extraArgs | nindent 12}}
{{- end }}
ports:
- containerPort: 4001
name: swarm
protocol: TCP
- containerPort: 4001
name: swarm-udp
protocol: UDP
- containerPort: 5001
name: api
- containerPort: 8080
name: gateway
- containerPort: 5353
name: zeroconf
protocol: UDP
{{- if .Values.ipfs.extraEnv }}
env:
{{- toYaml .Values.ipfs.extraEnv | nindent 12 }}
{{- end }}
volumeMounts:
- name: data
mountPath: /data/ipfs
{{- if .Values.p2pNodePort.enabled }}
- name: env-nodeport
mountPath: /env
- name: init-d
mountPath: /container-init.d
{{- end }}
{{- range $key, $value := .Values.ipfs.initScripts }}
- name: init-d-configmap
subPath: {{ $key }}
Expand All @@ -70,55 +109,8 @@ spec:
{{- if .Values.ipfs.extraVolumeMounts }}
{{ toYaml .Values.ipfs.extraVolumeMounts | nindent 12 }}
{{- end }}
{{- end }}
containers:
- name: ipfs
image: {{ .Values.ipfs.image.repository }}:{{ .Values.ipfs.image.tag }}
{{- if gt (len .Values.ipfs.customCommand) 0 }}
command:
{{- toYaml .Values.ipfs.customCommand | nindent 10}}
{{- end }}
{{- if gt (len .Values.ipfs.extraArgs) 0 }}
args:
{{- toYaml .Values.ipfs.extraArgs | nindent 10}}
{{- end }}
ports:
- containerPort: 4001
name: swarm
protocol: TCP
- containerPort: 4001
name: swarm-udp
protocol: UDP
- containerPort: 5001
name: api
- containerPort: 8080
name: gateway
- containerPort: 5353
name: zeroconf
protocol: UDP
{{- if .Values.ipfs.extraEnv }}
env:
{{- toYaml .Values.ipfs.extraEnv | nindent 10 }}
{{- end }}
# livenessProbe:
# httpGet:
# path: /
# port: gateway
# readinessProbe:
# httpGet:
# path: /
# port: gateway
volumeMounts:
- name: data
mountPath: /data/ipfs
{{- if .Values.p2pNodePort.enabled }}
- name: env-nodeport
mountPath: /env
- name: init-d
mountPath: /container-init.d
{{- end }}
resources:
{{- toYaml .Values.ipfs.resources | nindent 12 }}
resources:
{{- toYaml .Values.ipfs.resources | nindent 12 }}
{{- with .Values.ipfs.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -137,22 +129,22 @@ spec:
emptyDir: {}
- name: init-d
emptyDir: {}
{{- end }}
- name: init-d-configmap
configMap:
name: {{ include "helm-ipfs-cluster.ipfs-name" . }}-init-d
defaultMode: 504
{{- end }}
defaultMode: 0777
{{- if .Values.ipfs.extraVolumes }}
{{ toYaml .Values.ipfs.extraVolumes | nindent 8}}
{{- end }}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
{{- with .Values.ipfs.storage.storageClassName }}
storageClassName: {{ . }}
{{- end }}
resources:
requests:
storage: {{ .Values.ipfs.storage.volumeSize | default "1Gi" }}
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
{{- with .Values.ipfs.storage.storageClassName }}
storageClassName: {{ . }}
{{- end }}
resources:
requests:
storage: {{ .Values.ipfs.storage.volumeSize | default "1Gi" }}

0 comments on commit af54cf1

Please sign in to comment.