Skip to content

Commit

Permalink
Rework octopus storage to be optional, as well as provide existing cl…
Browse files Browse the repository at this point in the history
…aim names

Also up the version of the container to latest v2023.2.13113
  • Loading branch information
prom3theu5 committed Jul 24, 2023
1 parent ffd67f9 commit e795b1b
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 22 deletions.
4 changes: 2 additions & 2 deletions charts/octopus-deploy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.18
version: 1.0.19

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "2023.2.13100"
appVersion: "2023.2.13113"
33 changes: 32 additions & 1 deletion charts/octopus-deploy/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingRepositoryClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand All @@ -18,6 +19,9 @@ spec:
requests:
storage: {{.Values.persistence.repositoryVolumeSize}}
---
{{- end }}

{{- if and .Values.persistence.enabled (not .Values.persistence.existingArtifactsClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand All @@ -38,6 +42,9 @@ spec:
requests:
storage: {{.Values.persistence.artifactVolumeSize}}
---
{{- end }}

{{- if and .Values.persistence.enabled (not .Values.persistence.existingTaskLogClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand All @@ -56,4 +63,28 @@ spec:
{{- end }}
resources:
requests:
storage: {{.Values.persistence.taskVolumeSize}}
storage: {{.Values.persistence.taskLogVolumeSize}}
---
{{- end }}

{{- if and .Values.persistence.enabled (not .Values.persistence.existingServerLogClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: server-logs-claim
spec:
accessModes:
{{- if (gt (.Values.octopus.replicaCount | int) 1)}}
- ReadWriteMany
{{- else }}
- {{.Values.persistence.storageAccessMode}}
{{- end }}
{{- if (eq "-" (.Values.persistence.storageClassName | toString)) }}
storageClassName: ""
{{- else if .Values.persistence.storageClassName }}
storageClassName: "{{ .Values.persistence.storageClassName }}"
{{- end }}
resources:
requests:
storage: {{.Values.persistence.serverLogVolumeSize}}
{{- end }}
40 changes: 23 additions & 17 deletions charts/octopus-deploy/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,33 @@ spec:
terminationGracePeriodSeconds: 10
volumes:
- name: repository-vol
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: repository-claim
claimName: {{ .Values.persistence.existingRepositoryClaim | default "repository-claim" }}
{{- else }}
emptyDir: {}
{{- end }}
- name: artifacts-vol
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: artifacts-claim
claimName: {{ .Values.persistence.existingArtifactsClaim | default "artifacts-claim" }}
{{- else }}
emptyDir: {}
{{- end }}
- name: task-logs-vol
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: task-logs-claim
claimName: {{ .Values.persistence.existingTaskLogClaim | default "task-logs-claim" }}
{{- else }}
emptyDir: {}
{{- end }}
- name: server-logs-vol
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingServerLogClaim | default "server-logs-claim" }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.dockerHub.login }}
imagePullSecrets:
- name: dockerhubcreds
Expand Down Expand Up @@ -181,17 +200,4 @@ spec:
- -c
- URL=http://localhost:8080; response=$(/usr/bin/curl -k $URL/api/octopusservernodes/ping --write-out %{http_code} --silent --output /dev/null); /usr/bin/test "$response" -ge 200 && /usr/bin/test "$response" -le 299 || /usr/bin/test "$response" -eq 418
failureThreshold: 30
periodSeconds: 60
volumeClaimTemplates:
- metadata:
name: server-logs-vol
spec:
accessModes: [ "ReadWriteOnce" ]
{{- if (eq "-" (.Values.persistence.storageClassName | toString)) }}
storageClassName: ""
{{- else if .Values.persistence.storageClassName }}
storageClassName: "{{ .Values.persistence.storageClassName }}"
{{- end }}
resources:
requests:
storage: {{.Values.persistence.logVolumeSize}}
periodSeconds: 60
13 changes: 11 additions & 2 deletions charts/octopus-deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ octopus:
exposeServices: false

persistence:
enabled: true
storageClassName: ""
# When replica count is 1, this value defines the storage access type. When replica count is greater than 1, the
# storage more is always ReadWriteMany.
Expand All @@ -69,10 +70,18 @@ persistence:
# The size of the artifact volume
artifactVolumeSize: 1Gi
# The size of the task log volume
taskVolumeSize: 1Gi
taskLogVolumeSize: 1Gi
# The size of the server log volume. Each Octopus node mounts its own server log volume to ensure server logs
# persist across restarts.
logVolumeSize: 200Mi
serverLogVolumeSize: 200Mi
# The name of the existing Task Logs PVC
existingTaskLogClaim: ""
# The name of the existing Server Logs PVC
existingServerLogClaim: ""
# The name of the existing Repository PVC
existingRepositoryClaim: ""
# The name of the existing artifacts PVC
existingArtifactsClaim: ""

ingress:
enabled: false
Expand Down

0 comments on commit e795b1b

Please sign in to comment.