在Kubernetes集群中部署ownCloud云盘系统

本文详细介绍如何使用Helm包管理器在Kubernetes集群上部署ownCloud文件共享服务器,包括安装、配置、卸载等步骤,并提供参数设置指导,帮助读者实现数据控制与安全。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ownCloud

ownCloud is a file sharing server that puts the control and security of your own data back into your hands.

快速开始

$ helm install stable/owncloud

简要介绍

This chart bootstraps an ownCloud deployment on a Kubernetes cluster using the Helm package manager.

It also packages the Bitnami MariaDB chart which is required for bootstrapping a MariaDB deployment for the database requirements of the ownCloud application.

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters.

准备工作

  • Kubernetes 1.4+ with Beta APIs enabled
  • PV provisioner support in the underlying infrastructure

安装 Chart

To install the chart with the release name my-release:

$ helm install --name my-release stable/owncloud

The command deploys ownCloud on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

卸载 Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

配置

The following table lists the configurable parameters of the ownCloud chart and their default values.

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
image.registryownCloud image registrydocker.io
image.repositoryownCloud Image namebitnami/owncloud
image.tagownCloud Image tag{VERSION}
image.pullPolicyImage pull policyAlways if imageTag is latest, else IfNotPresent
image.pullSecretsSpecify image pull secretsnil
ingress.enabledEnable ingress controller resourcefalse
ingress.hosts[0].nameHostname to your ownCloud installationowncloud.local
ingress.hosts[0].pathPath within the url structure/
ingress.hosts[0].tlsUtilize TLS backend in ingressfalse
ingress.hosts[0].certManagerAdd annotations for cert-managerfalse
ingress.hosts[0].tlsSecretTLS Secret (certificates)owncloud.local-tls-secret
ingress.hosts[0].annotationsAnnotations for this host's ingress record[]
ingress.secrets[0].nameTLS Secret Namenil
ingress.secrets[0].certificateTLS Secret Certificatenil
ingress.secrets[0].keyTLS Secret Keynil
networkPolicyApiVersionThe kubernetes network API versionextensions/v1beta1
owncloudHostownCloud host to create application URLsnil
owncloudLoadBalancerIPloadBalancerIP for the owncloud Servicenil
owncloudUsernameUser of the applicationuser
owncloudPasswordApplication passwordRandomly generated
owncloudEmailAdmin emailuser@example.com
externalDatabase.hostHost of the external databasenil
allowEmptyPasswordAllow DB blank passwordsyes
externalDatabase.hostHost of the external databasenil
externalDatabase.portPort of the external database3306
externalDatabase.databaseName of the existing databasebitnami_owncloud
externalDatabase.userExisting username in the external dbbn_owncloud
externalDatabase.passwordPassword for the above usernamenil
mariadb.db.nameDatabase name to createbitnami_owncloud
mariadb.enabledWhether to use the MariaDB charttrue
mariadb.db.passwordPassword for the databasenil
mariadb.db.userDatabase user to createbn_owncloud
mariadb.rootUser.passwordMariaDB admin passwordnil
serviceTypeKubernetes Service typeLoadBalancer
persistence.enabledEnable persistence using PVCtrue
persistence.apache.storageClassPVC Storage Class for Apache volumenil (uses alpha storage class annotation)
persistence.apache.existingClaimAn Existing PVC name for Apache volumenil (uses alpha storage class annotation)
persistence.apache.accessModePVC Access Mode for Apache volumeReadWriteOnce
persistence.apache.sizePVC Storage Request for Apache volume1Gi
persistence.owncloud.storageClassPVC Storage Class for ownCloud volumenil (uses alpha storage class annotation)
persistence.owncloud.existingClaimAn Existing PVC name for ownCloud volumenil (uses alpha storage class annotation)
persistence.owncloud.accessModePVC Access Mode for ownCloud volumeReadWriteOnce
persistence.owncloud.sizePVC Storage Request for ownCloud volume8Gi
resourcesCPU/Memory resource requests/limitsMemory: 512Mi, CPU: 300m

