From c2a776bf7d7c6c14bc5be50ed61ba3187d5ece1a Mon Sep 17 00:00:00 2001 From: Ruben Morales Date: Mon, 16 Dec 2019 06:04:59 -0800 Subject: [PATCH] New product version. New base image. Adding Helm Chart. Adding HEALTHCHECK in Dockerfile. Adding SHA256 in prebuild.sh. --- {6.13.7 => 6.13.10}/Dockerfile | 22 ++++--- {6.13.7 => 6.13.10}/LICENSE | 0 {6.13.7 => 6.13.10}/README.md | 0 .../loadbalancer-virtual-host.conf.jinja2 | 0 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 +++++++++++ .../scripts/docker-entrypoint.sh | 0 6.13.7/scripts/prebuild.sh | 3 - 15 files changed, 278 insertions(+), 10 deletions(-) rename {6.13.7 => 6.13.10}/Dockerfile (81%) rename {6.13.7 => 6.13.10}/LICENSE (100%) rename {6.13.7 => 6.13.10}/README.md (100%) rename {6.13.7 => 6.13.10}/config/loadbalancer-virtual-host.conf.jinja2 (100%) create mode 100755 6.13.10/helm/README.md create mode 100755 6.13.10/helm/confluence-cluster-load-balancer/.helmignore create mode 100755 6.13.10/helm/confluence-cluster-load-balancer/Chart.yaml create mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/_helpers.tpl create mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/deployment.yaml create mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/ingress.yaml create mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/service.yaml create mode 100755 6.13.10/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml create mode 100755 6.13.10/helm/confluence-cluster-load-balancer/values.yaml rename {6.13.7 => 6.13.10}/scripts/docker-entrypoint.sh (100%) delete mode 100644 6.13.7/scripts/prebuild.sh diff --git a/6.13.7/Dockerfile b/6.13.10/Dockerfile similarity index 81% rename from 6.13.7/Dockerfile rename to 6.13.10/Dockerfile index a72f2a7..eb1d8c5 100755 --- a/6.13.7/Dockerfile +++ b/6.13.10/Dockerfile @@ -1,6 +1,9 @@ -ARG BASE_REGISTRY=registry.access.redhat.com -ARG BASE_IMAGE=ubi7/ubi -ARG BASE_TAG=7.7 +# +# 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} # @@ -13,9 +16,9 @@ ENV CONFLUENCE_LB_PUBLIC_HOST=confluence-cluster \ # # BASE PACKAGES # -RUN yum -y --nogpgcheck --disableplugin=subscription-manager update && yum clean all -RUN yum install -y --nogpgcheck --disableplugin=subscription-manager httpd python27-python-pip && yum clean all -RUN scl enable python27 "pip install shinto-cli" +RUN yum install -y --nogpgcheck httpd python2-pip && \ + yum clean all && \ + pip2 install shinto-cli # # ERROR LOG, USER @@ -55,11 +58,16 @@ COPY config/loadbalancer-virtual-host.conf.jinja2 /work-private 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 -ENV BASH_ENV=/opt/rh/python27/enable VOLUME ["/work"] ENTRYPOINT ["/work-private/docker-entrypoint.sh"] CMD ["httpd", "-DFOREGROUND"] diff --git a/6.13.7/LICENSE b/6.13.10/LICENSE similarity index 100% rename from 6.13.7/LICENSE rename to 6.13.10/LICENSE diff --git a/6.13.7/README.md b/6.13.10/README.md similarity index 100% rename from 6.13.7/README.md rename to 6.13.10/README.md diff --git a/6.13.7/config/loadbalancer-virtual-host.conf.jinja2 b/6.13.10/config/loadbalancer-virtual-host.conf.jinja2 similarity index 100% rename from 6.13.7/config/loadbalancer-virtual-host.conf.jinja2 rename to 6.13.10/config/loadbalancer-virtual-host.conf.jinja2 diff --git a/6.13.10/helm/README.md b/6.13.10/helm/README.md new file mode 100755 index 0000000..9d80ab9 --- /dev/null +++ b/6.13.10/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/6.13.10/helm/confluence-cluster-load-balancer/.helmignore b/6.13.10/helm/confluence-cluster-load-balancer/.helmignore new file mode 100755 index 0000000..50af031 --- /dev/null +++ b/6.13.10/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/6.13.10/helm/confluence-cluster-load-balancer/Chart.yaml b/6.13.10/helm/confluence-cluster-load-balancer/Chart.yaml new file mode 100755 index 0000000..4f50f50 --- /dev/null +++ b/6.13.10/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/6.13.10/helm/confluence-cluster-load-balancer/templates/_helpers.tpl b/6.13.10/helm/confluence-cluster-load-balancer/templates/_helpers.tpl new file mode 100755 index 0000000..ac4b6ee --- /dev/null +++ b/6.13.10/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/6.13.10/helm/confluence-cluster-load-balancer/templates/deployment.yaml b/6.13.10/helm/confluence-cluster-load-balancer/templates/deployment.yaml new file mode 100755 index 0000000..e2a11df --- /dev/null +++ b/6.13.10/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/6.13.10/helm/confluence-cluster-load-balancer/templates/ingress.yaml b/6.13.10/helm/confluence-cluster-load-balancer/templates/ingress.yaml new file mode 100755 index 0000000..3f50fab --- /dev/null +++ b/6.13.10/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/6.13.10/helm/confluence-cluster-load-balancer/templates/service.yaml b/6.13.10/helm/confluence-cluster-load-balancer/templates/service.yaml new file mode 100755 index 0000000..59f156b --- /dev/null +++ b/6.13.10/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/6.13.10/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml b/6.13.10/helm/confluence-cluster-load-balancer/templates/serviceaccount.yaml new file mode 100755 index 0000000..d368846 --- /dev/null +++ b/6.13.10/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/6.13.10/helm/confluence-cluster-load-balancer/values.yaml b/6.13.10/helm/confluence-cluster-load-balancer/values.yaml new file mode 100755 index 0000000..749468c --- /dev/null +++ b/6.13.10/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/6.13.7/scripts/docker-entrypoint.sh b/6.13.10/scripts/docker-entrypoint.sh similarity index 100% rename from 6.13.7/scripts/docker-entrypoint.sh rename to 6.13.10/scripts/docker-entrypoint.sh diff --git a/6.13.7/scripts/prebuild.sh b/6.13.7/scripts/prebuild.sh deleted file mode 100644 index 1e92c83..0000000 --- a/6.13.7/scripts/prebuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -set -e \ No newline at end of file -- GitLab