From 5a3a2086bb37283615f97d3591cc41ac6e606a3f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Mar 2020 17:45:39 -0500 Subject: [PATCH 01/10] added new branch --- Dockerfile | 73 +++++++++++++++++++ Jenkinsfile | 3 + LICENSE | 7 ++ README.md | 10 +++ config/loadbalancer-virtual-host.conf.jinja2 | 38 ++++++++++ helm/README.md | 9 +++ .../.helmignore | 22 ++++++ .../Chart.yaml | 11 +++ .../templates/_helpers.tpl | 63 ++++++++++++++++ .../templates/deployment.yaml | 58 +++++++++++++++ .../templates/ingress.yaml | 41 +++++++++++ .../templates/service.yaml | 15 ++++ .../templates/serviceaccount.yaml | 8 ++ .../values.yaml | 36 +++++++++ scripts/docker-entrypoint.sh | 13 ++++ 15 files changed, 407 insertions(+) create mode 100755 Dockerfile create mode 100644 Jenkinsfile create mode 100755 LICENSE create mode 100755 README.md create mode 100755 config/loadbalancer-virtual-host.conf.jinja2 create mode 100755 helm/README.md create mode 100755 helm/confluence-cluster-load-balancer/.helmignore create mode 100755 helm/confluence-cluster-load-balancer/Chart.yaml create mode 100755 helm/confluence-cluster-load-balancer/templates/_helpers.tpl create mode 100755 helm/confluence-cluster-load-balancer/templates/deployment.yaml create mode 100755 helm/confluence-cluster-load-balancer/templates/ingress.yaml create mode 100755 helm/confluence-cluster-load-balancer/templates/service.yaml create mode 100755 helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml create mode 100755 helm/confluence-cluster-load-balancer/values.yaml create mode 100755 scripts/docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 0000000..eb1d8c5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,73 @@ +# +# BASE IMAGE +# +ARG BASE_REGISTRY=nexus-docker.52.61.140.4.nip.io +ARG BASE_IMAGE=redhat/ubi/ubi8 +ARG BASE_TAG=8.1 +FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} + +# +# ENVIRONMENT VARIABLES +# +ENV CONFLUENCE_LB_PUBLIC_HOST=confluence-cluster \ + CONFLUENCE_LB_PUBLIC_PORT=8090 \ + NODES=1 + +# +# BASE PACKAGES +# +RUN yum install -y --nogpgcheck httpd python2-pip && \ + yum clean all && \ + pip2 install shinto-cli + +# +# ERROR LOG, USER +# +RUN ln -sf /dev/stderr /var/log/httpd/error_log && \ + groupadd -g 10777 worker && \ + useradd -d /work -M -s /sbin/halt -g worker -u 10777 worker && \ + mkdir -p /work && \ + mkdir -p /work-private && \ + mkdir -p /var/www/logs && \ + chown -R worker:worker /work/ && \ + chown -R worker:worker /work-private && \ + chown -R worker:worker /var/www/logs && \ + chown -R worker:worker /etc/httpd/ && \ + touch /var/www/logs/error.log && chown -R worker:worker /var/www/logs/error.log && \ + touch /var/www/logs/access.log && chown -R worker:worker /var/www/logs/access.log && \ + chown -R worker:worker /var/log/httpd && \ + chown -R worker:worker /run/httpd && \ + sed -i -e 's/Listen 80/Listen ${CONFLUENCE_LB_PUBLIC_PORT}\nServerName localhost/g' /etc/httpd/conf/httpd.conf && \ + sed -i -e 's/AllowOverride\s*None/AllowOverride All/ig' /etc/httpd/conf/httpd.conf && \ + echo "Include /work-private/loadbalancer-virtual-host.conf" >> /etc/httpd/conf/httpd.conf + +# +# DOCKER ENTRYPOINT +# +COPY scripts/docker-entrypoint.sh /work-private +RUN chmod u+rx,g+rx,o+rx,a-w /work-private/docker-entrypoint.sh + +# +# TEMPLATES +# +COPY config/loadbalancer-virtual-host.conf.jinja2 /work-private + +# +# WORKDIR +# +WORKDIR /work +EXPOSE $CONFLUENCE_LB_PUBLIC_PORT + +# +# HEALTHCHECK +# +HEALTHCHECK --start-period=1m --interval=3m --timeout=3s \ + CMD curl -f http://localhost:$CONFLUENCE_LB_PUBLIC_PORT/ || exit 1 + +# +# RUN +# +USER worker +VOLUME ["/work"] +ENTRYPOINT ["/work-private/docker-entrypoint.sh"] +CMD ["httpd", "-DFOREGROUND"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..5f0b519 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,3 @@ +@Library('DCCSCR@master') _ +dccscrPipeline() + diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..079d47e --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +A commercial license will be required to run your Confluence instance. + +A 30 Day Unlimited Trial License for Confluence and any associated add-ons / apps in +the marketplace may be acquired by contacting licensing@ascendintegrated.com. + +Purchase of a license will be facilitated by contacting +licensing@ascendintegrated.com. diff --git a/README.md b/README.md new file mode 100755 index 0000000..b401c65 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Confluence Data Center setup +## confluence-load-balancer + +**1.** Build image + + docker build -t . + +**2.** Run image + + docker run -t -p 8090:8090 --net= -e NODES= diff --git a/config/loadbalancer-virtual-host.conf.jinja2 b/config/loadbalancer-virtual-host.conf.jinja2 new file mode 100755 index 0000000..0b9f835 --- /dev/null +++ b/config/loadbalancer-virtual-host.conf.jinja2 @@ -0,0 +1,38 @@ +{% set amountNodes = NODES | int %} + + ServerName {{ CONFLUENCE_LB_PUBLIC_HOST }} + + Require all granted + + Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED + + + {% for n in range(1, (amountNodes+1)) %} + BalancerMember http://confluence-cluster-node{{ n }}:8091 route={{ n }} + {% endfor %} + + + {% for n in range(1, (amountNodes+1)) %} + BalancerMember ws://confluence-cluster-node{{ n }}:8091 route={{ n }} + {% endfor %} + + ProxyPass /synchrony balancer://confluence-synchrony-cluster/synchrony stickysession=ROUTEID + + Require all granted + RewriteEngine on + RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC] + RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC] + RewriteRule .* balancer://confluence-synchrony-cluster-ws%{REQUEST_URI} [P] + + + + {% for n in range(1, (amountNodes+1)) %} + BalancerMember http://confluence-cluster-node{{ n }}:8090 route={{ n }} + {% endfor %} + + ProxyPass / balancer://confluence-cluster/ stickysession=ROUTEID + + ProxyPreserveHost on + ProxyRequests off + ProxyTimeout 9600 + diff --git a/helm/README.md b/helm/README.md new file mode 100755 index 0000000..9d80ab9 --- /dev/null +++ b/helm/README.md @@ -0,0 +1,9 @@ +# confluence-cluster-load-balancer helm chart setup +## confluence-cluster-load-balancer + +**1.** Run helm install + + helm install --set nodes= confluence-cluster confluence-cluster-load-balancer + +# Notes +Image repository in values.yaml should be replaced with actual repository. diff --git a/helm/confluence-cluster-load-balancer/.helmignore b/helm/confluence-cluster-load-balancer/.helmignore new file mode 100755 index 0000000..50af031 --- /dev/null +++ b/helm/confluence-cluster-load-balancer/.helmignore @@ -0,0 +1,22 @@ +# 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/ diff --git a/helm/confluence-cluster-load-balancer/Chart.yaml b/helm/confluence-cluster-load-balancer/Chart.yaml new file mode 100755 index 0000000..4f50f50 --- /dev/null +++ b/helm/confluence-cluster-load-balancer/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +version: 0.1.0 +appVersion: 6.13.10 +description: A Helm chart for Kubernetes +name: confluence-cluster-loadbalancer +keywords: + - loadbalancer + - apache +type: application +maintainers: + - name: Ascend Integrated diff --git a/helm/confluence-cluster-load-balancer/templates/_helpers.tpl b/helm/confluence-cluster-load-balancer/templates/_helpers.tpl new file mode 100755 index 0000000..ac4b6ee --- /dev/null +++ b/helm/confluence-cluster-load-balancer/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "confluence-cluster-loadbalancer.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- 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 "confluence-cluster-loadbalancer.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 -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "confluence-cluster-loadbalancer.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "confluence-cluster-loadbalancer.labels" -}} +helm.sh/chart: {{ include "confluence-cluster-loadbalancer.chart" . }} +{{ include "confluence-cluster-loadbalancer.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "confluence-cluster-loadbalancer.selectorLabels" -}} +app.kubernetes.io/name: {{ include "confluence-cluster-loadbalancer.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "confluence-cluster-loadbalancer.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "confluence-cluster-loadbalancer.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/helm/confluence-cluster-load-balancer/templates/deployment.yaml b/helm/confluence-cluster-load-balancer/templates/deployment.yaml new file mode 100755 index 0000000..e2a11df --- /dev/null +++ b/helm/confluence-cluster-load-balancer/templates/deployment.yaml @@ -0,0 +1,58 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "confluence-cluster-loadbalancer.fullname" . }} + labels: + {{- include "confluence-cluster-loadbalancer.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "confluence-cluster-loadbalancer.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "confluence-cluster-loadbalancer.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "confluence-cluster-loadbalancer.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 8090 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + env: + - name: NODES + value: {{ .Values.nodes | quote }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/helm/confluence-cluster-load-balancer/templates/ingress.yaml b/helm/confluence-cluster-load-balancer/templates/ingress.yaml new file mode 100755 index 0000000..3f50fab --- /dev/null +++ b/helm/confluence-cluster-load-balancer/templates/ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "confluence-cluster-loadbalancer.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "confluence-cluster-loadbalancer.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm/confluence-cluster-load-balancer/templates/service.yaml b/helm/confluence-cluster-load-balancer/templates/service.yaml new file mode 100755 index 0000000..59f156b --- /dev/null +++ b/helm/confluence-cluster-load-balancer/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "confluence-cluster-loadbalancer.fullname" . }} + labels: + {{- include "confluence-cluster-loadbalancer.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "confluence-cluster-loadbalancer.selectorLabels" . | nindent 4 }} diff --git a/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml b/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml new file mode 100755 index 0000000..d368846 --- /dev/null +++ b/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "confluence-cluster-loadbalancer.serviceAccountName" . }} + labels: +{{ include "confluence-cluster-loadbalancer.labels" . | nindent 4 }} +{{- end -}} diff --git a/helm/confluence-cluster-load-balancer/values.yaml b/helm/confluence-cluster-load-balancer/values.yaml new file mode 100755 index 0000000..749468c --- /dev/null +++ b/helm/confluence-cluster-load-balancer/values.yaml @@ -0,0 +1,36 @@ +image: + repository: dsop/confluence-load-balancer + tag: 6.13.10 + pullPolicy: IfNotPresent + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + create: true + name: + +podSecurityContext: {} + +securityContext: {} + +service: + type: ClusterIP + port: 8090 + +ingress: + enabled: false + annotations: {} + hosts: + - host: confluence-cluster.local + paths: [] + tls: [] + +resources: {} + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh new file mode 100755 index 0000000..c87137c --- /dev/null +++ b/scripts/docker-entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +umask u+rxw,g+rwx,o-rwx + +# +# GENERATE LOADBALANCER CONFIG BASED ON AMOUNT OF NODES +# +echo "generating loadbalancer config for $NODES nodes" +env | j2 --format=env /work-private/loadbalancer-virtual-host.conf.jinja2 > /work-private/loadbalancer-virtual-host.conf + +exec "$@" -- GitLab From 27716bee7940f1bf658764dc1ac04a6844e23407 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Mar 2020 17:48:56 -0500 Subject: [PATCH 02/10] deleted version folder --- 6.13.10/Dockerfile | 73 ------------------- 6.13.10/LICENSE | 7 -- 6.13.10/README.md | 10 --- .../loadbalancer-virtual-host.conf.jinja2 | 38 ---------- 6.13.10/helm/README.md | 9 --- .../.helmignore | 22 ------ .../Chart.yaml | 11 --- .../templates/_helpers.tpl | 63 ---------------- .../templates/deployment.yaml | 58 --------------- .../templates/ingress.yaml | 41 ----------- .../templates/service.yaml | 15 ---- .../templates/serviceaccount.yaml | 8 -- .../values.yaml | 36 --------- 6.13.10/scripts/docker-entrypoint.sh | 13 ---- 14 files changed, 404 deletions(-) delete mode 100755 6.13.10/Dockerfile delete mode 100755 6.13.10/LICENSE delete mode 100755 6.13.10/README.md delete mode 100755 6.13.10/config/loadbalancer-virtual-host.conf.jinja2 delete mode 100755 6.13.10/helm/README.md delete mode 100755 6.13.10/helm/confluence-cluster-load-balancer/.helmignore delete mode 100755 6.13.10/helm/confluence-cluster-load-balancer/Chart.yaml delete mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/_helpers.tpl delete mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/deployment.yaml delete mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/ingress.yaml delete mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/service.yaml delete mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml delete mode 100755 6.13.10/helm/confluence-cluster-load-balancer/values.yaml delete mode 100755 6.13.10/scripts/docker-entrypoint.sh diff --git a/6.13.10/Dockerfile b/6.13.10/Dockerfile deleted file mode 100755 index eb1d8c5..0000000 --- a/6.13.10/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# -# BASE IMAGE -# -ARG BASE_REGISTRY=nexus-docker.52.61.140.4.nip.io -ARG BASE_IMAGE=redhat/ubi/ubi8 -ARG BASE_TAG=8.1 -FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} - -# -# ENVIRONMENT VARIABLES -# -ENV CONFLUENCE_LB_PUBLIC_HOST=confluence-cluster \ - CONFLUENCE_LB_PUBLIC_PORT=8090 \ - NODES=1 - -# -# BASE PACKAGES -# -RUN yum install -y --nogpgcheck httpd python2-pip && \ - yum clean all && \ - pip2 install shinto-cli - -# -# ERROR LOG, USER -# -RUN ln -sf /dev/stderr /var/log/httpd/error_log && \ - groupadd -g 10777 worker && \ - useradd -d /work -M -s /sbin/halt -g worker -u 10777 worker && \ - mkdir -p /work && \ - mkdir -p /work-private && \ - mkdir -p /var/www/logs && \ - chown -R worker:worker /work/ && \ - chown -R worker:worker /work-private && \ - chown -R worker:worker /var/www/logs && \ - chown -R worker:worker /etc/httpd/ && \ - touch /var/www/logs/error.log && chown -R worker:worker /var/www/logs/error.log && \ - touch /var/www/logs/access.log && chown -R worker:worker /var/www/logs/access.log && \ - chown -R worker:worker /var/log/httpd && \ - chown -R worker:worker /run/httpd && \ - sed -i -e 's/Listen 80/Listen ${CONFLUENCE_LB_PUBLIC_PORT}\nServerName localhost/g' /etc/httpd/conf/httpd.conf && \ - sed -i -e 's/AllowOverride\s*None/AllowOverride All/ig' /etc/httpd/conf/httpd.conf && \ - echo "Include /work-private/loadbalancer-virtual-host.conf" >> /etc/httpd/conf/httpd.conf - -# -# DOCKER ENTRYPOINT -# -COPY scripts/docker-entrypoint.sh /work-private -RUN chmod u+rx,g+rx,o+rx,a-w /work-private/docker-entrypoint.sh - -# -# TEMPLATES -# -COPY config/loadbalancer-virtual-host.conf.jinja2 /work-private - -# -# WORKDIR -# -WORKDIR /work -EXPOSE $CONFLUENCE_LB_PUBLIC_PORT - -# -# HEALTHCHECK -# -HEALTHCHECK --start-period=1m --interval=3m --timeout=3s \ - CMD curl -f http://localhost:$CONFLUENCE_LB_PUBLIC_PORT/ || exit 1 - -# -# RUN -# -USER worker -VOLUME ["/work"] -ENTRYPOINT ["/work-private/docker-entrypoint.sh"] -CMD ["httpd", "-DFOREGROUND"] diff --git a/6.13.10/LICENSE b/6.13.10/LICENSE deleted file mode 100755 index 079d47e..0000000 --- a/6.13.10/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -A commercial license will be required to run your Confluence instance. - -A 30 Day Unlimited Trial License for Confluence and any associated add-ons / apps in -the marketplace may be acquired by contacting licensing@ascendintegrated.com. - -Purchase of a license will be facilitated by contacting -licensing@ascendintegrated.com. diff --git a/6.13.10/README.md b/6.13.10/README.md deleted file mode 100755 index b401c65..0000000 --- a/6.13.10/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Confluence Data Center setup -## confluence-load-balancer - -**1.** Build image - - docker build -t . - -**2.** Run image - - docker run -t -p 8090:8090 --net= -e NODES= diff --git a/6.13.10/config/loadbalancer-virtual-host.conf.jinja2 b/6.13.10/config/loadbalancer-virtual-host.conf.jinja2 deleted file mode 100755 index 0b9f835..0000000 --- a/6.13.10/config/loadbalancer-virtual-host.conf.jinja2 +++ /dev/null @@ -1,38 +0,0 @@ -{% set amountNodes = NODES | int %} - - ServerName {{ CONFLUENCE_LB_PUBLIC_HOST }} - - Require all granted - - Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED - - - {% for n in range(1, (amountNodes+1)) %} - BalancerMember http://confluence-cluster-node{{ n }}:8091 route={{ n }} - {% endfor %} - - - {% for n in range(1, (amountNodes+1)) %} - BalancerMember ws://confluence-cluster-node{{ n }}:8091 route={{ n }} - {% endfor %} - - ProxyPass /synchrony balancer://confluence-synchrony-cluster/synchrony stickysession=ROUTEID - - Require all granted - RewriteEngine on - RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC] - RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC] - RewriteRule .* balancer://confluence-synchrony-cluster-ws%{REQUEST_URI} [P] - - - - {% for n in range(1, (amountNodes+1)) %} - BalancerMember http://confluence-cluster-node{{ n }}:8090 route={{ n }} - {% endfor %} - - ProxyPass / balancer://confluence-cluster/ stickysession=ROUTEID - - ProxyPreserveHost on - ProxyRequests off - ProxyTimeout 9600 - diff --git a/6.13.10/helm/README.md b/6.13.10/helm/README.md deleted file mode 100755 index 9d80ab9..0000000 --- a/6.13.10/helm/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# confluence-cluster-load-balancer helm chart setup -## confluence-cluster-load-balancer - -**1.** Run helm install - - helm install --set nodes= confluence-cluster confluence-cluster-load-balancer - -# Notes -Image repository in values.yaml should be replaced with actual repository. diff --git a/6.13.10/helm/confluence-cluster-load-balancer/.helmignore b/6.13.10/helm/confluence-cluster-load-balancer/.helmignore deleted file mode 100755 index 50af031..0000000 --- a/6.13.10/helm/confluence-cluster-load-balancer/.helmignore +++ /dev/null @@ -1,22 +0,0 @@ -# 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/ diff --git a/6.13.10/helm/confluence-cluster-load-balancer/Chart.yaml b/6.13.10/helm/confluence-cluster-load-balancer/Chart.yaml deleted file mode 100755 index 4f50f50..0000000 --- a/6.13.10/helm/confluence-cluster-load-balancer/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -version: 0.1.0 -appVersion: 6.13.10 -description: A Helm chart for Kubernetes -name: confluence-cluster-loadbalancer -keywords: - - loadbalancer - - apache -type: application -maintainers: - - name: Ascend Integrated diff --git a/6.13.10/helm/confluence-cluster-load-balancer/templates/_helpers.tpl b/6.13.10/helm/confluence-cluster-load-balancer/templates/_helpers.tpl deleted file mode 100755 index ac4b6ee..0000000 --- a/6.13.10/helm/confluence-cluster-load-balancer/templates/_helpers.tpl +++ /dev/null @@ -1,63 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "confluence-cluster-loadbalancer.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- 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 "confluence-cluster-loadbalancer.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 -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "confluence-cluster-loadbalancer.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "confluence-cluster-loadbalancer.labels" -}} -helm.sh/chart: {{ include "confluence-cluster-loadbalancer.chart" . }} -{{ include "confluence-cluster-loadbalancer.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{/* -Selector labels -*/}} -{{- define "confluence-cluster-loadbalancer.selectorLabels" -}} -app.kubernetes.io/name: {{ include "confluence-cluster-loadbalancer.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "confluence-cluster-loadbalancer.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (include "confluence-cluster-loadbalancer.fullname" .) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} diff --git a/6.13.10/helm/confluence-cluster-load-balancer/templates/deployment.yaml b/6.13.10/helm/confluence-cluster-load-balancer/templates/deployment.yaml deleted file mode 100755 index e2a11df..0000000 --- a/6.13.10/helm/confluence-cluster-load-balancer/templates/deployment.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "confluence-cluster-loadbalancer.fullname" . }} - labels: - {{- include "confluence-cluster-loadbalancer.labels" . | nindent 4 }} -spec: - replicas: 1 - selector: - matchLabels: - {{- include "confluence-cluster-loadbalancer.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "confluence-cluster-loadbalancer.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "confluence-cluster-loadbalancer.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: 8090 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - env: - - name: NODES - value: {{ .Values.nodes | quote }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/6.13.10/helm/confluence-cluster-load-balancer/templates/ingress.yaml b/6.13.10/helm/confluence-cluster-load-balancer/templates/ingress.yaml deleted file mode 100755 index 3f50fab..0000000 --- a/6.13.10/helm/confluence-cluster-load-balancer/templates/ingress.yaml +++ /dev/null @@ -1,41 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "confluence-cluster-loadbalancer.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "confluence-cluster-loadbalancer.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ . }} - backend: - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} -{{- end }} diff --git a/6.13.10/helm/confluence-cluster-load-balancer/templates/service.yaml b/6.13.10/helm/confluence-cluster-load-balancer/templates/service.yaml deleted file mode 100755 index 59f156b..0000000 --- a/6.13.10/helm/confluence-cluster-load-balancer/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "confluence-cluster-loadbalancer.fullname" . }} - labels: - {{- include "confluence-cluster-loadbalancer.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "confluence-cluster-loadbalancer.selectorLabels" . | nindent 4 }} diff --git a/6.13.10/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml b/6.13.10/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml deleted file mode 100755 index d368846..0000000 --- a/6.13.10/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml +++ /dev/null @@ -1,8 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "confluence-cluster-loadbalancer.serviceAccountName" . }} - labels: -{{ include "confluence-cluster-loadbalancer.labels" . | nindent 4 }} -{{- end -}} diff --git a/6.13.10/helm/confluence-cluster-load-balancer/values.yaml b/6.13.10/helm/confluence-cluster-load-balancer/values.yaml deleted file mode 100755 index 749468c..0000000 --- a/6.13.10/helm/confluence-cluster-load-balancer/values.yaml +++ /dev/null @@ -1,36 +0,0 @@ -image: - repository: dsop/confluence-load-balancer - tag: 6.13.10 - pullPolicy: IfNotPresent - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - create: true - name: - -podSecurityContext: {} - -securityContext: {} - -service: - type: ClusterIP - port: 8090 - -ingress: - enabled: false - annotations: {} - hosts: - - host: confluence-cluster.local - paths: [] - tls: [] - -resources: {} - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/6.13.10/scripts/docker-entrypoint.sh b/6.13.10/scripts/docker-entrypoint.sh deleted file mode 100755 index c87137c..0000000 --- a/6.13.10/scripts/docker-entrypoint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e - -umask u+rxw,g+rwx,o-rwx - -# -# GENERATE LOADBALANCER CONFIG BASED ON AMOUNT OF NODES -# -echo "generating loadbalancer config for $NODES nodes" -env | j2 --format=env /work-private/loadbalancer-virtual-host.conf.jinja2 > /work-private/loadbalancer-virtual-host.conf - -exec "$@" -- GitLab From bd9a187a54c89efca55f22d03707ccf4021c3e47 Mon Sep 17 00:00:00 2001 From: Daniel Casias Date: Wed, 11 Mar 2020 10:24:37 -0600 Subject: [PATCH 03/10] Use separate RUN commands for yum and pip --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb1d8c5..a4e2926 100755 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,8 @@ ENV CONFLUENCE_LB_PUBLIC_HOST=confluence-cluster \ # BASE PACKAGES # RUN yum install -y --nogpgcheck httpd python2-pip && \ - yum clean all && \ - pip2 install shinto-cli + yum clean all +RUN pip2 install shinto-cli # # ERROR LOG, USER -- GitLab From 52b10617164158257acc6f4fa06b32b13ff38604 Mon Sep 17 00:00:00 2001 From: Daniel Casias Date: Wed, 11 Mar 2020 18:11:09 -0600 Subject: [PATCH 04/10] Pull tarball and copy over --- Dockerfile | 6 ++++-- download.yaml | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 download.yaml diff --git a/Dockerfile b/Dockerfile index a4e2926..74339ed 100755 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,11 @@ ENV CONFLUENCE_LB_PUBLIC_HOST=confluence-cluster \ # # BASE PACKAGES # -RUN yum install -y --nogpgcheck httpd python2-pip && \ +ARG TARBALL=shinto-cli-0.5.0.tar.gz +COPY ${TARBALL} /tmp/${TARBALL} +RUN yum install -y --nogpgcheck httpd python3-pip && \ yum clean all -RUN pip2 install shinto-cli +RUN pip3 install bottle /tmp/${TARBALL}} # # ERROR LOG, USER diff --git a/download.yaml b/download.yaml new file mode 100644 index 0000000..b98356e --- /dev/null +++ b/download.yaml @@ -0,0 +1,6 @@ +resources: + - url: https://files.pythonhosted.org/packages/15/59/9f8f85a52e13dcabc69110f88eb7ed5733a631b26f10be586168ee57cba9/shinto-cli-0.5.0.tar.gz + filename: shinto-cli-0.5.0.tar.gz + validation: + type: sha256 + value: c142e75c34ecd8d04a6200b23464e084ad54ca598e358d70b958044e6b628c95 -- GitLab From f40fb160d067270fff9191d99efe4719d84e72cd Mon Sep 17 00:00:00 2001 From: Daniel Casias Date: Wed, 11 Mar 2020 18:14:22 -0600 Subject: [PATCH 05/10] fix syntax error from IDE --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 74339ed..f7d1c13 100755 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ ARG TARBALL=shinto-cli-0.5.0.tar.gz COPY ${TARBALL} /tmp/${TARBALL} RUN yum install -y --nogpgcheck httpd python3-pip && \ yum clean all -RUN pip3 install bottle /tmp/${TARBALL}} +RUN pip3 install bottle /tmp/${TARBALL} # # ERROR LOG, USER -- GitLab From 5974793718958a64a60001909d33a114a7fee939 Mon Sep 17 00:00:00 2001 From: Daniel Casias Date: Wed, 11 Mar 2020 18:19:50 -0600 Subject: [PATCH 06/10] Remove tarball after install --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f7d1c13..950f38a 100755 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,9 @@ ARG TARBALL=shinto-cli-0.5.0.tar.gz COPY ${TARBALL} /tmp/${TARBALL} RUN yum install -y --nogpgcheck httpd python3-pip && \ yum clean all -RUN pip3 install bottle /tmp/${TARBALL} +RUN pip3 install /tmp/${TARBALL} + +RUN rm -f /tmp/${TARBALL} # # ERROR LOG, USER -- GitLab From 9ac43bc49fe5eb5794b3d77f77c27fe790dee942 Mon Sep 17 00:00:00 2001 From: Daniel Casias Date: Wed, 11 Mar 2020 18:36:32 -0600 Subject: [PATCH 07/10] Install Jinja2 also --- Dockerfile | 11 +++++++---- download.yaml | 5 +++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 950f38a..3132d3d 100755 --- a/Dockerfile +++ b/Dockerfile @@ -16,13 +16,16 @@ ENV CONFLUENCE_LB_PUBLIC_HOST=confluence-cluster \ # # BASE PACKAGES # -ARG TARBALL=shinto-cli-0.5.0.tar.gz -COPY ${TARBALL} /tmp/${TARBALL} +ARG SHINTO=shinto-cli-0.5.0.tar.gz +ARG JINJA=Jinja2-2.7.2.tar.gz +COPY ${SHINTO} /tmp/${SHINTO} +COPY ${JINJA} /tmp/${JINJA} RUN yum install -y --nogpgcheck httpd python3-pip && \ yum clean all -RUN pip3 install /tmp/${TARBALL} +RUN pip3 install /tmp/${JINJA} +RUN pip3 install /tmp/${SHINTO} -RUN rm -f /tmp/${TARBALL} +RUN rm -f /tmp/${SHINTO} /tmp/${JINJA} # # ERROR LOG, USER diff --git a/download.yaml b/download.yaml index b98356e..7e94890 100644 --- a/download.yaml +++ b/download.yaml @@ -4,3 +4,8 @@ resources: validation: type: sha256 value: c142e75c34ecd8d04a6200b23464e084ad54ca598e358d70b958044e6b628c95 + - url: https://files.pythonhosted.org/packages/23/94/ca42176bf7a252ce1f5d165953013573dffdbe4b5dac07f57146146ea432/Jinja2-2.7.2.tar.gz + filename: Jinja2-2.7.2.tar.gz + validation: + type: sha256 + value: 310a35fbccac3af13ebf927297f871ac656b9da1d248b1fe6765affa71b53235 -- GitLab From edff2a89648cb933d3f61482ffa2842bfef3c868 Mon Sep 17 00:00:00 2001 From: Daniel Casias Date: Wed, 11 Mar 2020 18:46:22 -0600 Subject: [PATCH 08/10] use Python 2 for shinto --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3132d3d..042d806 100755 --- a/Dockerfile +++ b/Dockerfile @@ -20,10 +20,10 @@ ARG SHINTO=shinto-cli-0.5.0.tar.gz ARG JINJA=Jinja2-2.7.2.tar.gz COPY ${SHINTO} /tmp/${SHINTO} COPY ${JINJA} /tmp/${JINJA} -RUN yum install -y --nogpgcheck httpd python3-pip && \ +RUN yum install -y --nogpgcheck httpd python2-pip && \ yum clean all -RUN pip3 install /tmp/${JINJA} -RUN pip3 install /tmp/${SHINTO} +RUN pip2 install /tmp/${JINJA} +RUN pip2 install /tmp/${SHINTO} RUN rm -f /tmp/${SHINTO} /tmp/${JINJA} -- GitLab From 1db7443a68ecad115c0a945deb3d06a45da86fa2 Mon Sep 17 00:00:00 2001 From: Daniel Casias Date: Wed, 11 Mar 2020 18:53:33 -0600 Subject: [PATCH 09/10] now try with only shinto --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 042d806..66f90bb 100755 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ COPY ${SHINTO} /tmp/${SHINTO} COPY ${JINJA} /tmp/${JINJA} RUN yum install -y --nogpgcheck httpd python2-pip && \ yum clean all -RUN pip2 install /tmp/${JINJA} +# RUN pip2 install /tmp/${JINJA} RUN pip2 install /tmp/${SHINTO} RUN rm -f /tmp/${SHINTO} /tmp/${JINJA} -- GitLab From ebee9771c525d59605d9e2b3284e68c781d562e2 Mon Sep 17 00:00:00 2001 From: Daniel Casias Date: Wed, 11 Mar 2020 19:03:39 -0600 Subject: [PATCH 10/10] Install MarkupSafe as well --- Dockerfile | 13 +++++++++++-- download.yaml | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 66f90bb..9032fcb 100755 --- a/Dockerfile +++ b/Dockerfile @@ -15,14 +15,23 @@ ENV CONFLUENCE_LB_PUBLIC_HOST=confluence-cluster \ # # BASE PACKAGES -# +# shinto 0.5.0 +# Dependencies of Shinto CLI +# Jinja2 2.11.1 +# MarkupSafe 1.1.1 ARG SHINTO=shinto-cli-0.5.0.tar.gz ARG JINJA=Jinja2-2.7.2.tar.gz +ARG MARKUPSAFE=MarkupSafe-1.1.1.tar.gz + COPY ${SHINTO} /tmp/${SHINTO} COPY ${JINJA} /tmp/${JINJA} +COPY ${MARKUPSAFE} /tmp/${MARKUPSAFE} + RUN yum install -y --nogpgcheck httpd python2-pip && \ yum clean all -# RUN pip2 install /tmp/${JINJA} + +RUN pip2 install /tmp/${MARKUPSAFE} +RUN pip2 install /tmp/${JINJA} RUN pip2 install /tmp/${SHINTO} RUN rm -f /tmp/${SHINTO} /tmp/${JINJA} diff --git a/download.yaml b/download.yaml index 7e94890..b7384f9 100644 --- a/download.yaml +++ b/download.yaml @@ -9,3 +9,8 @@ resources: validation: type: sha256 value: 310a35fbccac3af13ebf927297f871ac656b9da1d248b1fe6765affa71b53235 + - url: https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz + filename: MarkupSafe-1.1.1.tar.gz + validation: + type: sha256 + value: 29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b \ No newline at end of file -- GitLab