The above parameters map to the env variables defined in bitnami/owncloud. For more information please refer to the bitnami/owncloud image documentation.

Note:

For ownCloud to function correctly, you should specify the owncloudHost parameter to specify the FQDN (recommended) or the public IP address of the ownCloud service.

Optionally, you can specify the owncloudLoadBalancerIP parameter to assign a reserved IP address to the ownCloud service of the chart. However please note that this feature is only available on a few cloud providers (f.e. GKE).

To reserve a public IP address on GKE:

$ gcloud compute addresses create owncloud-public-ip

The reserved IP address can be associated to the ownCloud service by specifying it as the value of the owncloudLoadBalancerIP parameter while installing the chart.

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm install --name my-release \
  --set owncloudUsername=admin,owncloudPassword=password,mariadb.mariadbRootPassword=secretpassword \
    stable/owncloud

The above command sets the ownCloud administrator account username and password to admin and password respectively. Additionally, it sets the MariaDB root user password to secretpassword.

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml stable/owncloud

Tip: You can use the default values.yaml

持久存储

The Bitnami ownCloud image stores the ownCloud data and configurations at the /bitnami/owncloud and /bitnami/apache paths of the container.

Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. See the Configuration section to configure the PVC or to disable persistence.

版本升级

To 3.0.0

Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments. Use the workaround below to upgrade from versions previous to 3.0.0. The following example assumes that the release name is owncloud:

$ kubectl patch deployment owncloud-owncloud --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
$ kubectl delete statefulset owncloud-mariadb --cascade=false

转载于:https://my.oschina.net/u/2306127/blog/2248531

### 安装准备 为了在CentOS 7上成功部署OwnCloud云存储服务,确保服务器已经更新到最新状态并安装了必要的依赖包[^1]。 ```bash sudo yum update -y sudo yum install epel-release -y ``` ### 配置LAMP/LNMP环境 OwnCloud可以运行于Apache或Nginx之上。这里以Nginx为例说明配置过程: #### 安装Nginx, PHP-FPM 和 MariaDB ```bash sudo yum install nginx mariadb-server php-fpm php-gd php-mbstring php-intl \ php-pecl-apcu php-xml php-zip unzip curl policycoreutils-python-utils wget -y ``` 启动这些服务并将它们设为随系统启动[^2]: ```bash sudo systemctl start nginx php-fpm mariadb sudo systemctl enable nginx php-fpm mariadb ``` ### 下载与解压OwnCloud 前往官网获取最新的OwnCloud版本链接,并下载至服务器: ```bash cd /tmp/ wget https://download.owncloud.org/community/owncloud-complete-latest.tar.bz2 tar jxf owncloud-complete-latest.tar.bz2 -C /usr/share/nginx/html/ chown -R nginx:nginx /usr/share/nginx/html/owncloud chmod -R 750 /usr/share/nginx/html/owncloud ``` ### Nginx站点配置 编辑`/etc/nginx/conf.d/default.conf`, 添加如下内容来支持OwnCloud路径访问[^4]: ```nginx server { listen 80; server_name _; root /usr/share/nginx/html/; index index.php index.html index.htm; location /owncloud { rewrite ^ /index.php$uri last; } location ~ \.php(?:$|/) { fastcgi_pass unix:/var/run/php-fpm/www.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } ``` 重启Nginx使更改生效: ```bash sudo systemctl restart nginx ``` ### 数据库初始化 登录MariaDB控制台创建专用数据库OwnCloud使用: ```sql CREATE DATABASE owncloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; GRANT ALL PRIVILEGES ON owncloud.* TO 'oc_user'@'localhost' IDENTIFIED BY 'your_password'; FLUSH PRIVILEGES; EXIT; ``` ### Web界面完成安装 打开Web浏览器,在地址栏键入 `http://<您的IP>/owncloud` 进行图形化向导式的最后几步设置。在此期间需提供之前建立好的MySQL/MariaDB连接信息以及设定管理员账户详情。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值