From 31d0c2598fc39e349b1471072516b0f39a487ec2 Mon Sep 17 00:00:00 2001 From: Jorge Marin Date: Mon, 1 Aug 2016 16:53:58 +0200 Subject: [PATCH 1/5] Add Phabricator Chart --- phabricator/Chart.yaml | 13 +++ phabricator/README.md | 74 +++++++++++++++ phabricator/manifests/phabricator-rc.yaml | 95 +++++++++++++++++++ .../manifests/phabricator-secrets.yaml | 12 +++ phabricator/manifests/phabricator-svc.yaml | 20 ++++ phabricator/tpl/phabricator-rc.yaml | 95 +++++++++++++++++++ phabricator/tpl/phabricator-secrets.yaml | 12 +++ phabricator/tpl/values.toml | 11 +++ 8 files changed, 332 insertions(+) create mode 100644 phabricator/Chart.yaml create mode 100644 phabricator/README.md create mode 100644 phabricator/manifests/phabricator-rc.yaml create mode 100644 phabricator/manifests/phabricator-secrets.yaml create mode 100644 phabricator/manifests/phabricator-svc.yaml create mode 100644 phabricator/tpl/phabricator-rc.yaml create mode 100644 phabricator/tpl/phabricator-secrets.yaml create mode 100644 phabricator/tpl/values.toml diff --git a/phabricator/Chart.yaml b/phabricator/Chart.yaml new file mode 100644 index 000000000..7571f2726 --- /dev/null +++ b/phabricator/Chart.yaml @@ -0,0 +1,13 @@ +name: phabricator +home: https://www.phacility.com +source: +- https://github.com/bitnami/bitnami-docker-phabricator +version: 0.2.1 +description: Collection of open source web applications that help software companies build better software. +maintainers: +- Bitnami +dependencies: +- name: mariadb + version: 0.2.1 +details: |- + Phabricator is a collection of open source web applications that help software companies build better software. diff --git a/phabricator/README.md b/phabricator/README.md new file mode 100644 index 000000000..3e2e35732 --- /dev/null +++ b/phabricator/README.md @@ -0,0 +1,74 @@ +# Phabricator + +> Phabricator is a collection of open source web applications that help software companies build better software. Phabricator is built by developers for developers. Every feature is optimized around developer efficiency for however you like to work. Code Quality starts with effective collaboration between team members. + +Based on the [Bitnami Phabricator](https://github.com/bitnami/bitnami-docker-phabricator) image for docker, this Chart bootstraps a [Phabricator](https://phabricator.org/) deployment on a [Kubernetes](https://kubernetes.io) cluster using [Helm](https://helm.sh). + +## Dependencies + +The Phabricator Chart requires the [Bitnami MariaDB Chart](https://github.com/bitnami/charts/tree/master/mariadb) for setting up a database backend. + +Please refer to the [README](https://github.com/bitnami/charts/tree/master/mariadb) of the Bitnami MariaDB Chart for deployment instructions. + +## Persistence + +> *You may skip this section if your only interested in testing the Phabricator Chart and have not yet made the decision to use it for your production workloads.* + +For persistence of the Phabricator configuration and user file uploads, mount a [storage volume](http://kubernetes.io/v1.0/docs/user-guide/volumes.html) at the `/bitnami/phabricator` path of the Phabricator pod. + +By default the Phabricator Chart mounts an [emptyDir](http://kubernetes.io/docs/user-guide/volumes/#emptydir) volume. + +## Configuration + +To edit the default Phabricator configuration, run + +```bash +$ helmc edit phabricator +``` + +Here you can update the Phabricator admin username, password and email address in `tpl/values.toml`. When not specified, the default values are used. + +Refer to the [Environment variables](https://github.com/bitnami/bitnami-docker-phabricator/#environment-variables) section of the [Bitnami Phabricator](https://github.com/bitnami/bitnami-docker-phabricator) image for the default values. + +The values of `phabricatorUser` and `phabricatorPassword` are the login credentials when you [access the Phabricator instance](#access-your-phabricator-application). + +Finally, generate the chart to apply your changes to the configuration. + +```bash +$ helmc generate --force phabricator +``` + +## Access your Phabricator application + +You should now be able to access the application using the external IP configured for the Phabricator service. + +> Note: +> +> On GKE, the service will automatically configure a firewall rule so that the Phabricator instance is accessible from the internet, for which you will be charged additionally. +> +> On other cloud platforms you may have to setup a firewall rule manually. Please refer your cloud providers documentation. + +Get the external IP address of your Phabricator instance using: + +```bash +$ kubectl get services phabricator +NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE +phabricator 10.63.246.116 146.148.20.117 80/TCP,443/TCP app=phabricator 15m +``` + +Access your Phabricator deployment using the IP address listed under the `EXTERNAL_IP` column. + +The default credentials are: + + - Username: `user` + - Password: `bitnami1` + +## Cleanup + +To delete the Phabricator deployment completely: + +```bash +$ helmc uninstall -n default phabricator +``` + +Additionally you may want to [Cleanup the MariaDB Chart](https://github.com/bitnami/charts/tree/master/mariadb#cleanup) diff --git a/phabricator/manifests/phabricator-rc.yaml b/phabricator/manifests/phabricator-rc.yaml new file mode 100644 index 000000000..07f8b23ee --- /dev/null +++ b/phabricator/manifests/phabricator-rc.yaml @@ -0,0 +1,95 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/phabricator-rc.yaml $HELM_GENERATE_FILE +apiVersion: v1 +kind: ReplicationController +metadata: + name: phabricator + labels: + app: phabricator + provider: phabricator-server + heritage: bitnami +spec: + replicas: 1 + selector: + app: phabricator + provider: phabricator-server + version: 2016.31-r0 + template: + metadata: + labels: + app: phabricator + provider: phabricator-server + version: 2016.31-r0 + heritage: bitnami + spec: + containers: + - name: phabricator + image: bitnami/phabricator:2016.31-r0 + env: + - name: MARIADB_HOST + value: "mariadb" + - name: MARIADB_PORT + value: "3306" + - name: MARIADB_PASSWORD + valueFrom: + secretKeyRef: + name: mariadb + key: mariadb-root-password + - name: PHABRICATOR_USERNAME + value: "user" + - name: PHABRICATOR_PASSWORD + valueFrom: + secretKeyRef: + name: phabricator + key: phabricator-password + - name: PHABRICATOR_EMAIL + value: "user@example.com" + - name: PHABRICATOR_FIRSTNAME + value: "First Name" + - name: PHABRICATOR_LASTNAME + value: "Last Name" + - name: PHABRICATOR_HOST + value: "" + - name: SMTP_HOST + value: "" + - name: SMTP_PORT + value: "" + - name: SMTP_USER + value: "" + - name: SMTP_PASSWORD + valueFrom: + secretKeyRef: + name: phabricator + key: smtp-password + - name: SMTP_PROTOCOL + value: "" + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + livenessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 120 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 5 + timeoutSeconds: 1 + volumeMounts: + - name: phabricator-data + mountPath: /bitnami/phabricator + - name: apache-data + mountPath: /bitnami/apache + - name: php-data + mountPath: /bitnami/php + volumes: + - name: phabricator-data + emptyDir: {} + - name: apache-data + emptyDir: {} + - name: php-data + emptyDir: {} diff --git a/phabricator/manifests/phabricator-secrets.yaml b/phabricator/manifests/phabricator-secrets.yaml new file mode 100644 index 000000000..eda035729 --- /dev/null +++ b/phabricator/manifests/phabricator-secrets.yaml @@ -0,0 +1,12 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/phabricator-secrets.yaml $HELM_GENERATE_FILE +apiVersion: v1 +kind: Secret +metadata: + name: phabricator + labels: + provider: phabricator + heritage: bitnami +type: Opaque +data: + phabricator-password: "Yml0bmFtaTE=" + smtp-password: "" diff --git a/phabricator/manifests/phabricator-svc.yaml b/phabricator/manifests/phabricator-svc.yaml new file mode 100644 index 000000000..f6ee0a4c7 --- /dev/null +++ b/phabricator/manifests/phabricator-svc.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: phabricator + labels: + app: phabricator + provider: phabricator-server + heritage: bitnami +spec: + type: LoadBalancer + ports: + - name: http + port: 80 + targetPort: http + - name: https + port: 443 + targetPort: https + selector: + app: phabricator + provider: phabricator-server diff --git a/phabricator/tpl/phabricator-rc.yaml b/phabricator/tpl/phabricator-rc.yaml new file mode 100644 index 000000000..c7780306e --- /dev/null +++ b/phabricator/tpl/phabricator-rc.yaml @@ -0,0 +1,95 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/phabricator-rc.yaml $HELM_GENERATE_FILE +apiVersion: v1 +kind: ReplicationController +metadata: + name: phabricator + labels: + app: phabricator + provider: phabricator-server + heritage: bitnami +spec: + replicas: 1 + selector: + app: phabricator + provider: phabricator-server + version: 2016.31-r0 + template: + metadata: + labels: + app: phabricator + provider: phabricator-server + version: 2016.31-r0 + heritage: bitnami + spec: + containers: + - name: phabricator + image: bitnami/phabricator:2016.31-r0 + env: + - name: MARIADB_HOST + value: "mariadb" + - name: MARIADB_PORT + value: "3306" + - name: MARIADB_PASSWORD + valueFrom: + secretKeyRef: + name: mariadb + key: mariadb-root-password + - name: PHABRICATOR_USERNAME + value: {{ .phabricatorUsername | quote }} + - name: PHABRICATOR_PASSWORD + valueFrom: + secretKeyRef: + name: phabricator + key: phabricator-password + - name: PHABRICATOR_EMAIL + value: {{ .phabricatorEmail | quote }} + - name: PHABRICATOR_FIRSTNAME + value: {{ .phabricatorFirstName | quote }} + - name: PHABRICATOR_LASTNAME + value: {{ .phabricatorLastName | quote }} + - name: PHABRICATOR_HOST + value: {{ .phabricatorHost | quote }} + - name: SMTP_HOST + value: {{ .smtpHost | quote }} + - name: SMTP_PORT + value: {{ .smtpPort | quote }} + - name: SMTP_USER + value: {{ .smtpUser | quote }} + - name: SMTP_PASSWORD + valueFrom: + secretKeyRef: + name: phabricator + key: smtp-password + - name: SMTP_PROTOCOL + value: {{ .smtpProtocol | quote }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + livenessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 120 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 5 + timeoutSeconds: 1 + volumeMounts: + - name: phabricator-data + mountPath: /bitnami/phabricator + - name: apache-data + mountPath: /bitnami/apache + - name: php-data + mountPath: /bitnami/php + volumes: + - name: phabricator-data + emptyDir: {} + - name: apache-data + emptyDir: {} + - name: php-data + emptyDir: {} diff --git a/phabricator/tpl/phabricator-secrets.yaml b/phabricator/tpl/phabricator-secrets.yaml new file mode 100644 index 000000000..ff6921245 --- /dev/null +++ b/phabricator/tpl/phabricator-secrets.yaml @@ -0,0 +1,12 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/phabricator-secrets.yaml $HELM_GENERATE_FILE +apiVersion: v1 +kind: Secret +metadata: + name: phabricator + labels: + provider: phabricator + heritage: bitnami +type: Opaque +data: + phabricator-password: {{ .phabricatorPassword | b64enc | quote }} + smtp-password: {{ .smtpPassword | b64enc | quote }} diff --git a/phabricator/tpl/values.toml b/phabricator/tpl/values.toml new file mode 100644 index 000000000..1b8ec97e6 --- /dev/null +++ b/phabricator/tpl/values.toml @@ -0,0 +1,11 @@ +phabricatorUsername = "user" +phabricatorPassword = "bitnami1" +phabricatorEmail = "user@example.com" +phabricatorFirstName = "First Name" +phabricatorLastName = "Last Name" +phabricatorHost = "" +smtpUser = "" +smtpPassword = "" +smtpHost = "" +smtpPort = "" +smtpProtocol = "" From ec3a0722513cd0463ca3e7db3bf92bdc655b3d6c Mon Sep 17 00:00:00 2001 From: Jorge Marin Date: Fri, 19 Aug 2016 16:54:16 +0200 Subject: [PATCH 2/5] Add instructions for Host configuration with Helm in GKE --- phabricator/README.md | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/phabricator/README.md b/phabricator/README.md index 3e2e35732..65a5f0cf1 100644 --- a/phabricator/README.md +++ b/phabricator/README.md @@ -40,24 +40,48 @@ $ helmc generate --force phabricator ## Access your Phabricator application -You should now be able to access the application using the external IP configured for the Phabricator service. - > Note: > -> On GKE, the service will automatically configure a firewall rule so that the Phabricator instance is accessible from the internet, for which you will be charged additionally. +> Phabricator service needs to know the Load Balancer IP to be configured properly. That's why you need to create a public address before you install the Phabricator Helm Chart. +> +> On GKE, you can can reserve a static external address and then specify that as the loadBalancerIP of a service. More information at [https://cloud.google.com/compute/docs/configure-instance-ip-addresses] > > On other cloud platforms you may have to setup a firewall rule manually. Please refer your cloud providers documentation. -Get the external IP address of your Phabricator instance using: +Reserve a static external address using: ```bash -$ kubectl get services phabricator -NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE -phabricator 10.63.246.116 146.148.20.117 80/TCP,443/TCP app=phabricator 15m +$ gcloud compute addresses create phabricator-public-ip +Created [https://www.googleapis.com/compute/v1/...]. +--- +address: 104.197.39.194 +creationTimestamp: '2016-08-12T03:02:30.702-07:00' +description: '' +id: '8563442497282383961' +kind: compute#address +name: phabricator-public-ip +region: ... +status: RESERVED ``` -Access your Phabricator deployment using the IP address listed under the `EXTERNAL_IP` column. +Edit values.toml and update phabricatorHost with the public IP you reserved before (104.197.39.194 in this example), regenerate the chart and install. +```bash +$ helmc generate --force phabricator +$ helmc install phabricator +``` +> Note: +> +> If you want to use a FQDN associated the IP reserved for the Load Balancer. You need to configure Phabricator service properly. + + +Edit values.toml and update phabricatorHost with the FQDN associated to the reserved IP, regenerate the chart and install. +```bash +$ helmc generate --force phabricator +$ helmc install phabricator +``` + +You should now be able to access the application using the external IP reserved for the Phabricator service (or the FQDN if configured). The default credentials are: - Username: `user` From 3ab9f975d25595d91f3381da7745a2245b7dd40e Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Thu, 25 Aug 2016 19:27:50 +0530 Subject: [PATCH 3/5] phabbricator: fixed liveness and readiness probe tests --- phabricator/manifests/phabricator-rc.yaml | 16 ++++++++++------ phabricator/tpl/phabricator-rc.yaml | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/phabricator/manifests/phabricator-rc.yaml b/phabricator/manifests/phabricator-rc.yaml index 07f8b23ee..29256962c 100644 --- a/phabricator/manifests/phabricator-rc.yaml +++ b/phabricator/manifests/phabricator-rc.yaml @@ -68,15 +68,19 @@ spec: - name: https containerPort: 443 livenessProbe: - httpGet: - path: / - port: http + exec: + command: + - harpoon + - status + - phabricator initialDelaySeconds: 120 timeoutSeconds: 5 readinessProbe: - httpGet: - path: / - port: http + exec: + command: + - harpoon + - status + - phabricator initialDelaySeconds: 5 timeoutSeconds: 1 volumeMounts: diff --git a/phabricator/tpl/phabricator-rc.yaml b/phabricator/tpl/phabricator-rc.yaml index c7780306e..c6b0d4277 100644 --- a/phabricator/tpl/phabricator-rc.yaml +++ b/phabricator/tpl/phabricator-rc.yaml @@ -68,15 +68,19 @@ spec: - name: https containerPort: 443 livenessProbe: - httpGet: - path: / - port: http + exec: + command: + - harpoon + - status + - phabricator initialDelaySeconds: 120 timeoutSeconds: 5 readinessProbe: - httpGet: - path: / - port: http + exec: + command: + - harpoon + - status + - phabricator initialDelaySeconds: 5 timeoutSeconds: 1 volumeMounts: From 7efc8ffb4c612f21eba5fdeb5a86eab62bdf1247 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Thu, 25 Aug 2016 19:33:22 +0530 Subject: [PATCH 4/5] phabricator: added `phabricatorHostIP` value to specify the `loadBalancerIP` --- phabricator/README.md | 3 ++- phabricator/manifests/phabricator-svc.yaml | 2 ++ phabricator/tpl/phabricator-rc.yaml | 2 +- phabricator/tpl/phabricator-svc.yaml | 22 ++++++++++++++++++++++ phabricator/tpl/values.toml | 1 + 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 phabricator/tpl/phabricator-svc.yaml diff --git a/phabricator/README.md b/phabricator/README.md index 65a5f0cf1..554881b75 100644 --- a/phabricator/README.md +++ b/phabricator/README.md @@ -64,7 +64,8 @@ region: ... status: RESERVED ``` -Edit values.toml and update phabricatorHost with the public IP you reserved before (104.197.39.194 in this example), regenerate the chart and install. +Edit `values.toml` and update `phabricatorHostIP` with the public IP you reserved before (104.197.39.194 in this example), regenerate the chart and install. + ```bash $ helmc generate --force phabricator $ helmc install phabricator diff --git a/phabricator/manifests/phabricator-svc.yaml b/phabricator/manifests/phabricator-svc.yaml index f6ee0a4c7..9a8949750 100644 --- a/phabricator/manifests/phabricator-svc.yaml +++ b/phabricator/manifests/phabricator-svc.yaml @@ -1,3 +1,4 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/phabricator-svc.yaml $HELM_GENERATE_FILE apiVersion: v1 kind: Service metadata: @@ -8,6 +9,7 @@ metadata: heritage: bitnami spec: type: LoadBalancer + loadBalancerIP: ports: - name: http port: 80 diff --git a/phabricator/tpl/phabricator-rc.yaml b/phabricator/tpl/phabricator-rc.yaml index c6b0d4277..6af76546d 100644 --- a/phabricator/tpl/phabricator-rc.yaml +++ b/phabricator/tpl/phabricator-rc.yaml @@ -48,7 +48,7 @@ spec: - name: PHABRICATOR_LASTNAME value: {{ .phabricatorLastName | quote }} - name: PHABRICATOR_HOST - value: {{ .phabricatorHost | quote }} + value: {{ default .phabricatorHostIP .phabricatorHost | quote }} - name: SMTP_HOST value: {{ .smtpHost | quote }} - name: SMTP_PORT diff --git a/phabricator/tpl/phabricator-svc.yaml b/phabricator/tpl/phabricator-svc.yaml new file mode 100644 index 000000000..17d155222 --- /dev/null +++ b/phabricator/tpl/phabricator-svc.yaml @@ -0,0 +1,22 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/phabricator-svc.yaml $HELM_GENERATE_FILE +apiVersion: v1 +kind: Service +metadata: + name: phabricator + labels: + app: phabricator + provider: phabricator-server + heritage: bitnami +spec: + type: LoadBalancer + loadBalancerIP: {{ .phabricatorHostIP }} + ports: + - name: http + port: 80 + targetPort: http + - name: https + port: 443 + targetPort: https + selector: + app: phabricator + provider: phabricator-server diff --git a/phabricator/tpl/values.toml b/phabricator/tpl/values.toml index 1b8ec97e6..c284d3821 100644 --- a/phabricator/tpl/values.toml +++ b/phabricator/tpl/values.toml @@ -4,6 +4,7 @@ phabricatorEmail = "user@example.com" phabricatorFirstName = "First Name" phabricatorLastName = "Last Name" phabricatorHost = "" +phabricatorHostIP = "" smtpUser = "" smtpPassword = "" smtpHost = "" From c63546ac954802114d9222e500fd74ae2fca1aa3 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Thu, 25 Aug 2016 22:29:59 +0530 Subject: [PATCH 5/5] phabricator: bump probe timeouts --- phabricator/manifests/phabricator-rc.yaml | 8 ++++---- phabricator/tpl/phabricator-rc.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/phabricator/manifests/phabricator-rc.yaml b/phabricator/manifests/phabricator-rc.yaml index 29256962c..e572bbd3d 100644 --- a/phabricator/manifests/phabricator-rc.yaml +++ b/phabricator/manifests/phabricator-rc.yaml @@ -73,16 +73,16 @@ spec: - harpoon - status - phabricator - initialDelaySeconds: 120 - timeoutSeconds: 5 + initialDelaySeconds: 180 + timeoutSeconds: 15 readinessProbe: exec: command: - harpoon - status - phabricator - initialDelaySeconds: 5 - timeoutSeconds: 1 + initialDelaySeconds: 30 + timeoutSeconds: 5 volumeMounts: - name: phabricator-data mountPath: /bitnami/phabricator diff --git a/phabricator/tpl/phabricator-rc.yaml b/phabricator/tpl/phabricator-rc.yaml index 6af76546d..33c350938 100644 --- a/phabricator/tpl/phabricator-rc.yaml +++ b/phabricator/tpl/phabricator-rc.yaml @@ -73,16 +73,16 @@ spec: - harpoon - status - phabricator - initialDelaySeconds: 120 - timeoutSeconds: 5 + initialDelaySeconds: 180 + timeoutSeconds: 15 readinessProbe: exec: command: - harpoon - status - phabricator - initialDelaySeconds: 5 - timeoutSeconds: 1 + initialDelaySeconds: 30 + timeoutSeconds: 5 volumeMounts: - name: phabricator-data mountPath: /bitnami/phabricator