diff --git a/awx/README.md b/awx/README.md index d73e737..21c84b6 100644 --- a/awx/README.md +++ b/awx/README.md @@ -82,6 +82,11 @@ Per the AWX documentation, if you choose to turn off Job Isolation you can do so | postgresql.enabled | bool | `true` | Set to false if using external postgresql | | postgresql.postgresqlHost | string | `nil` | Set this only if using an external postgresql database. Alternatively, you can provide this value through postgresqlExistingSecret. | | postgresql.postgresqlPassword | string | `nil` | You must set this value or provide postgresqlExistingSecret | +| postgresql.pv.enabled | bool | `false` | Set to true if you want to create local pv | +| postgresql.pv.size | string | `8Gi` | Size of the local pv to create postgres default is 8Gi | +| postgresql.pv.path | string | `"/mnt/data"` | path of where to mount the pv | +| postgresql.persistence.selector | {} | `{"matchLabels": {"type": "awx-local"}` | Selector to match an existing Persistent Volume | +| postgresql.volumePermissions.enabled | bool | `false` | Set to true if you want to create local pv with non root permissions | | postgresqlExistingSecret | string | `nil` | The name of an existing secret in the same namespace containing DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, DATABASE_ADMIN_PASSWORD keys and values | | redis | object | `{"architecture":"standalone","auth":{"enabled":false},"enabled":true,"host":null,"image":{"tag":"6.2.4"},"port":6379}` | See bitnami/redis chart values for all options | | redis.enabled | bool | `true` | Set to false if using external redis | diff --git a/awx/templates/pv.yaml b/awx/templates/pv.yaml new file mode 100644 index 0000000..f9fbdd1 --- /dev/null +++ b/awx/templates/pv.yaml @@ -0,0 +1,19 @@ +{{- if and ( .Values.postgresql.persistence.enabled ) ( .Values.postgresql.persistence.pv.enabled ) }} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ include "awx.fullname" . }}-volume + labels: + type: {{ .Values.postgresql.persistence.pv.selector.matchLabels.type }} + app.kubernetes.io/name: {{ include "awx.name" . }} + helm.sh/chart: {{ include "awx.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} +spec: + capacity: + storage: {{ .Values.postgresql.persistence.pv.size }} + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.postgresql.persistence.pv.path }} +{{- end }} diff --git a/awx/values.yaml b/awx/values.yaml index f2c8c99..e4452da 100644 --- a/awx/values.yaml +++ b/awx/values.yaml @@ -114,9 +114,20 @@ postgresql: persistence: enabled: true # size: 50Gi + # if pv enabled you should enable volumePermissions as well + pv: + enabled: false + size: 8Gi + path: "/mnt/data" + selector: + matchLabels: + type: awx-local # resources: {} metrics: enabled: false + volumePermissions: + enabled: false + # -- The name of an existing secret in the same namespace containing DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, DATABASE_ADMIN_PASSWORD keys and values postgresqlExistingSecret: