Commit 3b9c6e85 authored by sonicaj's avatar sonicaj

Clean old app versions

parent dc467f3d
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
# OWNERS file for Kubernetes
OWNERS
\ No newline at end of file
apiVersion: v1
description: Global, Versioned, peer-to-peer filesystem.
name: chia
version: 1.2.0
appVersion: 1.1.6
keywords:
- storage
- crypto
- blockchain
home: https://www.chia.net/
icon: https://www.chia.net/img/chia_logo.svg
sources:
- https://github.com/Chia-Network/chia-blockchain
- https://github.com/orgs/chia-network/packages/container/package/chia
dependencies:
- name: common
repository: file://../../../library/common/2104.0.0
version: 2104.0.0
Chia Network
=====
[CHIA](https://www.chia.net/) is a new blockchain and smart transaction platform that is easier to use, more efficient, and secure.
Introduction
------------
This chart bootstraps CHIA deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
Chia Network
=====
[CHIA](https://www.chia.net/) is a new blockchain and smart transaction platform that is easier to use, more efficient, and secure.
image:
repository: ghcr.io/chia-network/chia
tag: 1.1.4
pullPolicy: IfNotPresent
updateStrategy: Recreate
environmentVariables:
- name: "keys"
value: "/plots/keyfile"
appVolumeMounts:
staging:
emptyDir: true
mountPath: "/plots"
data:
emptyDir: true
mountPath: "/root/.chia"
image:
repository: ghcr.io/chia-network/chia
tag: 1.1.6
pullPolicy: IfNotPresent
updateStrategy: Recreate
groups:
- name: "Storage"
description: "Configure Storage for Chia"
- name: "Chia Environment Variables"
description: "Set the environment that will be visible to the container"
questions:
- variable: appVolumeMounts
label: "Chia Storage"
group: "Storage"
schema:
type: dict
attrs:
- variable: config
label: "Configuration Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Configuration Volume Dataset Name"
schema:
type: string
hidden: true
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "config"
editable: false
- variable: mountPath
label: "Configuration Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: false
default: "/root/.chia"
- variable: hostPathEnabled
label: "Enable Custom Host Path for Chia Configuration Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Chia Configuration Volume"
schema:
type: hostpath
required: true
- variable: plots
label: "Plot Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Plots Volume Name"
schema:
type: string
hidden: true
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "plots"
editable: false
- variable: mountPath
label: "Plots Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: false
default: "/plots"
- variable: hostPathEnabled
label: "Enable Custom Host Path for Chia Plots Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Chia Plots Volume"
schema:
type: hostpath
required: true
- variable: extraAppVolumeMounts
label: "Chia Extra Host Path Volumes"
group: "Storage"
schema:
type: list
items:
- variable: extraAppVolume
label: "Chia Host Path Volume"
description: "Add an extra host path volume for chia application"
schema:
type: dict
attrs:
- variable: mountPath
label: "Mount Path in Pod"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
required: true
- variable: hostPath
label: "Host Path"
description: "Host path"
schema:
type: hostpath
required: true
- variable: environmentVariables
label: "Environment Variables for Chia"
group: "Chia Environment Variables"
schema:
type: list
default: []
items:
- variable: environmentVariable
label: "Environment Variable"
schema:
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
- variable: value
label: "Value"
schema:
type: string
dependencies:
- name: common
repository: file://../../../library/common/2104.0.0
version: 2104.0.0
digest: sha256:f0aa221073aafcc5e1602c2a9acb1a508ce72f6847c33dd4a9f9fe10017d5009
generated: "2021-04-08T16:09:30.006044+05:00"
apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "common.names.fullname" . }}
labels: {{ include "common.labels" . | nindent 4 }}
spec:
strategy:
type: {{ .Values.updateStrategy }}
selector:
matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
template:
metadata:
name: {{ template "common.names.fullname" . }}
labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
spec:
# FIXME: Let's please remove hostnetwork when upstream hostport issue is sorted out with kube-router
hostNetwork: true
containers:
- name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
mountPath: {{ $hostPathConfiguration.mountPath }}
{{ end }}
ports:
- name: chia-network
protocol: TCP
containerPort: 8444
hostPort: 8444
{{ $envList := (default list .Values.environmentVariables) }}
{{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }}
{{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
hostPath:
path: {{ $hostPathConfiguration.hostPath }}
{{ end }}
apiVersion: batch/v1
kind: Job
metadata:
name: "pre-install"
annotations:
"helm.sh/hook": pre-install
"helm.sh/hook-weight": "1"
"helm.sh/hook-delete-policy": hook-succeeded
spec:
template:
metadata:
name: "pre-upgrade-hook2"
spec:
restartPolicy: Never
containers:
- name: {{ .Chart.Name }}-generate-mnemonic
{{ include "common.containers.imageConfig" .Values.image | nindent 8 }}
volumeMounts:{{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 10 }}
- name: generate-mnemonic-configmap
mountPath: /generate_entrypoint.sh
readOnly: true
subPath: entrypoint.sh
command:
- "/generate_entrypoint.sh"
volumes: {{- include "common.storage.configureAppVolumes" .Values | nindent 8 -}}
- name: generate-mnemonic-configmap
configMap:
defaultMode: 0700
name: "generate-mnemonic-config-map"
apiVersion: v1
kind: ConfigMap
metadata:
name: "generate-mnemonic-config-map"
annotations:
"helm.sh/hook": pre-install
"helm.sh/hook-weight": "-1"
"helm.sh/hook-delete-policy": hook-succeeded
data:
entrypoint.sh: |-
#!/bin/sh
if [ ! -e /plots/keyfile ]; then
/chia-blockchain/venv/bin/python3 -c "from chia.util.keychain import generate_mnemonic;print(generate_mnemonic())" > /plots/keyfile;
fi
image:
repository: ghcr.io/chia-network/chia
tag: 1.1.6
pullPolicy: IfNotPresent
updateStrategy: Recreate
appVolumeMounts:
staging:
emptyDir: true
mountPath: "/plots"
data:
emptyDir: true
mountPath: "/root/.chia"
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
# OWNERS file for Kubernetes
OWNERS
\ No newline at end of file
apiVersion: v1
description: Global, Versioned, peer-to-peer filesystem.
name: ipfs
version: 1.0.2
appVersion: v0.8.0
keywords:
- storage
- p2p
home: https://ipfs.io
icon: https://ipfs.io/ipfs/QmVk7srrwahXLNmcDYvyUEJptyoxpndnRa57YJ11L4jV26/ipfs.go.png
sources:
- https://github.com/ipfs/go-ipfs
- https://hub.docker.com/r/ipfs/go-ipfs
upstream_version: 0.8.0-rc1
dependencies:
- name: common
repository: file://../../../library/common/2101.0.0
version: 2101.0.0
IPFS
=====
[IPFS](https://ipfs.io) is a global, versioned, peer-to-peer filesystem. It combines good ideas from previous systems such Git, BitTorrent, Kademlia, SFS, and the Web. It is like a single bittorrent swarm, exchanging git objects. IPFS provides an interface as simple as the HTTP web, but with permanence built in. You can also mount the world at /ipfs.
Introduction
------------
This chart bootstraps IPFS deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
Configuration
-------------
The following table lists the configurable parameters of the IPFS chart and their default values.
| Parameter | Description | Default |
|:-------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------|
| `image.repository` | Image repository | `ipfs/go-ipfs` |
| `image.tag` | IPFS image tag. Possible values listed [here](https://hub.docker.com/r/ipfs/go-ipfs/tags). | `v0.8.0-rc1` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `extraArgs` | Additional command line arguments to pass to the IPFS server | `[]` |
[IPFS](https://ipfs.io) is a global, versioned, peer-to-peer filesystem. It combines good ideas from previous systems such Git, BitTorrent, Kademlia, SFS, and the Web. It is like a single bittorrent swarm, exchanging git objects. IPFS provides an interface as simple as the HTTP web, but with permanence built in. You can also mount the world at /ipfs.
## Set default image, imageTag, and imagePullPolicy. mode is used to indicate the
##
image:
repository: ipfs/go-ipfs
tag: v0.8.0-rc1
pullPolicy: IfNotPresent
## Additional arguments to pass to ipfs binary
extraArgs: []
updateStrategy: Recreate
service:
swarmPort: 9401
apiPort: 9501
gatewayPort: 9080
environment:
appVolumeMounts:
staging:
emptyDir: true
mountPath: "/export"
data:
emptyDir: true
mountPath: "/data/ipfs"
image:
repository: ipfs/go-ipfs
tag: v0.8.0
pullPolicy: IfNotPresent
groups:
- name: "Container Images"
description: "Image to be used for container"
- name: "Workload Configuration"
description: "Configure Storage for IPFS"
- name: "Storage"
description: "Configure Storage for IPFS"
- name: "IPFS Configuration"
description: "Configure Storage for IPFS"
portals:
web_portal:
protocols:
- "http"
host:
- "$node_ip"
ports:
- "$variable-service.apiPort"
path: "/webui"
questions:
- variable: updateStrategy
label: "IPFS update strategy"
group: "Workload Configuration"
schema:
type: string
default: "Recreate"
enum:
- value: "RollingUpdate"
description: "Create new pods and then kill old ones"
- value: "Recreate"
description: "Kill existing pods before creating new ones"
- variable: environmentVariables
label: "IPFS image environment"
group: "IPFS Configuration"
schema:
type: list
default: []
items:
- variable: environmentVariable
label: "Environment Variable"
schema:
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
- variable: value
label: "Value"
schema:
type: string
- variable: service
description: "IPFS Service Configuration"
label: "IPFS Service Configuration"
group: "IPFS Configuration"
schema:
type: dict
required: true
attrs:
- variable: swarmPort
label: "Swarm Port to use for IPFS (Public)"
schema:
type: int
min: 9000
max: 65535
default: 9401
required: true
- variable: apiPort
label: "API Port to use for IPFS (local)"
schema:
type: int
min: 9000
max: 65535
default: 9501
required: true
- variable: gatewayPort
label: "Gateway Port to use for IPFS (local)"
schema:
type: int
min: 9000
max: 65535
default: 9880
required: true
- variable: appVolumeMounts
label: "IPFS Storage"
group: "Storage"
schema:
type: dict
attrs:
- variable: staging
label: "Staging Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "IPFS Staging Volume Dataset Name"
schema:
type: string
hidden: true
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-ipfs-staging"
editable: false
- variable: mountPath
label: "IPFS Staging Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: false
default: "/export"
- variable: hostPathEnabled
label: "Enable Host Path for IPFS Staging Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for IPFS Staging Volume"
schema:
type: hostpath
required: true
- variable: data
label: "Data Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "IPFS Data Volume Name"
schema:
type: string
hidden: true
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-ipfs-data"
editable: false
- variable: mountPath
label: "IPFS Data Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: false
default: "/data/ipfs"
- variable: hostPathEnabled
label: "Enable Host Path for IPFS Data Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for IPFS Data Volume"
schema:
type: hostpath
required: true
dependencies:
- name: common
repository: file://../../../library/common/2101.0.0
version: 2101.0.0
digest: sha256:6ab46f958de11ae6a24d8f7e18417aa9852a8d968d5b0cc94ffa4700449931d6
generated: "2021-02-04T01:15:55.312886+05:00"
IPFS can be accessed from the following URL:
http://$node_ip:{{ .Values.service.apiPort }}/webui
apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "common.names.fullname" . }}
labels: {{ include "common.labels" . | nindent 4 }}
spec:
strategy:
type: {{ .Values.updateStrategy }}
selector:
matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
template:
metadata:
name: {{ template "common.names.fullname" . }}
labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }}
initContainers:
- name: init-init
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
command: ['/bin/sh', '-c', '[ ! -e /data/ipfs/config ] && (/usr/local/bin/ipfs init ; chown -R 1000:100 /data/ipfs) ; exit 0']
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
- name: init-api
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
command: ['/usr/local/bin/ipfs', 'config', 'Addresses.API', "/ip4/0.0.0.0/tcp/9501"]
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
- name: init-gateway
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
command: ['/usr/local/bin/ipfs', 'config', 'Addresses.Gateway', "/ip4/0.0.0.0/tcp/9080"]
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
- name: init-swarm
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
command: ['/usr/local/bin/ipfs', 'config', '--json', 'Addresses.Swarm', "[\"/ip4/0.0.0.0/tcp/9401\",\"/ip4/0.0.0.0/tcp/9401/quic\"]" ]
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
- name: init-access-origin
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Origin', "[\"*\"]" ]
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
- name: init-access-methods
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Methods', "[\"PUT\",\"POST\"]" ]
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
- name: init-chown
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
command: ['chown', '1000:100', '/data/ipfs/config']
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
containers:
- name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
ports:
- name: swarm
containerPort: 9401
- name: api
containerPort: 9501
- name: gateway
containerPort: 9880
{{ include "common.containers.allEnvironmentVariables" .Values | nindent 10 }}
{{ include "common.storage.allAppVolumes" .Values | nindent 6 }}
{{ $svc := .Values.service }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "swarm" "port" $svc.swarmPort "nodePort" $svc.swarmPort "targetPort" 9401) }}
{{ $ports = mustAppend $ports (dict "name" "api" "port" $svc.apiPort "nodePort" $svc.apiPort "targetPort" 9501) }}
{{ $ports = mustAppend $ports (dict "name" "gateway" "port" $svc.gatewayPort "nodePort" $svc.gatewayPort "targetPort" 9880) }}
{{ $params := . }}
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
{{ include "common.classes.service" $params }}
{{ include "common.serviceaccount" . }}
## Set default image, imageTag, and imagePullPolicy. mode is used to indicate the
##
image:
repository: ipfs/go-ipfs
tag: v0.8.0
pullPolicy: IfNotPresent
## Additional arguments to pass to minio binary
extraArgs: []
updateStrategy: Recreate
service:
swarmPort: 30941
apiPort: 30951
gatewayPort: 30980
environmentVariables: []
emptyDirVolumes: true
appVolumeMounts:
staging:
emptyDir: true
mountPath: "/export"
data:
emptyDir: true
mountPath: "/data/ipfs"
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
# OWNERS file for Kubernetes
OWNERS
\ No newline at end of file
* TLS Support added for Minio application. This lets users to use TrueNAS certificates with Minio Application.
\ No newline at end of file
apiVersion: v1
description: High Performance, Kubernetes Native Object Storage
name: minio
version: 1.2.1
appVersion: RELEASE.2021-04-06T23-11-00Z
keywords:
- storage
- object-storage
- S3
home: https://min.io
icon: https://min.io/resources/img/logo/MINIO_wordmark.png
sources:
- https://github.com/minio/minio
- https://github.com/minio/charts
upstream_version: 8.0.5
dependencies:
- name: common
repository: file://../../../library/common/2101.0.0
version: 2101.0.0
MinIO
=====
[MinIO](https://min.io) is a High Performance Object Storage released under Apache License v2.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads.
MinIO supports [distributed mode](https://docs.minio.io/docs/distributed-minio-quickstart-guide). In distributed mode, you can pool multiple drives (even on different machines) into a single object storage server.
For more detailed documentation please visit [here](https://docs.minio.io/)
Introduction
------------
This chart bootstraps MinIO deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
Configuration
-------------
The following table lists the configurable parameters of the MinIO chart and their default values.
| Parameter | Description | Default |
|:-------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------|
| `image.repository` | Image repository | `minio/minio` |
| `image.tag` | MinIO image tag. Possible values listed [here](https://hub.docker.com/r/minio/minio/tags/). | `RELEASE.2020-11-06T23-17-07Z` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `extraArgs` | Additional command line arguments to pass to the MinIO server | `[]` |
| `accessKey` | Default access key (5 to 20 characters) | random 20 chars |
| `secretKey` | Default secret key (8 to 40 characters) | random 40 chars |
| `persistence.enabled` | Use persistent volume to store data | `true` |
| `persistence.size` | Size of persistent volume claim | `500Gi` |
| `persistence.existingClaim` | Use an existing PVC to persist data | `nil` |
| `persistence.storageClass` | Storage class name of PVC | `nil` |
| `persistence.accessMode` | ReadWriteOnce or ReadOnly | `ReadWriteOnce` |
| `persistence.subPath` | Mount a sub directory of the persistent volume if set | `""` |
| `environment` | Set MinIO server relevant environment variables in `values.yaml` file. MinIO containers will be passed these variables when they start. | `MINIO_STORAGE_CLASS_STANDARD: EC:4"` |
Some parameters above map to the env variables defined in the [MinIO DockerHub image](https://hub.docker.com/r/minio/minio/).
Pass environment variables to MinIO containers
----------------------------------------------
To pass environment variables to MinIO containers when deploying via Helm chart, use the below command line format
```bash
$ helm install --set environment.MINIO_BROWSER=on,environment.MINIO_DOMAIN=domain-name minio/minio
```
You can add as many environment variables as required, using the above format. Just add `environment.<VARIABLE_NAME>=<value>` under `set` flag.
[MinIO](https://min.io) is a High Performance Object Storage released under Apache License v2.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads.
## Set default image, imageTag, and imagePullPolicy. mode is used to indicate the
##
image:
repository: minio/minio
tag: RELEASE.2020-11-19T23-48-16Z
pullPolicy: IfNotPresent
## Additional arguments to pass to minio binary
extraArgs: []
updateStrategy: RollingUpdate
service:
nodePort: 9000
environment:
## Please refer for comprehensive list https://docs.minio.io/docs/minio-server-configuration-guide.html
appVolumeMounts:
export:
emptyDir: true
mountPath: "/export"
image:
repository: minio/minio
tag: RELEASE.2021-04-06T23-11-00Z
pullPolicy: IfNotPresent
#!/usr/bin/python3
import json
import os
import sys
def migrate(values):
if values.get('appVolumeMounts'):
return values
values.update({
'appVolumeMounts': {
'export': {
'hostPathEnabled': values['minioHostPathEnabled'],
**({'hostPath': values['minioHostPath']} if values.get('minioHostPath') else {})
},
},
})
return values
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
if os.path.exists(sys.argv[1]):
with open(sys.argv[1], 'r') as f:
print(json.dumps(migrate(json.loads(f.read()))))
groups:
- name: "Container Images"
description: "Image to be used for container"
- name: "Workload Configuration"
description: "Configure workload deployment"
- name: "Storage"
description: "Configure Storage for Nextcloud"
- name: "Minio Configuration"
description: "Configure Minio credentials"
portals:
web_portal:
protocols:
- "$kubernetes-resource_configmap_minio-config_protocol"
host:
- "$node_ip"
ports:
- "$variable-service.nodePort"
questions:
- variable: updateStrategy
label: "Minio update strategy"
group: "Workload Configuration"
schema:
type: string
default: "RollingUpdate"
enum:
- value: "RollingUpdate"
description: "Create new pods and then kill old ones"
- value: "Recreate"
description: "Kill existing pods before creating new ones"
- variable: extraArgs
label: "Minio Extra Arguments"
group: "Minio Configuration"
schema:
type: list
default: []
items:
- variable: arg
label: "Argument"
schema:
type: string
- variable: accessKey
label: "Access Key"
group: "Minio Configuration"
description: "Enter the S3 access ID"
schema:
type: string
private: true
required: true
min_length: 5
max_length: 20
- variable: secretKey
label: "Secret Key"
group: "Minio Configuration"
description: "Enter the S3 secret access key"
schema:
type: string
private: true
required: true
min_length: 8
max_length: 40
- variable: environmentVariables
label: "Minio image environment"
group: "Minio Configuration"
schema:
type: list
default: []
items:
- variable: environmentVariable
label: "Environment Variable"
schema:
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
- variable: value
label: "Value"
schema:
type: string
- variable: service
description: "Minio Service Configuration"
label: "Minio Service Configuration"
group: "Minio Configuration"
schema:
type: dict
required: true
attrs:
- variable: nodePort
label: "Node Port to use for Minio"
schema:
type: int
min: 9000
max: 65535
default: 9000
required: true
- variable: certificate
description: "Minio Certificate"
label: "Minio Certificate"
group: "Minio Configuration"
schema:
type: int
$ref:
- "definitions/certificate"
- variable: appVolumeMounts
label: "Minio Storage"
group: "Storage"
schema:
type: dict
attrs:
- variable: export
label: "Data Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Minio Data Volume Name"
schema:
type: string
hidden: true
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-minio"
editable: false
- variable: mountPath
label: "Minio Data Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: false
default: "/export"
- variable: hostPathEnabled
label: "Enable Host Path for Minio Data Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Minio Data Volume"
schema:
type: hostpath
required: true
dependencies:
- name: common
repository: file://../../../library/common/2101.0.0
version: 2101.0.0
digest: sha256:6ab46f958de11ae6a24d8f7e18417aa9852a8d968d5b0cc94ffa4700449931d6
generated: "2021-02-04T01:15:55.416388+05:00"
Minio can be accessed from the following URL:
http://$node_ip:{{ .Values.service.nodePort }}/
{{/*
Formats volumeMount for Minio tls keys and trusted certs
*/}}
{{- define "minio.tlsKeysVolumeMount" -}}
{{- if eq (include "minio.certAvailable" .) "true" -}}
- name: cert-secret-volume
mountPath: "/etc/minio/certs"
- name: trusted-cert-secret-volume
mountPath: "/etc/minio/certs/CAs"
{{- end }}
{{- end -}}
{{/*
Formats volume for Minio tls keys and trusted certs
*/}}
{{- define "minio.tlsKeysVolume" -}}
{{- if eq (include "minio.certAvailable" .) "true" -}}
- name: cert-secret-volume
secret:
secretName: {{ include "minio.secretName" . }}
items:
- key: certPublicKey
path: public.crt
- key: certPrivateKey
path: private.key
- name: trusted-cert-secret-volume
secret:
secretName: {{ include "minio.secretName" . }}
items:
- key: certPublicKey
path: public.crt
{{- end }}
{{- end -}}
{{/*
Determine secret name.
*/}}
{{- define "minio.secretName" -}}
{{- include "common.names.fullname" . -}}
{{- end -}}
{{/*
Retrieve true/false if minio certificate is configured
*/}}
{{- define "minio.certAvailable" -}}
{{- if .Values.certificate -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
{{- template "common.resources.cert_present" $values -}}
{{- else -}}
{{- false -}}
{{- end -}}
{{- end -}}
{{/*
Retrieve public key of minio certificate
*/}}
{{- define "minio.cert.publicKey" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate "publicKey" true) -}}
{{ include "common.resources.cert" $values }}
{{- end -}}
{{/*
Retrieve private key of minio certificate
*/}}
{{- define "minio.cert.privateKey" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
{{ include "common.resources.cert" $values }}
{{- end -}}
{{ $scheme := "http" }}
{{ if eq (include "minio.certAvailable" .) "true" }}
{{ $scheme = "https" }}
{{ end }}
apiVersion: v1
kind: ConfigMap
metadata:
name: minio-config
data:
protocol: {{ $scheme }}
apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "common.names.fullname" . }}
labels:
app: {{ template "common.names.name" . }}
chart: {{ template "common.names.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ (default 1 .Values.replicas) }}
strategy:
type: {{ (default "Recreate" .Values.updateStrategy ) }}
selector:
matchLabels:
app: {{ template "common.names.name" . }}
release: {{ .Release.Name }}
template:
metadata:
name: {{ template "common.names.fullname" . }}
labels:
app: {{ template "common.names.name" . }}
release: {{ .Release.Name }}
{{- include "common.labels.selectorLabels" . | nindent 8 }}
annotations: {{ include "common.annotations" . | nindent 8 }}
spec:
serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }}
containers:
- name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
{{- include "minio.tlsKeysVolumeMount" . | nindent 12 }}
command:
- "/bin/sh"
- "-ce"
- "/usr/bin/docker-entrypoint.sh minio -S /etc/minio/certs server /export {{ (.Values.extraArgs | default list) | join " " }}"
ports:
- name: http
containerPort: 9000
env:
{{ $secretName := (include "minio.secretName" .) }}
{{ $envList := (default list .Values.environment) }}
{{ $envList = mustAppend $envList (dict "name" "MINIO_ACCESS_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey") }}
{{ $envList = mustAppend $envList (dict "name" "MINIO_SECRET_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }}
{{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
{{ include "common.storage.allAppVolumes" .Values | nindent 6 }}
{{- include "minio.tlsKeysVolume" . | nindent 8 }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "minio.secretName" . }}
labels: {{ include "common.labels" . | nindent 4 }}
type: Opaque
data:
accesskey: {{ if .Values.accessKey }}{{ .Values.accessKey | toString | b64enc | quote }}{{ else }}{{ randAlphaNum 20 | b64enc | quote }}{{ end }}
secretkey: {{ if .Values.secretKey }}{{ .Values.secretKey | toString | b64enc | quote }}{{ else }}{{ randAlphaNum 40 | b64enc | quote }}{{ end }}
{{ if eq (include "minio.certAvailable" .) "true" }}
certPublicKey: {{ (include "minio.cert.publicKey" .) | toString | b64enc | quote }}
certPrivateKey: {{ (include "minio.cert.privateKey" .) | toString | b64enc | quote }}
{{ end }}
{{ $svc := .Values.service }}
{{ $selectors := list }}
{{ $selectors = mustAppend $selectors (dict "key" "app" "value" (include "common.names.name" .) ) }}
{{ $selectors = mustAppend $selectors (dict "key" "release" "value" .Release.Name ) }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "http" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" 9000) }}
{{ $params := . }}
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
{{ $_1 := set .Values "extraSelectorLabels" $selectors }}
{{ include "common.classes.service" $params }}
{{ include "common.serviceaccount" . }}
## Set default image, imageTag, and imagePullPolicy. mode is used to indicate the
##
image:
repository: minio/minio
tag: RELEASE.2021-02-19T04-38-02Z
pullPolicy: IfNotPresent
## Additional arguments to pass to minio binary
extraArgs: []
updateStrategy: RollingUpdate
service:
nodePort: 32324
environmentVariables: []
## Please refer for comprehensive list https://docs.minio.io/docs/minio-server-configuration-guide.html
emptyDirVolumes: true
appVolumeMounts:
export:
emptyDir: true
mountPath: "/export"
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
dependencies:
- name: common
repository: file://../../../library/common/2101.0.0
version: 2101.0.0
digest: sha256:6ab46f958de11ae6a24d8f7e18417aa9852a8d968d5b0cc94ffa4700449931d6
generated: "2021-02-04T01:15:55.262077+05:00"
apiVersion: v2
name: nextcloud
version: 1.2.1
appVersion: 21.0.0
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
- nextcloud
- storage
- http
- web
- php
home: https://nextcloud.com/
icon: https://cdn.rawgit.com/docker-library/docs/defa5ffc7123177acd60ddef6e16bddf694cc35f/nextcloud/logo.svg
sources:
- https://github.com/nextcloud/docker
- https://github.com/nextcloud/helm
upstream_version: 2.3.2
dependencies:
- name: common
repository: file://../../../library/common/2101.0.0
version: 2101.0.0
# nextcloud
[nextcloud](https://nextcloud.com/) is a file sharing server that puts the control and security of your own data back into your hands.
## Introduction
This chart bootstraps an [nextcloud](https://hub.docker.com/_/nextcloud/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
## Configuration
Please refer to questions.yaml for a detailed overview on supported configurable values.
# nextcloud
[nextcloud](https://nextcloud.com/) is a file sharing server that puts the control and security of your own data back into your hands.
## Official nextcloud image version
## ref: https://hub.docker.com/r/library/nextcloud/tags/
##
image:
repository: nextcloud
tag: 19.0.3-apache
pullPolicy: IfNotPresent
nextcloud:
host: nextcloud.kube.home
username: admin
password: changeme
datadir: /var/www/html/data
strategy: "Recreate"
service:
nodePort: 9001
appVolumeMounts:
nextcloud-data:
emptyDir: true
mountPath: "/var/www"
postgresAppVolumeMounts:
postgres-data:
emptyDir: true
mountPath: "/var/lib/postgresql/data"
postgres-backup:
emptyDir: true
mountPath: "/postgres_backups"
image:
repository: nextcloud
tag: 21.0.0
pullPolicy: IfNotPresent
#!/usr/bin/python3
import json
import os
import sys
def migrate(values):
values.update({
'appVolumeMounts': {
'nextcloud-data': {
'hostPathEnabled': values['nextcloudDataHostPathEnabled'],
**({'hostPath': values['nextcloudHostPath']} if values.get('nextcloudHostPath') else {})
},
},
'updateStrategy': values.get('nextcloud').get('strategy', 'Recreate'),
})
return values
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
if os.path.exists(sys.argv[1]):
with open(sys.argv[1], 'r') as f:
print(json.dumps(migrate(json.loads(f.read()))))
groups:
- name: "Container Images"
description: "Image to be used for container"
- name: "Nextcloud Configuration"
description: "Configuration details for Nextcloud workload"
- name: "Storage"
description: "Configure Storage for Nextcloud"
- name: "Container Configuration"
description: "Configure nextcloud container parameters"
- name: "Postgresql Configuration"
description: "Configure Postgresql for nextcloud"
- name: "Scaling/Upgrade Policy"
description: "Configure how pods are replaced when configuration is upgraded"
portals:
web_portal:
protocols:
- "http"
host:
- "$variable-nextcloud.host"
ports:
- "$variable-service.nodePort"
questions:
- variable: nextcloud
description: "Nextcloud configuration details"
label: "Nextcloud Configuration"
group: "Nextcloud Configuration"
schema:
type: dict
required: true
additional_attrs: true
attrs:
- variable: host
description: "Nextcloud host to create application URLs"
label: "Nextcloud host"
schema:
type: string
$ref:
- "definitions/nodeIP"
- variable: username
label: "Username"
description: "Name of the Nextcloud admin user"
schema:
type: string
default: "admin"
required: true
- variable: password
label: "Password"
description: "Password for the Nextcloud admin user"
schema:
type: string
private: true
default: "changeme"
required: true
- variable: datadir
label: "Nextcloud data directory"
description: "Configures the data directory where nextcloud stores all files from the users"
schema:
type: path
default: "/var/www/html/data"
required: true
# Update strategy
- variable: updateStrategy
description: "Upgrade Policy"
label: "Update Strategy"
group: "Scaling/Upgrade Policy"
schema:
type: string
default: "Recreate"
enum:
- value: "RollingUpdate"
description: "Create new pods and then kill old ones"
- value: "Recreate"
description: "Kill existing pods before creating new ones"
- variable: service
description: "Nextcloud Service Configuration"
label: "Nextcloud Service Configuration"
group: "Nextcloud Configuration"
schema:
type: dict
required: true
attrs:
- variable: nodePort
label: "Node Port to use for Nextcloud"
schema:
type: int
min: 9000
max: 65535
default: 9001
required: true
- variable: appVolumeMounts
label: "Nextcloud Storage"
group: "Storage"
schema:
type: dict
attrs:
- variable: nextcloud-data
label: "Nextcloud Data Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Nextcloud Data Volume Name"
schema:
type: string
hidden: true
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-nextcloud_data"
editable: false
- variable: mountPath
label: "Nextcloud Data Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: false
default: "/var/www"
- variable: hostPathEnabled
label: "Enable Host Path for Nextcloud Data Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Nextcloud Data Volume"
schema:
type: hostpath
required: true
- variable: postgresAppVolumeMounts
label: "Postgres Storage"
group: "Storage"
schema:
type: dict
hidden: true
attrs:
- variable: postgres-data
label: "Postgres Data Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Postgres Data Volume Name"
schema:
type: string
$ref:
- "normalize/ixVolume"
default: "ix-postgres_data"
editable: false
- variable: mountPath
label: "Postgresql Data Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
editable: false
default: "/var/lib/postgresql/data"
- variable: postgres-backup
label: "Postgres Backup Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Postgres Backup Volume Name"
schema:
type: string
$ref:
- "normalize/ixVolume"
default: "ix-postgres_backups"
editable: false
- variable: mountPath
label: "Postgresql Backup Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
editable: false
default: "/postgres_backups"
1. Get the nextcloud URL by running:
echo http://{{ .Values.nextcloud.host }}:{{ .Values.service.nodePort }}/
{{/*
Get Nextloud Postgres Database Name
*/}}
{{- define "postgres.DatabaseName" -}}
{{- print "nextcloud" -}}
{{- end -}}
{{- define "postgres.imageName" -}}
{{- print "postgres:13.1" -}}
{{- end -}}
{{/*
Retrieve postgres backup name
This will return a unique name based on revision and chart numbers specified.
*/}}
{{- define "postgres.backupName" -}}
{{- $upgradeDict := .Values.ixChartContext.upgradeMetadata -}}
{{- printf "postgres-backup-from-%s-to-%s-revision-%d" $upgradeDict.oldChartVersion $upgradeDict.newChartVersion (int64 $upgradeDict.preUpgradeRevision) -}}
{{- end }}
{{/*
Retrieve postgres credentials for environment variables configuration
*/}}
{{- define "postgres.envVariableConfiguration" -}}
{{ $envList := list }}
{{ $envList = mustAppend $envList (dict "name" "POSTGRES_USER" "valueFromSecret" true "secretName" "db-details" "secretKey" "db-user") }}
{{ $envList = mustAppend $envList (dict "name" "POSTGRES_PASSWORD" "valueFromSecret" true "secretName" "db-details" "secretKey" "db-password") }}
{{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) }}
{{- end -}}
{{/*
Retrieve postgres volume configuration
*/}}
{{- define "postgres.volumeConfiguration" -}}
{{ include "common.storage.configureAppVolumes" (dict "appVolumeMounts" .Values.postgresAppVolumeMounts "emptyDirVolumes" .Values.emptyDirVolumes "ixVolumes" .Values.ixVolumes) | nindent 0 }}
{{- end -}}
{{/*
Retrieve postgres volume mounts configuration
*/}}
{{- define "postgres.volumeMountsConfiguration" -}}
{{ include "common.storage.configureAppVolumeMountsInContainer" (dict "appVolumeMounts" .Values.postgresAppVolumeMounts ) | nindent 0 }}
{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "postgres-backup-hook-config-map"
annotations:
rollme: {{ randAlphaNum 5 | quote }}
data:
entrypoint.sh: |-
#!/bin/sh
cmd="/docker-entrypoint.sh postgres"
eval "${cmd}" & disown;
until pg_isready; do
sleep 5;
done;
pg_dump -U $POSTGRES_USER -d {{ template "postgres.DatabaseName" . }} > /postgres_backups/$BACKUP_NAME;
{{- if .Values.ixChartContext.isUpgrade -}}
{{ $values := (. | mustDeepCopy) }}
{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }}
apiVersion: batch/v1
kind: Job
metadata:
name: "pre-upgrade-hook2"
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "1"
"helm.sh/hook-delete-policy": hook-succeeded
rollme: {{ randAlphaNum 5 | quote }}
spec:
template:
metadata:
name: "pre-upgrade-hook2"
spec:
restartPolicy: Never
serviceAccountName: "{{ template "common.names.serviceAccountName" . }}"
containers:
- name: {{ .Chart.Name }}-postgres-backup
image: {{ template "postgres.imageName" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }}
- name: BACKUP_NAME
value: {{ template "postgres.backupName" . }}
volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }}
- name: backup-script-configmap
mountPath: /bin/backup_entrypoint.sh
readOnly: true
subPath: entrypoint.sh
command:
- "/bin/backup_entrypoint.sh"
volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }}
- name: backup-script-configmap
configMap:
defaultMode: 0700
name: "postgres-backup-hook-config-map"
{{- end -}}
{{ $postgres_values := (. | mustDeepCopy) }}
{{ $_ := set $postgres_values "common" (dict "nameSuffix" "postgres") }}
{{ include "common.deployment.common_config" . | nindent 0 }}
spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
template: {{ include "common.deployment.pod.metadata" . | nindent 4 }}
spec:
initContainers:
- name: init-postgresdb
image: {{ template "postgres.imageName" . }}
command: ['sh', '-c', "until pg_isready -h {{ template "common.names.fullname" $postgres_values }}; do echo waiting for postgres; sleep 2; done"]
imagePullPolicy: {{ .Values.image.pullPolicy }}
containers:
- name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 8 }}
env: {{ include "postgres.envVariableConfiguration" $postgres_values | nindent 10 }}
{{ $envList := list }}
{{ $secretName := (include "common.names.fullname" .) }}
{{ $envList = mustAppend $envList (dict "name" "POSTGRES_HOST" "value" (printf "%s:5432" (include "common.names.fullname" $postgres_values))) }}
{{ $envList = mustAppend $envList (dict "name" "POSTGRES_DB" "value" (include "postgres.DatabaseName" .)) }}
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_DATA_DIR" "value" .Values.nextcloud.datadir) }}
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_TRUSTED_DOMAINS" "value" .Values.nextcloud.host) }}
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-username") }}
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-password") }}
{{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
ports:
- name: http
containerPort: 80
protocol: TCP
volumeMounts:
- name: nextcloud-data
mountPath: /var/www/
subPath: "root"
- name: nextcloud-data
mountPath: /var/www/html
subPath: "html"
- name: nextcloud-data
mountPath: {{ .Values.nextcloud.datadir }}
subPath: "data"
- name: nextcloud-data
mountPath: /var/www/html/config
subPath: "config"
- name: nextcloud-data
mountPath: /var/www/html/custom_apps
subPath: "custom_apps"
- name: nextcloud-data
mountPath: /var/www/tmp
subPath: "tmp"
- name: nextcloud-data
mountPath: /var/www/html/themes
subPath: "themes"
{{ include "common.storage.allAppVolumes" .Values | nindent 6 }}
# Will mount configuration files as www-data (id: 33) for nextcloud
securityContext:
fsGroup: 33
{{- if .Values.ixChartContext.isUpgrade -}}
{{ $values := (. | mustDeepCopy) }}
{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }}
apiVersion: batch/v1
kind: Job
metadata:
name: "pre-upgrade-hook1"
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "-1"
"helm.sh/hook-delete-policy": hook-succeeded
rollme: {{ randAlphaNum 5 | quote }}
spec:
template:
metadata:
name: "pre-upgrade-hook1"
spec:
restartPolicy: Never
serviceAccountName: "{{ template "common.names.serviceAccountName" . }}"
containers:
- name: kubectl
image: "bitnami/kubectl:1.19"
command: ["kubectl", "delete" , "deployment", "{{ template "common.names.fullname" . }}", "{{ template "common.names.fullname" $values }}"]
{{- end -}}
{{ $values := (. | mustDeepCopy) }}
{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }}
{{ include "common.deployment.common_config" $values | nindent 0 }}
spec: {{ include "common.deployment.common_spec" $values | nindent 2 }}
template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }}
spec:
containers:
- name: {{ .Chart.Name }}-postgres
image: {{ template "postgres.imageName" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }}
volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }}
ports:
- name: postgres-tcp
containerPort: 5432
protocol: TCP
volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }}
apiVersion: v1
kind: Secret
metadata:
name: db-details
data:
db-user: postgres
{{- if .Release.IsInstall }}
db-password: {{ randAlphaNum 15 | b64enc | quote }}
{{ else }}
# `index` function is necessary because the property name contains a dash.
# Otherwise (...).data.db_password would have worked too.
db-password: {{ index (lookup "v1" "Secret" .Release.Namespace "db-details").data "db-password" }}
{{ end }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "postgres-tcp" "port" 5432 "targetPort" 5432) }}
{{ $values := (. | mustDeepCopy) }}
{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }}
{{ $_1 := set $values "commonService" (dict "type" "ClusterIP" "ports" $ports ) }}
{{ include "common.classes.service" $values }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "common.names.fullname" . }}
labels: {{ include "common.labels" . | nindent 4 }}
type: Opaque
data:
nextcloud-username: {{ .Values.nextcloud.username | b64enc | quote }}
{{ if .Values.nextcloud.password }}
nextcloud-password: {{ .Values.nextcloud.password | b64enc | quote }}
{{ else }}
nextcloud-password: {{ randAlphaNum 10 | b64enc | quote }}
{{ end }}
{{ $svc := .Values.service }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "http" "port" 80 "nodePort" $svc.nodePort) }}
{{ $params := . }}
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
{{ include "common.classes.service" $params }}
{{ include "common.serviceaccount" . | nindent 0 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: "{{ .Release.Name }}-service-account-role-binding"
subjects:
- kind: ServiceAccount
name: "{{ template "common.names.serviceAccountName" . }}"
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: "{{ .Release.Name }}-service-account-role"
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: "{{ .Release.Name }}-service-account-role"
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
- "apps"
resources:
- pods
- deployments
verbs:
- delete
- get
- list
## Official nextcloud image version
## ref: https://hub.docker.com/r/library/nextcloud/tags/
##
image:
repository: nextcloud
tag: 19.0.3-apache
pullPolicy: IfNotPresent
nextcloud:
host: nextcloud.kube.home
username: admin
password: changeme
datadir: /var/www/html/data
updateStrategy: "Recreate"
postgresql:
backupVolume:
mountPath: "/postgres_backups"
datasetName: "ix-postgres_backups"
dataVolume:
mountPath: "/var/lib/postgresql/data"
datasetName: "ix-postgres_data"
service:
nodePort: 31000
emptyDirVolumes: true
ixChartContext: {}
environmentVariables: []
appVolumeMounts:
nextcloud-data:
emptyDir: true
mountPath: "/var/www"
postgresAppVolumeMounts:
postgres-data:
emptyDir: true
mountPath: "/var/lib/postgresql/data"
postgres-backup:
emptyDir: true
mountPath: "/postgres_backups"
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
* Application liveness / readiness probes were updated addressing a bug where TrueNAS failed
to consider plex application as `Active` if it was configured to only use `HTTPS`.
* Nvidia GPU support was properly added which ensures users having NVIDIA gpu can now consume it
for hardware acceleration.
dependencies:
- name: common
repository: file://../../../library/common/2101.0.0
version: 2101.0.0
digest: sha256:6ab46f958de11ae6a24d8f7e18417aa9852a8d968d5b0cc94ffa4700449931d6
generated: "2021-02-04T01:15:55.470042+05:00"
apiVersion: v2
appVersion: 1.23.2.4656
description: Plex Media Server
name: plex
version: 1.6.0
keywords:
- plex
home: https://plex.tv/
icon: https://www.plex.tv/wp-content/uploads/2018/01/pmp-icon-1.png
sources:
- https://hub.docker.com/r/plexinc/pms-docker/
- https://github.com/k8s-at-home/charts/tree/master/charts/plex
upstream_version: 2.1.0
dependencies:
- name: common
repository: file://../../../library/common/2101.0.0
version: 2101.0.0
# Plex Media Server helm chart
## Configuration
Please refer to questions.yaml for a detailed overview on supported configurable items.
# Plex
Plex chart is a chart designed to deploy plex in a TrueNAS SCALE kubernetes cluster.
# Default values
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
# The Image to use for PLEX
image:
repository: plexinc/pms-docker
tag: 1.20.2.3402-0fec14d92
pullPolicy: IfNotPresent
##### START --> Official PLEX container environment variables
# Override this with the plex claim token from plex.tv/claim
claimToken: ""
# Set the timezone of the plex server
timezone: "Etc/UTC"
# add your pod network subnet to the `List of IP addresses and networks that are allowed without auth`
# This will override the manual settings, so only use this if you will not need to change it manually.
# This list will be automatically converted to a command seperated string when passed to the container.
# You would specify this when using helm CLI with --set allowedNetworks="{127.0.0.1,10.54.2.0/24}"
# allowedNetworks:
# - 127.0.0.1
# - 10.54.2.0/24
# Instruct the Plex Media Server Container to Change the Configuration Directory Ownership
# Default is true, you would only need to set this if you want to disable it.
# changeConfigDirOwnership: true
# advertiseIp This variable defines the additional IPs on which the server may be be found.
# For example: http://10.1.1.23:32400.
# This adds to the list where the server advertises that it can be found.
# See https://hub.docker.com/r/plexinc/pms-docker/ for details
# advertiseIp: "http://10.1.1.23:32400"
# Set The user id of the plex user created inside the container.
# See https://hub.docker.com/r/plexinc/pms-docker/ for details
# plexUid: 1000
# Set The group id of the plex group created inside the container
# See https://hub.docker.com/r/plexinc/pms-docker/ for details
# plexGid: 1000
##### END --> Official PLEX container environment variables
# You can add as many Additional ENV variables here
# The following is the same as --set extraEnv.TMPDIR="/transcode"
# extraEnv:
# TMPDIR: /transcode
# upgrade strategy type (e.g. Recreate or RollingUpdate)
updateStrategy: Recreate
plexServiceTCP:
port: 32400
hostNetwork: false
proxy:
# This allows to set a proxy environment variable, which PMS uses to fetch the token and assets like movie cover
enabled: false
# http: "http://proxy:8080"
# https: "https://proxy:8080"
# noproxy: "localhost,127.0.0.1,10.96.0.0/12,10.244.0.0/12"
gpuConfiguration: {}
appVolumeMounts:
transcode:
emptyDir: true
mountPath: "/transcode"
data:
emptyDir: true
mountPath: "/data"
config:
emptyDir: true
mountPath: "/config"
shared:
emptyDir: true
mountPath: "shared"
shared-logs:
emptyDir: true
mountPath: "/config/Library/Application Support/Plex Media Server/Logs"
image:
repository: plexinc/pms-docker
tag: 1.23.2.4656-85f0adf5b
pullPolicy: IfNotPresent
#!/usr/bin/python3
import json
import os
import sys
def migrate(values):
values.update({
'appVolumeMounts': {
'transcode': {
'hostPathEnabled': values['transcodeHostPathEnabled'],
**({'hostPath': values['transcodeHostPath']} if values.get('transcodeHostPath') else {})
},
'config': {
'hostPathEnabled': values['configHostPathEnabled'],
**({'hostPath': values['configHostPath']} if values.get('configHostPath') else {})
},
'data': {
'hostPathEnabled': values['dataHostPathEnabled'],
**({'hostPath': values['dataHostPath']} if values.get('dataHostPath') else {})
},
},
'updateStrategy': values.get('strategyType', 'Recreate'),
})
return values
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
if os.path.exists(sys.argv[1]):
with open(sys.argv[1], 'r') as f:
print(json.dumps(migrate(json.loads(f.read()))))
groups:
- name: "Container Images"
description: "Image to be used for container"
- name: "Container Entrypoint"
description: "Configuration of the executable that will be run when the container is started"
- name: "Container Environment Variables"
description: "Set the environment that will be visible to the container"
- name: "Networking"
description: "Configure networking for container"
- name: "Storage"
description: "Persist and share data that is separate from the lifecycle of the container"
- name: "Plex Configuration"
description: "Configure plex deployment"
- name: "Workload Details"
description: "Configure how workload should be deployed"
- name: "Scaling/Upgrade Policy"
description: "Configure how pods are replaced when configuration is upgraded"
- name: "Restart Policy"
description: "Configure when pod should be restarted in case of failure"
- name: "Resource Reservation"
description: "Specify resources to be allocated to workload"
portals:
web_portal:
protocols:
- "http"
host:
- "$node_ip"
ports:
- "$variable-plexServiceTCP.port"
path: "/web"
questions:
- variable: claimToken
label: "Plex Claim Token"
group: "Plex Configuration"
description: "The claim token for the server to obtain a real server token. If not provided, server is will not be automatically logged in. If server is already logged in, this parameter is ignored. You can obtain a claim token to login your server to your plex account by visiting https://www.plex.tv/claim."
schema:
type: string
default: ""
- variable: hostNetwork
label: "Configure Host Network"
group: "Networking"
schema:
type: boolean
default: false
- variable: environmentVariables
label: "Environment Variables for Plex"
group: "Plex Configuration"
schema:
type: list
default: []
items:
- variable: environmentVariable
label: "Environment Variable"
schema:
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
- variable: value
label: "Value"
schema:
type: string
- variable: timezone
label: "Plex container timezone"
group: "Plex Configuration"
schema:
type: string
default: "Etc/UTC"
$ref:
- "definitions/timezone"
# Update strategy
- variable: updateStrategy
description: "Upgrade Policy"
label: "Update Strategy"
group: "Scaling/Upgrade Policy"
schema:
type: string
default: "Recreate"
enum:
- value: "RollingUpdate"
description: "Create new pods and then kill old ones"
- value: "Recreate"
description: "Kill existing pods before creating new ones"
# Port configuration
- variable: plexServiceTCP
label: "Configure Plex TCP Service"
group: "Networking"
schema:
type: dict
attrs:
- variable: port
label: "Port to expose for Plex UI"
schema:
type: int
min: 9000
max: 65535
default: 32400
# Specify GPU configuration
- variable: gpuConfiguration
label: "GPU Configuration"
group: "Resource Reservation"
schema:
type: dict
$ref:
- "definitions/gpuConfiguration"
attrs: []
- variable: appVolumeMounts
label: "Plex Storage"
group: "Storage"
schema:
type: dict
attrs:
- variable: transcode
label: "Transcode Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Plex Transcode Volume Name"
schema:
type: string
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-plex_transcode"
hidden: true
editable: false
- variable: mountPath
label: "Plex Transcode Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: false
default: "/transcode"
- variable: hostPathEnabled
label: "Enable Host Path for Plex Transcode Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Plex Transcode Volume"
schema:
type: hostpath
required: true
- variable: data
label: "Data Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Plex Data Volume Name"
schema:
type: string
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-plex_data"
editable: false
hidden: true
- variable: mountPath
label: "Plex Data Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: false
default: "/data"
- variable: hostPathEnabled
label: "Enable Host Path for Plex Data Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Plex Data Volume"
schema:
type: hostpath
required: true
- variable: config
label: "Config Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Plex Config Volume Name"
schema:
type: string
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-plex_config"
editable: false
hidden: true
- variable: mountPath
label: "Plex Config Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
editable: false
hidden: true
default: "/config"
- variable: hostPathEnabled
label: "Enable Host Path for Plex Config Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Plex Config Volume"
schema:
type: hostpath
required: true
- variable: shared
label: "Shared Volume"
schema:
type: dict
hidden: true
attrs:
- variable: emptyDir
label: "Temporary Volume"
schema:
type: boolean
default: true
editable: false
- variable: mountPath
label: "Plex Shared Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
editable: false
default: "/shared"
- variable: shared-logs
label: "Shared Logs Volume"
schema:
type: dict
hidden: true
attrs:
- variable: emptyDir
label: "Temporary Volume"
schema:
type: boolean
default: true
editable: false
- variable: mountPath
label: "Plex Shared Logs Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
editable: false
default: "/config/Library/Application Support/Plex Media Server/Logs"
1. Get the application URL by running these commands:
http://$node_ip:{{ .Values.plexServiceTCP.port }}/
{{ include "common.deployment.common_config" . | nindent 0 }}
spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
template: {{ include "common.deployment.pod.metadata" . | nindent 4 }}
spec:
{{- if .Values.hostNetwork }}
hostNetwork: {{ .Values.hostNetwork }}
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
{{ include "common.containers.gpuConfiguration" .Values | nindent 10 }}
volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
- name: plex-probe-check
mountPath: /bin/plex_probe_check.sh
readOnly: true
subPath: entrypoint.sh
ports:
- name: pms
protocol: TCP
containerPort: 32400
{{- if .Values.hostNetwork }}
hostPort: {{ .Values.plexServiceTCP.port }}
{{- end }}
- name: plex-dlna
protocol: TCP
containerPort: 32469
- name: plex-dlna-udp
protocol: UDP
containerPort: 1900
- name: plex-gdm1
protocol: UDP
containerPort: 32410
- name: plex-gdm2
protocol: UDP
containerPort: 32412
- name: plex-gdm3
protocol: UDP
containerPort: 32413
- name: plex-gdm4
protocol: UDP
containerPort: 32414
env:
- name: KUBE_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{ $envList := (default list .Values.environmentVariables) }}
{{ if and .Values.gpuConfiguration (hasKey .Values.gpuConfiguration "nvidia.com/gpu") (gt (get .Values.gpuConfiguration "nvidia.com/gpu" | toDecimal) 0) }}
{{ $envList = mustAppend $envList (dict "name" "NVIDIA_DRIVER_CAPABILITIES" "value" "all") }}
{{ end }}
{{ $envList = mustAppend $envList (dict "name" "TZ" "value" .Values.timezone) }}
{{ $envList = mustAppend $envList (dict "name" "PLEX_CLAIM" "value" .Values.claimToken) }}
{{ $envList = mustAppend $envList (dict "name" "PMS_INTERNAL_ADDRESS" "value" (printf "http://%s:32400" (include "common.names.fullname" .))) }}
{{ $envList = mustAppend $envList (dict "name" "PMS_IMAGE" "value" (printf "%s:%s" .Values.image.repository .Values.image.tag))}}
{{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
readinessProbe:
exec:
command:
- /bin/plex_probe_check.sh
failureThreshold: 5
periodSeconds: 15
livenessProbe:
exec:
command:
- /bin/plex_probe_check.sh
failureThreshold: 5
periodSeconds: 15
startupProbe:
exec:
command:
- /bin/plex_probe_check.sh
initialDelaySeconds: 5
failureThreshold: 40
periodSeconds: 15
volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
- name: plex-probe-check
configMap:
defaultMode: 0700
name: "plex-probe-check"
apiVersion: v1
kind: ConfigMap
metadata:
name: "plex-probe-check"
data:
entrypoint.sh: |-
#!/bin/sh
curl -ksf http://$POD_IP:32400/identity -o /dev/null || curl -ksf https://$POD_IP:32400/identity -o /dev/null
{{ $svc := .Values.plexServiceTCP }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "pms" "port" $svc.port "nodePort" $svc.port "targetPort" "pms") }}
{{ $ports = mustAppend $ports (dict "name" "http" "port" 80 "targetPort" "pms") }}
{{ $ports = mustAppend $ports (dict "name" "https" "port" 443 "targetPort" "pms") }}
{{ $ports = mustAppend $ports (dict "name" "plex-dlna" "port" 1900 "targetPort" "plex-dlna") }}
{{ $params := . }}
{{ $_ := set $params "commonService" (dict "ports" $ports ) }}
{{ if .Values.hostNetwork }}
{{ $_ := set $params.commonService "nameSuffix" "tcp-cluster-ip" }}
{{ $_1 := set $params.commonService "type" "ClusterIP" }}
{{ else }}
{{ $_ := set $params.commonService "nameSuffix" "tcp" }}
{{ $_1 := set $params.commonService "type" "NodePort" }}
{{ end }}
{{ include "common.classes.service" $params }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "plex-dlna-udp" "port" 1900 "protocol" "UDP" "targetPort" "plex-dlna-udp") }}
{{ $ports = mustAppend $ports (dict "name" "plex-gdm1" "port" 32410 "protocol" "UDP" "targetPort" "plex-gdm1") }}
{{ $ports = mustAppend $ports (dict "name" "plex-gdm2" "port" 32412 "protocol" "UDP" "targetPort" "plex-gdm2") }}
{{ $ports = mustAppend $ports (dict "name" "plex-gdm3" "port" 32413 "protocol" "UDP" "targetPort" "plex-gdm3") }}
{{ $ports = mustAppend $ports (dict "name" "plex-gdm4" "port" 32414 "protocol" "UDP" "targetPort" "plex-gdm4") }}
{{ $params := . }}
{{ $_ := set $params "commonService" (dict "type" "ClusterIP" "ports" $ports "nameSuffix" "udp" ) }}
{{ include "common.classes.service" $params }}
# Default values
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
# The Image to use for PLEX
image:
repository: plexinc/pms-docker
tag: 1.23.2.4656-85f0adf5b
pullPolicy: IfNotPresent
##### START --> Official PLEX container environment variables
# Override this with the plex claim token from plex.tv/claim
claimToken: ""
# Set the timezone of the plex server
timezone: "Etc/UTC"
# add your pod network subnet to the `List of IP addresses and networks that are allowed without auth`
# This will override the manual settings, so only use this if you will not need to change it manually.
# This list will be automatically converted to a command seperated string when passed to the container.
# You would specify this when using helm CLI with --set allowedNetworks="{127.0.0.1,10.54.2.0/24}"
# allowedNetworks:
# - 127.0.0.1
# - 10.54.2.0/24
# Instruct the Plex Media Server Container to Change the Configuration Directory Ownership
# Default is true, you would only need to set this if you want to disable it.
# changeConfigDirOwnership: true
# advertiseIp This variable defines the additional IPs on which the server may be be found.
# For example: http://10.1.1.23:32400.
# This adds to the list where the server advertises that it can be found.
# See https://hub.docker.com/r/plexinc/pms-docker/ for details
# advertiseIp: "http://10.1.1.23:32400"
# Set The user id of the plex user created inside the container.
# See https://hub.docker.com/r/plexinc/pms-docker/ for details
# plexUid: 1000
# Set The group id of the plex group created inside the container
# See https://hub.docker.com/r/plexinc/pms-docker/ for details
# plexGid: 1000
##### END --> Official PLEX container environment variables
# You can add as many Additional ENV variables here
# The following is the same as --set extraEnv.TMPDIR="/transcode"
# extraEnv:
# TMPDIR: /transcode
# upgrade strategy type (e.g. Recreate or RollingUpdate)
updateStrategy: "Recreate"
plexServiceTCP:
port: 32400
hostNetwork: false
environmentVariables: []
gpuConfiguration: {}
emptyDirVolumes: true
appVolumeMounts:
transcode:
emptyDir: true
mountPath: "/transcode"
data:
emptyDir: true
mountPath: "/data"
config:
emptyDir: true
mountPath: "/config"
shared:
emptyDir: true
mountPath: "shared"
shared-logs:
emptyDir: true
mountPath: "/config/Library/Application Support/Plex Media Server/Logs"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment