From bc949a016061d9342cb44e0c05405304448d9bdf Mon Sep 17 00:00:00 2001 From: mike hepburn Date: Tue, 12 May 2020 23:17:33 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=9FFeature/owncloud=20=F0=9F=A6=9F=20(?= =?UTF-8?q?#44)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * owncloud * 🦚 namespaced 🦚 * first commit * 🐉 name 🐉 --- charts/owncloud/.helmignore | 23 + charts/owncloud/Chart.yaml | 9 + charts/owncloud/persistent-oauth-proxy.json | 672 ++++++++++++++++++ charts/owncloud/persistent.json | 593 ++++++++++++++++ charts/owncloud/templates/_helpers.tpl | 108 +++ charts/owncloud/templates/cronjob.yaml | 35 + charts/owncloud/templates/mariadb-dc.yaml | 98 +++ charts/owncloud/templates/mariadb-pvc.yaml | 13 + charts/owncloud/templates/mariadb-svc.yaml | 16 + charts/owncloud/templates/owncloud-dc.yaml | 127 ++++ charts/owncloud/templates/owncloud-is.yaml | 16 + charts/owncloud/templates/owncloud-pvc.yaml | 13 + charts/owncloud/templates/owncloud-svc.yaml | 16 + charts/owncloud/templates/redis-dc.yaml | 84 +++ charts/owncloud/templates/redis-pvc.yaml | 13 + charts/owncloud/templates/redis-svc.yaml | 16 + charts/owncloud/templates/route.yaml | 26 + charts/owncloud/templates/serviceaccount.yaml | 12 + charts/owncloud/values.yaml | 55 ++ 19 files changed, 1945 insertions(+) create mode 100644 charts/owncloud/.helmignore create mode 100644 charts/owncloud/Chart.yaml create mode 100644 charts/owncloud/persistent-oauth-proxy.json create mode 100644 charts/owncloud/persistent.json create mode 100644 charts/owncloud/templates/_helpers.tpl create mode 100644 charts/owncloud/templates/cronjob.yaml create mode 100644 charts/owncloud/templates/mariadb-dc.yaml create mode 100644 charts/owncloud/templates/mariadb-pvc.yaml create mode 100644 charts/owncloud/templates/mariadb-svc.yaml create mode 100644 charts/owncloud/templates/owncloud-dc.yaml create mode 100644 charts/owncloud/templates/owncloud-is.yaml create mode 100644 charts/owncloud/templates/owncloud-pvc.yaml create mode 100644 charts/owncloud/templates/owncloud-svc.yaml create mode 100644 charts/owncloud/templates/redis-dc.yaml create mode 100644 charts/owncloud/templates/redis-pvc.yaml create mode 100644 charts/owncloud/templates/redis-svc.yaml create mode 100644 charts/owncloud/templates/route.yaml create mode 100644 charts/owncloud/templates/serviceaccount.yaml create mode 100644 charts/owncloud/values.yaml diff --git a/charts/owncloud/.helmignore b/charts/owncloud/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/owncloud/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/owncloud/Chart.yaml b/charts/owncloud/Chart.yaml new file mode 100644 index 00000000..399b83b8 --- /dev/null +++ b/charts/owncloud/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: owncloud +description: A Helm chart for Owncloud +type: application +version: 0.0.1 +appVersion: latest +home: https://github.com/rht-labs/helm-charts +maintainers: +- name: eformat diff --git a/charts/owncloud/persistent-oauth-proxy.json b/charts/owncloud/persistent-oauth-proxy.json new file mode 100644 index 00000000..cff4cfa9 --- /dev/null +++ b/charts/owncloud/persistent-oauth-proxy.json @@ -0,0 +1,672 @@ +{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "owncloud-persistent", + "annotations": { + "openshift.io/display-name": "ownCloud (Persistent)", + "description": "A deployment for ownCloud with MariaDB and Redis, including persistent storage.", + "iconClass": "icon-php", + "tags": "instant-app,php,owncloud,mariadb,redis" + } + }, + "message": "An ownCloud service including persistent storage has been created in your project.", + "objects": [ + { + "apiVersion": "v1", + "kind": "ServiceAccount", + "metadata": { + "annotations": { + "serviceaccounts.openshift.io/oauth-redirectreference.primary": "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"owncloud\"}}" + }, + "name": "owncloud" + } + }, + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "owncloud" + }, + "spec": { + "host": "${OWNCLOUD_PUBLIC_DOMAIN}", + "to": { + "kind": "Service", + "name": "owncloud" + }, + "tls": { + "termination": "reencrypt", + "insecureEdgeTerminationPolicy": "Redirect" + }, + "port": { + "targetPort": "public" + } + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "owncloud" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "${OWNCLOUD_VOLUME_CAPACITY}" + } + } + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "owncloud", + "annotations": { + "service.beta.openshift.io/serving-cert-secret-name": "proxy-tls" + } + }, + "spec": { + "ports": [ + { + "name": "http", + "protocol": "TCP", + "port": 8080, + "targetPort": "http" + }, + { + "name": "public", + "protocol": "TCP", + "port": 8443, + "targetPort": "public" + } + ], + "selector": { + "app": "owncloud" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "owncloud", + "labels": { + "app": "owncloud" + } + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "app": "owncloud" + }, + "template": { + "metadata": { + "name": "owncloud", + "labels": { + "app": "owncloud" + } + }, + "spec": { + "hostname": "owncloud", + "serviceAccount": "owncloud", + "containers": [ + { + "name": "owncloud", + "image": "${OWNCLOUD_IMAGE_NAME}", + "imagePullPolicy": "Always", + "ports": [ + { + "name": "http", + "protocol": "TCP", + "containerPort": 8080 + } + ], + "readinessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 60, + "exec": { + "command": [ + "/usr/bin/healthcheck" + ] + } + }, + "livenessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/bin/healthcheck" + ] + } + }, + "serviceAccount" : "owncloud", + "serviceAccountName" : "owncloud", + "env": [ + { + "name": "OWNCLOUD_DOMAIN", + "value": "${OWNCLOUD_PUBLIC_DOMAIN}" + }, + { + "name": "OWNCLOUD_PROTOCOL", + "value": "https" + }, + { + "name": "OWNCLOUD_CROND_ENABLED", + "value": "false" + }, + { + "name": "OWNCLOUD_BACKGROUND_MODE", + "value": "webcron" + }, + { + "name": "OWNCLOUD_DB_TYPE", + "value": "mysql" + }, + { + "name": "OWNCLOUD_DB_HOST", + "value": "mariadb" + }, + { + "name": "OWNCLOUD_DB_NAME", + "value": "owncloud" + }, + { + "name": "OWNCLOUD_DB_USERNAME", + "value": "owncloud" + }, + { + "name": "OWNCLOUD_DB_PASSWORD", + "value": "owncloud" + }, + { + "name": "OWNCLOUD_REDIS_ENABLED", + "value": "true" + }, + { + "name": "OWNCLOUD_REDIS_HOST", + "value": "redis" + }, + { + "name": "OWNCLOUD_REDIS_PORT", + "value": "6379" + }, + { + "name": "OWNCLOUD_VOLUME_ROOT", + "value": "/var/lib/owncloud" + }, + { + "name": "OWNCLOUD_VOLUME_FILES", + "value": "/var/lib/owncloud/files" + }, + { + "name": "OWNCLOUD_VOLUME_CONFIG", + "value": "/var/lib/owncloud/config" + }, + { + "name": "OWNCLOUD_LOG_FILE", + "value": "/dev/stdout" + }, + { + "name": "OWNCLOUD_ADMIN_USERNAME", + "value": "${OWNCLOUD_ADMIN_USERNAME}" + }, + { + "name": "OWNCLOUD_ADMIN_PASSWORD", + "value": "${OWNCLOUD_ADMIN_PASSWORD}" + }, + { + "name": "OWNCLOUD_SESSION_SAVE_HANDLER", + "value": "redis" + }, + { + "name": "OWNCLOUD_SESSION_SAVE_PATH", + "value": "tcp://redis:6379?database=1" + }, + { + "name": "OWNCLOUD_SKIP_CHOWN", + "value": "true" + }, + { + "name": "OWNCLOUD_TOKEN_AUTH_ENFORCED", + "value": "true" + } + ], + "volumeMounts": [ + { + "name": "data", + "mountPath": "/var/lib/owncloud" + } + ], + "securityContext": { + "allowPrivilegeEscalation": false + } + }, + { + "args": [ + "--https-address=:8443", + "--provider=openshift", + "--openshift-service-account=owncloud", + "--upstream=http://localhost:8080", + "--tls-cert=/etc/tls/private/tls.crt", + "--tls-key=/etc/tls/private/tls.key", + "--cookie-secret=SECRET" + ], + "image": "openshift/oauth-proxy:latest", + "imagePullPolicy": "IfNotPresent", + "name": "oauth-proxy", + "ports": [ + { + "containerPort": 8443, + "name": "public", + "protocol": "TCP" + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/etc/tls/private", + "name": "proxy-tls" + } + ] + } + ], + "volumes": [ + { + "name": "data", + "persistentVolumeClaim": { + "claimName": "owncloud" + } + }, + { + "name": "proxy-tls", + "secret": { + "defaultMode": 420, + "secretName": "proxy-tls" + } + } + ] + } + } + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "mariadb" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "10Gi" + } + } + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "mariadb" + }, + "spec": { + "ports": [ + { + "name": "mariadb", + "protocol": "TCP", + "port": 3306, + "targetPort": "mariadb" + } + ], + "selector": { + "app": "mariadb" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "mariadb" + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "app": "mariadb" + }, + "template": { + "metadata": { + "name": "mariadb", + "labels": { + "app": "mariadb" + } + }, + "spec": { + "hostname": "mariadb", + "containers": [ + { + "name": "mariadb", + "image": "docker.io/mariadb:10.4", + "imagePullPolicy": "Always", + "ports": [ + { + "name": "mariadb", + "protocol": "TCP", + "containerPort": 3306 + } + ], + "env": [ + { + "name": "MYSQL_ROOT_PASSWORD", + "value": "owncloud" + }, + { + "name": "MYSQL_USER", + "value": "owncloud" + }, + { + "name": "MYSQL_PASSWORD", + "value": "owncloud" + }, + { + "name": "MYSQL_DATABASE", + "value": "owncloud" + } + ], + "volumeMounts": [ + { + "name": "data", + "mountPath": "/var/lib/mysql" + } + ], + "securityContext": { + "allowPrivilegeEscalation": false + } + }, + { + "name": "healthcheck", + "image": "docker.io/healthcheck/mysql:latest", + "imagePullPolicy": "Always", + "command": [ + "/bin/bash", + "-c" + ], + "args": [ + "trap : TERM INT; sleep infinity & wait" + ], + "env": [ + { + "name": "MYSQL_USER", + "value": "root" + }, + { + "name": "MYSQL_PASSWORD", + "value": "owncloud" + } + ], + "readinessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/local/bin/docker-healthcheck" + ] + } + }, + "livenessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/local/bin/docker-healthcheck" + ] + } + } + } + ], + "volumes": [ + { + "name": "data", + "persistentVolumeClaim": { + "claimName": "mariadb" + } + } + ] + } + } + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "redis" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "1Gi" + } + } + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "redis" + }, + "spec": { + "ports": [ + { + "name": "redis", + "protocol": "TCP", + "port": 6379, + "targetPort": "redis" + } + ], + "selector": { + "app": "redis" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "redis", + "labels": { + "app": "redis" + } + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [ + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "app": "redis" + }, + "template": { + "metadata": { + "name": "redis", + "labels": { + "app": "redis" + } + }, + "spec": { + "hostname": "redis", + "containers": [ + { + "name": "redis", + "image": "docker.io/redis:5.0", + "imagePullPolicy": "Always", + "ports": [ + { + "name": "redis", + "protocol": "TCP", + "containerPort": 6379 + } + ], + "volumeMounts": [ + { + "name": "data", + "mountPath": "/data" + } + ], + "securityContext": { + "allowPrivilegeEscalation": false + } + }, + { + "name": "healthcheck", + "image": "docker.io/healthcheck/redis:latest", + "imagePullPolicy": "Always", + "command": [ + "/bin/bash", + "-c" + ], + "args": [ + "trap : TERM INT; sleep infinity & wait" + ], + "readinessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/local/bin/docker-healthcheck" + ] + } + }, + "livenessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/local/bin/docker-healthcheck" + ] + } + } + } + ], + "volumes": [ + { + "name": "data", + "persistentVolumeClaim": { + "claimName": "redis" + } + } + ] + } + } + } + }, + { + "kind": "CronJob", + "apiVersion": "batch/v1beta1", + "metadata": { + "name": "webcron" + }, + "spec": { + "schedule": "*/15 * * * *", + "successfulJobsHistoryLimit": 0, + "failedJobsHistoryLimit": 5, + "jobTemplate": { + "spec": { + "template": { + "spec": { + "restartPolicy": "OnFailure", + "containers": [ + { + "name": "webcron", + "image": "${OWNCLOUD_IMAGE_NAME}", + "args": [ + "curl", + "http://owncloud:8080/cron.php" + ] + } + ] + } + } + } + } + } + } + ], + "parameters": [ + { + "name": "OWNCLOUD_PUBLIC_DOMAIN", + "displayName": "ownCloud Domain", + "description": "The domain where you want to reach ownCloud after the deployment.", + "value": "", + "required": true + }, + { + "name": "OWNCLOUD_ADMIN_USERNAME", + "displayName": "ownCloud Admin Username", + "description": "The username for the initial admin user, can be changed later within ownCloud.", + "value": "admin" + }, + { + "name": "OWNCLOUD_ADMIN_PASSWORD", + "displayName": "ownCloud Admin Password", + "description": "The password for the initial admin user, can be changed later within ownCloud.", + "value": "admin" + }, + { + "name": "OWNCLOUD_IMAGE_NAME", + "displayName": "ownCloud Docker Image", + "description": "The name of the ownCloud Docker image used within the OpenShift deployment.", + "value": "docker.io/owncloud/server:10.1.1" + }, + { + "name": "OWNCLOUD_VOLUME_CAPACITY", + "displayName": "ownCloud Volume Capacity", + "description": "Volume space available for data to store ownCloud assets, e.g. 512Mi, 2Gi.", + "value": "100Gi", + "required": true + } + ], + "labels": { + "template": "owncloud-persistent-template" + } +} diff --git a/charts/owncloud/persistent.json b/charts/owncloud/persistent.json new file mode 100644 index 00000000..26b37401 --- /dev/null +++ b/charts/owncloud/persistent.json @@ -0,0 +1,593 @@ +{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "owncloud-persistent", + "annotations": { + "openshift.io/display-name": "ownCloud (Persistent)", + "description": "A deployment for ownCloud with MariaDB and Redis, including persistent storage.", + "iconClass": "icon-php", + "tags": "instant-app,php,owncloud,mariadb,redis" + } + }, + "message": "An ownCloud service including persistent storage has been created in your project.", + "objects": [{ + "apiVersion": "v1", + "kind": "ServiceAccount", + "metadata": { + "name": "owncloud" + } + }, + { + "kind": "Route", + "apiVersion": "v1", + "metadata": { + "name": "owncloud" + }, + "spec": { + "host": "${OWNCLOUD_PUBLIC_DOMAIN}", + "to": { + "kind": "Service", + "name": "owncloud" + }, + "tls": { + "termination": "edge", + "insecureEdgeTerminationPolicy": "Redirect" + }, + "port": { + "targetPort": "http" + } + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "owncloud" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "${OWNCLOUD_VOLUME_CAPACITY}" + } + } + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "owncloud" + }, + "spec": { + "ports": [{ + "name": "http", + "protocol": "TCP", + "port": 8080, + "targetPort": "http" + }], + "selector": { + "app": "owncloud" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "owncloud", + "labels": { + "app": "owncloud" + } + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [{ + "type": "ConfigChange" + }], + "replicas": 1, + "selector": { + "app": "owncloud" + }, + "template": { + "metadata": { + "name": "owncloud", + "labels": { + "app": "owncloud" + } + }, + "spec": { + "hostname": "owncloud", + "serviceAccount": "owncloud", + "containers": [{ + "name": "owncloud", + "image": "${OWNCLOUD_IMAGE_NAME}", + "imagePullPolicy": "Always", + "ports": [{ + "name": "http", + "protocol": "TCP", + "containerPort": 8080 + }], + "readinessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 60, + "exec": { + "command": [ + serviceaccount / owncloud created + route.route.openshift.io / owncloud created + persistentvolumeclaim / owncloud created + service / owncloud created + deploymentconfig.apps.openshift.io / owncloud created + persistentvolumeclaim / mariadb created + service / mariadb created + deploymentconfig.apps.openshift.io / mariadb created + persistentvolumeclaim / redis created + service / redis created + deploymentconfig.apps.openshift.io / redis created + cronjob.batch / webcron created "/usr/bin/healthcheck" + ] + } + }, + "livenessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/bin/healthcheck" + ] + } + }, + "serviceAccount": "owncloud", + "serviceAccountName": "owncloud", + "env": [{ + "name": "OWNCLOUD_DOMAIN", + "value": "${OWNCLOUD_PUBLIC_DOMAIN}" + }, + { + "name": "OWNCLOUD_PROTOCOL", + "value": "https" + }, + { + "name": "OWNCLOUD_CROND_ENABLED", + "value": "false" + }, + { + "name": "OWNCLOUD_BACKGROUND_MODE", + "value": "webcron" + }, + { + "name": "OWNCLOUD_DB_TYPE", + "value": "mysql" + }, + { + "name": "OWNCLOUD_DB_HOST", + "value": "mariadb" + }, + { + "name": "OWNCLOUD_DB_NAME", + "value": "owncloud" + }, + { + "name": "OWNCLOUD_DB_USERNAME", + "value": "owncloud" + }, + { + "name": "OWNCLOUD_DB_PASSWORD", + "value": "owncloud" + }, + { + "name": "OWNCLOUD_REDIS_ENABLED", + "value": "true" + }, + { + "name": "OWNCLOUD_REDIS_HOST", + "value": "redis" + }, + { + "name": "OWNCLOUD_REDIS_PORT", + "value": "6379" + }, + { + "name": "OWNCLOUD_VOLUME_ROOT", + "value": "/var/lib/owncloud" + }, + { + "name": "OWNCLOUD_VOLUME_FILES", + "value": "/var/lib/owncloud/files" + }, + { + "name": "OWNCLOUD_VOLUME_CONFIG", + "value": "/var/lib/owncloud/config" + }, + { + "name": "OWNCLOUD_LOG_FILE", + "value": "/dev/stdout" + }, + { + "name": "OWNCLOUD_ADMIN_USERNAME", + "value": "${OWNCLOUD_ADMIN_USERNAME}" + }, + { + "name": "OWNCLOUD_ADMIN_PASSWORD", + "value": "${OWNCLOUD_ADMIN_PASSWORD}" + }, + { + "name": "OWNCLOUD_SESSION_SAVE_HANDLER", + "value": "redis" + }, + { + "name": "OWNCLOUD_SESSION_SAVE_PATH", + "value": "tcp://redis:6379?database=1" + }, + { + "name": "OWNCLOUD_SKIP_CHOWN", + "value": "true" + }, + { + "name": "OWNCLOUD_TOKEN_AUTH_ENFORCED", + "value": "true" + } + ], + "volumeMounts": [{ + "name": "data", + "mountPath": "/var/lib/owncloud" + }], + "securityContext": { + "allowPrivilegeEscalation": false + } + }], + "volumes": [{ + "name": "data", + "persistentVolumeClaim": { + "claimName": "owncloud" + } + }] + } + } + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "mariadb" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "10Gi" + } + } + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "mariadb" + }, + "spec": { + "ports": [{ + "name": "mariadb", + "protocol": "TCP", + "port": 3306, + "targetPort": "mariadb" + }], + "selector": { + "app": "mariadb" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "mariadb" + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [{ + "type": "ConfigChange" + }], + "replicas": 1, + "selector": { + "app": "mariadb" + }, + "template": { + "metadata": { + "name": "mariadb", + "labels": { + "app": "mariadb" + } + }, + "spec": { + "hostname": "mariadb", + "containers": [{ + "name": "mariadb", + "image": "docker.io/mariadb:10.4", + "imagePullPolicy": "Always", + "ports": [{ + "name": "mariadb", + "protocol": "TCP", + "containerPort": 3306 + }], + "env": [{ + "name": "MYSQL_ROOT_PASSWORD", + "value": "owncloud" + }, + { + "name": "MYSQL_USER", + "value": "owncloud" + }, + { + "name": "MYSQL_PASSWORD", + "value": "owncloud" + }, + { + "name": "MYSQL_DATABASE", + "value": "owncloud" + } + ], + "volumeMounts": [{ + "name": "data", + "mountPath": "/var/lib/mysql" + }], + "securityContext": { + "allowPrivilegeEscalation": false + } + }, + { + "name": "healthcheck", + "image": "docker.io/healthcheck/mysql:latest", + "imagePullPolicy": "Always", + "command": [ + "/bin/bash", + "-c" + ], + "args": [ + "trap : TERM INT; sleep infinity & wait" + ], + "env": [{ + "name": "MYSQL_USER", + "value": "root" + }, + { + "name": "MYSQL_PASSWORD", + "value": "owncloud" + } + ], + "readinessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/local/bin/docker-healthcheck" + ] + } + }, + "livenessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/local/bin/docker-healthcheck" + ] + } + } + } + ], + "volumes": [{ + "name": "data", + "persistentVolumeClaim": { + "claimName": "mariadb" + } + }] + } + } + } + }, + { + "kind": "PersistentVolumeClaim", + "apiVersion": "v1", + "metadata": { + "name": "redis" + }, + "spec": { + "accessModes": [ + "ReadWriteOnce" + ], + "resources": { + "requests": { + "storage": "1Gi" + } + } + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "redis" + }, + "spec": { + "ports": [{ + "name": "redis", + "protocol": "TCP", + "port": 6379, + "targetPort": "redis" + }], + "selector": { + "app": "redis" + } + } + }, + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "redis", + "labels": { + "app": "redis" + } + }, + "spec": { + "strategy": { + "type": "Recreate" + }, + "triggers": [{ + "type": "ConfigChange" + }], + "replicas": 1, + "selector": { + "app": "redis" + }, + "template": { + "metadata": { + "name": "redis", + "labels": { + "app": "redis" + } + }, + "spec": { + "hostname": "redis", + "containers": [{ + "name": "redis", + "image": "docker.io/redis:5.0", + "imagePullPolicy": "Always", + "ports": [{ + "name": "redis", + "protocol": "TCP", + "containerPort": 6379 + }], + "volumeMounts": [{ + "name": "data", + "mountPath": "/data" + }], + "securityContext": { + "allowPrivilegeEscalation": false + } + }, + { + "name": "healthcheck", + "image": "docker.io/healthcheck/redis:latest", + "imagePullPolicy": "Always", + "command": [ + "/bin/bash", + "-c" + ], + "args": [ + "trap : TERM INT; sleep infinity & wait" + ], + "readinessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/local/bin/docker-healthcheck" + ] + } + }, + "livenessProbe": { + "timeoutSeconds": 3, + "initialDelaySeconds": 60, + "failureThreshold": 30, + "exec": { + "command": [ + "/usr/local/bin/docker-healthcheck" + ] + } + } + } + ], + "volumes": [{ + "name": "data", + "persistentVolumeClaim": { + "claimName": "redis" + } + }] + } + } + } + }, + { + "kind": "CronJob", + "apiVersion": "batch/v1beta1", + "metadata": { + "name": "webcron" + }, + "spec": { + "schedule": "*/15 * * * *", + "successfulJobsHistoryLimit": 0, + "failedJobsHistoryLimit": 5, + "jobTemplate": { + "spec": { + "template": { + "spec": { + "restartPolicy": "OnFailure", + "containers": [{ + "name": "webcron", + "image": "${OWNCLOUD_IMAGE_NAME}", + "args": [ + "curl", + "http://owncloud:8080/cron.php" + ] + }] + } + } + } + } + } + } + ], + "parameters": [{ + "name": "OWNCLOUD_PUBLIC_DOMAIN", + "displayName": "ownCloud Domain", + "description": "The domain where you want to reach ownCloud after the deployment.", + "value": "", + "required": true + }, + { + "name": "OWNCLOUD_ADMIN_USERNAME", + "displayName": "ownCloud Admin Username", + "description": "The username for the initial admin user, can be changed later within ownCloud.", + "value": "admin" + }, + { + "name": "OWNCLOUD_ADMIN_PASSWORD", + "displayName": "ownCloud Admin Password", + "description": "The password for the initial admin user, can be changed later within ownCloud.", + "value": "admin" + }, + { + "name": "OWNCLOUD_IMAGE_NAME", + "displayName": "ownCloud Docker Image", + "description": "The name of the ownCloud Docker image used within the OpenShift deployment.", + "value": "docker.io/owncloud/server:10.1.1" + }, + { + "name": "OWNCLOUD_VOLUME_CAPACITY", + "displayName": "ownCloud Volume Capacity", + "description": "Volume space available for data to store ownCloud assets, e.g. 512Mi, 2Gi.", + "value": "100Gi", + "required": true + } + ], + "labels": { + "template": "owncloud-persistent-template" + } +} \ No newline at end of file diff --git a/charts/owncloud/templates/_helpers.tpl b/charts/owncloud/templates/_helpers.tpl new file mode 100644 index 00000000..8bc48802 --- /dev/null +++ b/charts/owncloud/templates/_helpers.tpl @@ -0,0 +1,108 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "owncloud.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "redis.name" -}} +{{- default "redis-owncloud" -}} +{{- end -}} + +{{- define "mariadb.name" -}} +{{- default "mariadb-owncloud" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "owncloud.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{- define "redis.fullname" -}} +{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- define "mariadb.fullname" -}} +{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "owncloud.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "owncloud.labels" -}} +helm.sh/chart: {{ include "owncloud.chart" . }} +{{ include "owncloud.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{- define "redis.labels" -}} +helm.sh/chart: {{ include "owncloud.chart" . }} +{{ include "redis.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{- define "mariadb.labels" -}} +helm.sh/chart: {{ include "owncloud.chart" . }} +{{ include "mariadb.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "owncloud.selectorLabels" -}} +app.kubernetes.io/name: {{ include "owncloud.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +deploymentconfig: {{ include "owncloud.fullname" . }} +{{- end -}} + +{{- define "redis.selectorLabels" -}} +app.kubernetes.io/name: {{ include "redis.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{- define "mariadb.selectorLabels" -}} +app.kubernetes.io/name: {{ include "mariadb.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + + +{{/* +Create the name of the service account to use +*/}} +{{- define "owncloud.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "owncloud.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/charts/owncloud/templates/cronjob.yaml b/charts/owncloud/templates/cronjob.yaml new file mode 100644 index 00000000..07793205 --- /dev/null +++ b/charts/owncloud/templates/cronjob.yaml @@ -0,0 +1,35 @@ +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + name: {{ include "owncloud.fullname" . }} + labels: + {{- include "owncloud.labels" . | nindent 4 }} +spec: + concurrencyPolicy: Allow + failedJobsHistoryLimit: 5 + jobTemplate: + metadata: + creationTimestamp: null + spec: + template: + metadata: + creationTimestamp: null + spec: + containers: + - args: + - curl + - http://{{ include "owncloud.fullname" . }}:8080/cron.php + image: {{ .Values.image.owncloud.repository }}:{{ .Chart.AppVersion }} + imagePullPolicy: Always + name: webcron + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + schedule: '*/15 * * * *' + successfulJobsHistoryLimit: 0 + suspend: false diff --git a/charts/owncloud/templates/mariadb-dc.yaml b/charts/owncloud/templates/mariadb-dc.yaml new file mode 100644 index 00000000..96081447 --- /dev/null +++ b/charts/owncloud/templates/mariadb-dc.yaml @@ -0,0 +1,98 @@ +--- +apiVersion: apps.openshift.io/v1 +kind: DeploymentConfig +metadata: + name: {{ include "mariadb.fullname" . }} + labels: + {{- include "mariadb.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + {{- include "mariadb.selectorLabels" . | nindent 4 }} + strategy: + activeDeadlineSeconds: 21600 + resources: {} + rollingParams: + intervalSeconds: 1 + maxSurge: 25% + maxUnavailable: 25% + timeoutSeconds: 600 + updatePeriodSeconds: 1 + type: Rolling + template: + metadata: + labels: + {{- include "mariadb.selectorLabels" . | nindent 8 }} + spec: + containers: + - env: + - name: MYSQL_ROOT_PASSWORD + value: owncloud + - name: MYSQL_USER + value: owncloud + - name: MYSQL_PASSWORD + value: owncloud + - name: MYSQL_DATABASE + value: owncloud + image: {{ .Values.image.mariadb.image }} + imagePullPolicy: {{ .Values.image.mariadb.pullPolicy }} + name: mariadb + ports: + - containerPort: 3306 + name: mariadb + protocol: TCP + resources: {} + securityContext: + allowPrivilegeEscalation: false + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/mysql + name: data + - args: + - 'trap : TERM INT; sleep infinity & wait' + command: + - /bin/bash + - -c + env: + - name: MYSQL_USER + value: root + - name: MYSQL_PASSWORD + value: owncloud + image: {{ .Values.image.mariadb.healthimage }} + imagePullPolicy: {{ .Values.image.mariadb.pullPolicy }} + livenessProbe: + exec: + command: + - /usr/local/bin/docker-healthcheck + failureThreshold: 30 + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + name: healthcheck + readinessProbe: + exec: + command: + - /usr/local/bin/docker-healthcheck + failureThreshold: 30 + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + hostname: mariadb + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - name: data + persistentVolumeClaim: + claimName: {{ include "mariadb.fullname" . }} + test: false + triggers: + - type: ConfigChange diff --git a/charts/owncloud/templates/mariadb-pvc.yaml b/charts/owncloud/templates/mariadb-pvc.yaml new file mode 100644 index 00000000..ecd3a34a --- /dev/null +++ b/charts/owncloud/templates/mariadb-pvc.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "mariadb.fullname" . }} + labels: + {{- include "mariadb.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.persistent.mariadb.accessMode | default " ReadWriteOnce" }} + resources: + requests: + storage: {{ .Values.persistent.mariadb.volume.size | default " 10Gi" }} diff --git a/charts/owncloud/templates/mariadb-svc.yaml b/charts/owncloud/templates/mariadb-svc.yaml new file mode 100644 index 00000000..1263a7fb --- /dev/null +++ b/charts/owncloud/templates/mariadb-svc.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mariadb.fullname" . }} + labels: + {{- include "mariadb.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.mariadb.type }} + ports: + - port: {{ .Values.service.mariadb.port }} + targetPort: mariadb + protocol: TCP + name: mariadb + selector: + {{- include "mariadb.selectorLabels" . | nindent 4 }} diff --git a/charts/owncloud/templates/owncloud-dc.yaml b/charts/owncloud/templates/owncloud-dc.yaml new file mode 100644 index 00000000..bfa3573e --- /dev/null +++ b/charts/owncloud/templates/owncloud-dc.yaml @@ -0,0 +1,127 @@ +--- +apiVersion: apps.openshift.io/v1 +kind: DeploymentConfig +metadata: + name: {{ include "owncloud.fullname" . }} + labels: + {{- include "owncloud.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount | default "1" }} + selector: + {{- include "owncloud.selectorLabels" . | nindent 4 }} + strategy: + activeDeadlineSeconds: 21600 + resources: {} + rollingParams: + intervalSeconds: 1 + maxSurge: 25% + maxUnavailable: 25% + timeoutSeconds: 600 + updatePeriodSeconds: 1 + type: Rolling + template: + metadata: + labels: + {{- include "owncloud.selectorLabels" . | nindent 8 }} + spec: + containers: + - env: + - name: OWNCLOUD_DOMAIN + value: {{ .Values.hostname | quote }} + - name: OWNCLOUD_PROTOCOL + value: https + - name: OWNCLOUD_CROND_ENABLED + value: "false" + - name: OWNCLOUD_BACKGROUND_MODE + value: webcron + - name: OWNCLOUD_DB_TYPE + value: mysql + - name: OWNCLOUD_DB_HOST + value: {{ include "mariadb.fullname" . }} + - name: OWNCLOUD_DB_NAME + value: owncloud + - name: OWNCLOUD_DB_USERNAME + value: owncloud + - name: OWNCLOUD_DB_PASSWORD + value: owncloud + - name: OWNCLOUD_REDIS_ENABLED + value: "true" + - name: OWNCLOUD_REDIS_HOST + value: {{ include "redis.fullname" . }} + - name: OWNCLOUD_REDIS_PORT + value: "6379" + - name: OWNCLOUD_VOLUME_ROOT + value: /var/lib/owncloud + - name: OWNCLOUD_VOLUME_FILES + value: /var/lib/owncloud/files + - name: OWNCLOUD_VOLUME_CONFIG + value: /var/lib/owncloud/config + - name: OWNCLOUD_LOG_FILE + value: /dev/stdout + - name: OWNCLOUD_ADMIN_USERNAME + value: admin + - name: OWNCLOUD_ADMIN_PASSWORD + value: admin + - name: OWNCLOUD_SESSION_SAVE_HANDLER + value: redis + - name: OWNCLOUD_SESSION_SAVE_PATH + value: tcp://{{ include "redis.fullname" . }}:6379?database=1 + - name: OWNCLOUD_SKIP_CHOWN + value: "true" + - name: OWNCLOUD_TOKEN_AUTH_ENFORCED + value: "true" + image: ' ' + imagePullPolicy: {{ .Values.image.owncloud.pullPolicy }} + livenessProbe: + exec: + command: + - /usr/bin/healthcheck + failureThreshold: 30 + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + name: {{ include "owncloud.name" . }} + ports: + - containerPort: 8080 + name: http + protocol: TCP + readinessProbe: + exec: + command: + - /usr/bin/healthcheck + failureThreshold: 60 + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + resources: {} + securityContext: + allowPrivilegeEscalation: false + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/owncloud + name: data + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + serviceAccountName: {{ include "owncloud.serviceAccountName" . }} + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - name: data + persistentVolumeClaim: + claimName: {{ include "owncloud.fullname" . }} + test: false + triggers: + - imageChangeParams: + automatic: true + containerNames: + - {{ .Chart.Name }} + from: + kind: ImageStreamTag + name: "{{ include "owncloud.fullname" . }}:{{ .Chart.AppVersion }}" + lastTriggeredImage: "" + type: ImageChange + - type: ConfigChange \ No newline at end of file diff --git a/charts/owncloud/templates/owncloud-is.yaml b/charts/owncloud/templates/owncloud-is.yaml new file mode 100644 index 00000000..97a70a79 --- /dev/null +++ b/charts/owncloud/templates/owncloud-is.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: image.openshift.io/v1 +kind: ImageStream +metadata: + name: {{ include "owncloud.fullname" . }} + labels: + {{- include "owncloud.labels" . | nindent 4 }} +spec: + tags: + - annotations: + openshift.io/imported-from: owncloud + from: + kind: DockerImage + name: {{ .Values.image.owncloud.repository }}:{{ .Chart.AppVersion }} + importPolicy: {} + name: {{ .Chart.AppVersion }} \ No newline at end of file diff --git a/charts/owncloud/templates/owncloud-pvc.yaml b/charts/owncloud/templates/owncloud-pvc.yaml new file mode 100644 index 00000000..98a3103b --- /dev/null +++ b/charts/owncloud/templates/owncloud-pvc.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "owncloud.fullname" . }} + labels: + {{- include "owncloud.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.persistent.owncloud.accessMode | default " ReadWriteOnce" }} + resources: + requests: + storage: {{ .Values.persistent.owncloud.volume.size | default " 100Gi" }} diff --git a/charts/owncloud/templates/owncloud-svc.yaml b/charts/owncloud/templates/owncloud-svc.yaml new file mode 100644 index 00000000..2565042d --- /dev/null +++ b/charts/owncloud/templates/owncloud-svc.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "owncloud.fullname" . }} + labels: + {{- include "owncloud.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.owncloud.type }} + ports: + - port: {{ .Values.service.owncloud.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "owncloud.selectorLabels" . | nindent 4 }} diff --git a/charts/owncloud/templates/redis-dc.yaml b/charts/owncloud/templates/redis-dc.yaml new file mode 100644 index 00000000..a3896b97 --- /dev/null +++ b/charts/owncloud/templates/redis-dc.yaml @@ -0,0 +1,84 @@ +--- +apiVersion: apps.openshift.io/v1 +kind: DeploymentConfig +metadata: + name: {{ include "redis.fullname" . }} + labels: + {{- include "redis.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + {{- include "redis.selectorLabels" . | nindent 4 }} + strategy: + activeDeadlineSeconds: 21600 + resources: {} + rollingParams: + intervalSeconds: 1 + maxSurge: 25% + maxUnavailable: 25% + timeoutSeconds: 600 + updatePeriodSeconds: 1 + type: Rolling + template: + metadata: + labels: + {{- include "redis.selectorLabels" . | nindent 8 }} + spec: + containers: + - image: {{ .Values.image.redis.image }} + imagePullPolicy: {{ .Values.image.redis.pullPolicy }} + name: redis + ports: + - containerPort: 6379 + name: redis + protocol: TCP + resources: {} + securityContext: + allowPrivilegeEscalation: false + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /data + name: data + - args: + - 'trap : TERM INT; sleep infinity & wait' + command: + - /bin/bash + - -c + image: {{ .Values.image.redis.healthimage }} + imagePullPolicy: {{ .Values.image.redis.pullPolicy }} + livenessProbe: + exec: + command: + - /usr/local/bin/docker-healthcheck + failureThreshold: 30 + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + name: healthcheck + readinessProbe: + exec: + command: + - /usr/local/bin/docker-healthcheck + failureThreshold: 30 + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + hostname: redis + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - name: data + persistentVolumeClaim: + claimName: {{ include "redis.fullname" . }} + test: false + triggers: + - type: ConfigChange diff --git a/charts/owncloud/templates/redis-pvc.yaml b/charts/owncloud/templates/redis-pvc.yaml new file mode 100644 index 00000000..d1400311 --- /dev/null +++ b/charts/owncloud/templates/redis-pvc.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "redis.fullname" . }} + labels: + {{- include "redis.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.persistent.redis.accessMode | default " ReadWriteOnce" }} + resources: + requests: + storage: {{ .Values.persistent.redis.volume.size | default " 1Gi" }} diff --git a/charts/owncloud/templates/redis-svc.yaml b/charts/owncloud/templates/redis-svc.yaml new file mode 100644 index 00000000..6bfaee37 --- /dev/null +++ b/charts/owncloud/templates/redis-svc.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "redis.fullname" . }} + labels: + {{- include "redis.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.redis.type }} + ports: + - port: {{ .Values.service.redis.port }} + targetPort: redis + protocol: TCP + name: redis + selector: + {{- include "redis.selectorLabels" . | nindent 4 }} diff --git a/charts/owncloud/templates/route.yaml b/charts/owncloud/templates/route.yaml new file mode 100644 index 00000000..4ac2a21b --- /dev/null +++ b/charts/owncloud/templates/route.yaml @@ -0,0 +1,26 @@ +{{- if .Values.route }} +--- +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + name: {{ include "owncloud.fullname" . }} + labels: + {{- include "owncloud.labels" . | nindent 4 }} +spec: + host: {{ .Values.hostname | quote }} + port: + targetPort: http + to: + kind: Service + name: {{ include "owncloud.fullname" . }} + weight: 100 + wildcardPolicy: None + tls: + insecureEdgeTerminationPolicy: Redirect + termination: edge +status: + ingress: + - conditions: + - status: 'True' + type: Admitted +{{ end }} \ No newline at end of file diff --git a/charts/owncloud/templates/serviceaccount.yaml b/charts/owncloud/templates/serviceaccount.yaml new file mode 100644 index 00000000..f111261b --- /dev/null +++ b/charts/owncloud/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "owncloud.serviceAccountName" . }} + labels: + {{- include "owncloud.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end -}} diff --git a/charts/owncloud/values.yaml b/charts/owncloud/values.yaml new file mode 100644 index 00000000..aeaa5fd9 --- /dev/null +++ b/charts/owncloud/values.yaml @@ -0,0 +1,55 @@ +# Default values for owncloud. +replicaCount: 1 + +image: + owncloud: + repository: quay.io/eformat/owncloud-oauth + pullPolicy: IfNotPresent + redis: + image: docker.io/redis:5.0 + healthimage: docker.io/healthcheck/redis:latest + pullPolicy: Always + mariadb: + image: docker.io/mariadb:10.4 + healthimage: docker.io/healthcheck/mysql:latest + pullPolicy: Always + +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + create: true + annotations: {} + name: + +podSecurityContext: {} +securityContext: {} + +service: + owncloud: + type: ClusterIP + port: 8080 + redis: + type: ClusterIP + port: 6379 + mariadb: + type: ClusterIP + port: 3306 + +persistent: + owncloud: + accessMode: ReadWriteOnce + volume: + size: 100Gi + redis: + accessMode: ReadWriteOnce + volume: + size: 1Gi + mariadb: + accessMode: ReadWriteOnce + volume: + size: 10Gi + +# OCP route +route: true +hostname: owncloud.apps.hivec.sandbox1604.opentlc.com