Changes for page XWiki (Helm)
Last modified by Itzhak Daniel on 2024/04/29 16:35
From version 8.1
edited by Itzhak Daniel
on 2024/04/28 20:44
on 2024/04/28 20:44
Change comment:
There is no comment for this version
To version 9.1
edited by Itzhak Daniel
on 2024/04/28 21:16
on 2024/04/28 21:16
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -20,28 +20,77 @@ 20 20 21 21 Here is the list of things you need to have: 22 22 23 -* Kubernetes 1.27 (probably will work with later versions as well). 24 -** Automatic storage provisioner (Behemoth LTD special case). 25 -* Helm 3.12 (probably will work with later versions as well). 23 +* Kubernetes 1.27+. 24 +** Automatic storage provisioner. 25 +** Ingress-nginx. 26 +** Cert-manager. 27 +* Helm 3.12+. 28 +* XWiki 16.2.0. 29 +** Custom Image (non-root). 26 26 27 27 === Note about Storage === 28 28 29 -Behemoth LTD is running an on-prem Kubernetes solution s, we (currently?) don't have any shared storage solution ([[ceph>>https://docs.ceph.com/]], [[nfs>>https://github.com/kubernetes-csi/csi-driver-nfs]], [[...>>https://kubernetes.io/docs/concepts/storage/storage-classes/#provisioner]]) , which require two things:33 +Behemoth LTD is running an on-prem Kubernetes solution, we (currently?) don't have any shared storage solution ([[ceph>>https://docs.ceph.com/]], [[nfs>>https://github.com/kubernetes-csi/csi-driver-nfs]], [[...>>https://kubernetes.io/docs/concepts/storage/storage-classes/#provisioner]]) , which require two things: 30 30 31 31 1. Creating the path/loop device prior of creating PV. 32 32 1. The PV is manually created. 33 33 34 - ==Deploying==38 +You may not need that if your cluster knows to provision storage by itself. 35 35 36 - We'regoing to deploy XWiki as a [[statefulset>>https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/]], theDatabase(MySQL) and the App, each will have a volume to store their content.40 +== CI/CD == 37 37 38 -=== === 42 +At the beginning we tried to avoid making any custom changes to the images in question (XWiki and Bitnami's MySQL). But XWiki running as root, didn't fly. So we had to create a custom image with minor changes to enable it to run as a unprivileged uid/gid: 30001. 43 + 44 +=== Building and Publish === 45 + 46 +You will need to perform the following actions: 47 + 48 +{{code language="sh" layout="LINENUMBERS" title="# Clone the repository"}} 49 +git clone --depth 1 --branch master https://github.com/xwiki/xwiki-docker.git 50 +{{/code}} 51 + 52 +Once you have the repo locally, modify the //Dockerfile// as shown below: 53 + 54 +{{code language="git" title="# Diff"}} 55 +@@ -89,6 +89,11 @@ COPY xwiki/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh 56 + # across runs) 57 + VOLUME /usr/local/xwiki 58 + 59 ++# Added by Behemoth LTD - Apr 28th, 2024 60 ++# Fixing permissions error when using non-root user/group (30001:30001) to start the app 61 ++RUN chown -R 30001:30001 /usr/local/tomcat/webapps 62 ++USER 30001:30001 63 ++ 64 + # At this point the image is done and what remains below are the runtime configuration used by the user to configure 65 + # the container that will be created out of the image. Namely the user can override some environment variables with 66 + # docker run -e "var1=val1" -e "var2=val2" ... 67 + 68 +{{/code}} 69 + 70 +Once the changes have been made, build and push it to your repository. 71 + 72 +{{code language="sh" layout="LINENUMBERS" title="# Docker"}} 73 +cd ./16/mysql-tomcat/ 74 +docker build -t behemothil/xwiki-mysql-tomcat-nonroot:16.2.0-2 . 75 +docker login 76 +docker push behemothil/xwiki-mysql-tomcat-nonroot:16.2.0-2 77 +{{/code}} 78 + 79 +{{code language="sh" layout="LINENUMBERS" title="# Podman"}} 80 +cd ./16/mysql-tomcat/ 81 +buildah build -f Dockerfile -t behemothil/xwiki-mysql-tomcat-nonroot:16.2.0-2 82 +docker push --creds=[Username:[Password]] behemothil/xwiki-mysql-tomcat-nonroot:16.2.0-2 83 +{{/code}} 84 + 85 +=== Deploy === 86 + 87 +We're going to deploy XWiki as a [[statefulset>>https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/]], the Database (MySQL) and the App, each will have a volume to store their content. 39 39 ))) 40 40 41 41 (% class="col-xs-12 col-sm-4" %) 42 42 ((( 43 43 {{box title="**Contents**"}} 44 -{{toc/}} 93 +{{toc numbered="true"/}} 45 45 {{/box}} 46 46 ))) 47 47 )))