From 5a47997e12167ebc73da3ef09f39abeaa200d021 Mon Sep 17 00:00:00 2001 From: Joost Hofman Date: Tue, 30 Jan 2018 18:28:10 +0100 Subject: [PATCH] [stable/artifactory] Postgresql requirement / ingress support / nginx optional (#3242) * Removed Postgresql own deployment and created dependency to stable/Postgresql. Updated artifactory version number to 5.8.0. Updated notes and added ingress documentation. Added Ingress support to artifactory. Made the NGINX deployment optional by adding an enabled flag. Fixed naming of components. * bump chart version * Fixed wrong Chart number for artifactory * Add documentation for Ingress, set Postgresql chart version, set persistence default on true * Refresh requirements.lock * Set version to 7.0.0, cecause the API to the chart changed --- stable/artifactory/Chart.yaml | 2 +- stable/artifactory/README.md | 70 ++++++++++------- stable/artifactory/requirements.lock | 6 ++ stable/artifactory/requirements.yaml | 4 + stable/artifactory/templates/NOTES.txt | 7 +- stable/artifactory/templates/_helpers.tpl | 37 +-------- .../templates/artifactory-deployment.yaml | 16 ++-- .../templates/artifactory-pvc.yaml | 4 +- .../templates/artifactory-service.yaml | 4 +- stable/artifactory/templates/ingress.yaml | 32 ++++++++ .../templates/nginx-deployment.yaml | 8 +- stable/artifactory/templates/nginx-pvc.yaml | 2 +- .../artifactory/templates/nginx-service.yaml | 6 +- .../templates/postgresql-deployment.yaml | 77 ------------------- .../artifactory/templates/postgresql-pvc.yaml | 24 ------ .../templates/postgresql-secret.yaml | 16 ---- .../templates/postgresql-service.yaml | 25 ------ stable/artifactory/values.yaml | 63 ++++++--------- 18 files changed, 139 insertions(+), 264 deletions(-) create mode 100644 stable/artifactory/requirements.lock create mode 100644 stable/artifactory/requirements.yaml create mode 100644 stable/artifactory/templates/ingress.yaml delete mode 100644 stable/artifactory/templates/postgresql-deployment.yaml delete mode 100755 stable/artifactory/templates/postgresql-pvc.yaml delete mode 100644 stable/artifactory/templates/postgresql-secret.yaml delete mode 100644 stable/artifactory/templates/postgresql-service.yaml diff --git a/stable/artifactory/Chart.yaml b/stable/artifactory/Chart.yaml index a922789e07..153d5121c3 100644 --- a/stable/artifactory/Chart.yaml +++ b/stable/artifactory/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: artifactory home: https://www.jfrog.com/artifactory/ -version: 6.2.5 +version: 7.0.0 appVersion: 5.8.3 description: Universal Repository Manager supporting all major packaging formats, build tools and CI servers. diff --git a/stable/artifactory/README.md b/stable/artifactory/README.md index 8f909385be..83e9ae43b0 100644 --- a/stable/artifactory/README.md +++ b/stable/artifactory/README.md @@ -9,8 +9,9 @@ This chart will do the following: * Deploy Artifactory-Pro (or OSS if set custom image) -* Deploy a PostgreSQL database -* Deploy an Nginx server +* Deploy a PostgreSQL database using the stable/postgresql chart +* Deploy an optional Nginx server +* Optionally expose Artifactory with Ingress [Ingress documentation](https://kubernetes.io/docs/concepts/services-networking/ingress/) ## Installing the Chart @@ -51,10 +52,6 @@ $ helm install --name artifactory \ --set artifactory.resources.limits.memory="4Gi" \ --set artifactory.javaOpts.xms="1g" \ --set artifactory.javaOpts.xmx="4g" \ - --set database.resources.requests.cpu="200m" \ - --set database.resources.limits.cpu="1" \ - --set database.resources.requests.memory="500Mi" \ - --set database.resources.limits.memory="1Gi" \ --set nginx.resources.requests.cpu="100m" \ --set nginx.resources.limits.cpu="250m" \ --set nginx.resources.requests.memory="250Mi" \ @@ -66,7 +63,7 @@ Get more details on configuring Artifactory in the [official documentation](http ### Customizing Database password You can override the specified database password (set in [values.yaml](values.yaml)), by passing it as a parameter in the install command line ```bash -$ helm install --name artifactory --namespace artifactory --set database.env.pass=12_hX34qwerQ2 stable/artifactory +$ helm install --name artifactory --namespace artifactory --set postgresql.postgresPassword=12_hX34qwerQ2 stable/artifactory ``` You can customise other parameters in the same way, by passing them on `helm install` command line. @@ -80,7 +77,7 @@ This will completely delete your Artifactory Pro deployment. ### Custom Docker registry for your images -If you need to pull your Docker images from a private registry, you need to create a +If you need to pull your Docker images from a private registry, you need to create a [Kubernetes Docker registry secret](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) and pass it to helm ```bash # Create a Docker registry secret called 'regsecret' @@ -98,26 +95,6 @@ The following tables lists the configurable parameters of the artifactory chart | Parameter | Description | Default | |---------------------------|-----------------------------------|----------------------------------------------------------| | `imagePullSecrets` | Docker registry pull secret | | -| `database.name` | Database name | `postgresql` | -| `database.replicaCount` | Database replica count | `1` | -| `database.env.type` | Database type | `postgresql` | -| `database.env.name` | Database name | `artifactory` | -| `database.env.user` | Database username | `artifactory` | -| `database.env.pass` | Database password | `Randomly generated` | -| `database.image.repository` | Database container image | `docker.bintray.io/postgres` | -| `database.image.version` | Database container image tag | `9.5.2` | -| `database.image.pullPolicy` | Container pull policy | `IfNotPresent` | -| `database.service.type` | Database service type | `ClusterIP` | -| `database.externalPort` | Database service external port | `5432` | -| `database.internalPort` | Database service internal port | `5432` | -| `database.persistence.mountPath` | Database persistence volume mount path | `"/var/lib/postgresql/data"` | -| `database.persistence.enabled` | Database persistence volume enabled | `true` | -| `database.persistence.accessMode` | Database persistence volume access mode | `ReadWriteOnce` | -| `database.persistence.size` | Database persistence volume size | `10Gi` | -| `database.resources.requests.memory` | Database initial memory request | | -| `database.resources.requests.cpu` | Database initial cpu request | | -| `database.resources.limits.memory` | Database memory limit | | -| `database.resources.limits.cpu` | Database cpu limit | | | `artifactory.name` | Artifactory name | `artifactory` | | `artifactory.replicaCount` | Replica count for Artifactory deployment| `1` | | `artifactory.image.pullPolicy` | Container pull policy | `IfNotPresent` | @@ -138,7 +115,12 @@ The following tables lists the configurable parameters of the artifactory chart | `artifactory.javaOpts.xms` | Artifactory java Xms size | | | `artifactory.javaOpts.xmx` | Artifactory java Xms size | | | `artifactory.javaOpts.other` | Artifactory additional java options | | +| `ingress.enabled` | If true, Artifactory Ingress will be created | `false` | +| `ingress.annotations` | Artifactory Ingress annotations | `{}` | +| `ingress.hosts` | Artifactory Ingress hostnames | `[]` | +| `ingress.tls` | Artifactory Ingress TLS configuration (YAML) | `[]` | | `nginx.name` | Nginx name | `nginx` | +| `nginx.enabled` | Deploy nginx server | `false` | | `nginx.replicaCount` | Nginx replica count | `1` | | `nginx.image.repository` | Container image | `docker.bintray.io/jfrog/nginx-artifactory-pro` | | `nginx.image.version` | Container tag | `5.8.3` | @@ -162,8 +144,38 @@ The following tables lists the configurable parameters of the artifactory chart Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. +### Ingress TLS +If your cluster allows automatic creation/retrieval of TLS certificates (e.g. [kube-lego](https://github.com/jetstack/kube-lego)), please refer to the documentation for that mechanism. + +To manually configure TLS, first create/retrieve a key & certificate pair for the address(es) you wish to protect. Then create a TLS secret in the namespace: + +```console +kubectl create secret tls artifactory-tls --cert=path/to/tls.cert --key=path/to/tls.key +``` + +Include the secret's name, along with the desired hostnames, in the Artifactory Ingress TLS section of your custom `values.yaml` file: + +``` + ingress: + ## If true, Artifactory Ingress will be created + ## + enabled: true + + ## Artifactory Ingress hostnames + ## Must be provided if Ingress is enabled + ## + hosts: + - artifactory.domain.com + + ## Artifactory Ingress TLS configuration + ## Secrets must be manually created in the namespace + ## + tls: + - secretName: artifactory-tls + hosts: + - artifactory.domain.com +``` ## Useful links https://www.jfrog.com https://www.jfrog.com/confluence/ - diff --git a/stable/artifactory/requirements.lock b/stable/artifactory/requirements.lock new file mode 100644 index 0000000000..c2ecbf3092 --- /dev/null +++ b/stable/artifactory/requirements.lock @@ -0,0 +1,6 @@ +dependencies: +- name: postgresql + repository: https://kubernetes-charts.storage.googleapis.com/ + version: 0.8.7 +digest: sha256:491a82b45453cd4601610de0b39d0e6366874ea5b47a2caeaed0c3b05a9dbe90 +generated: 2018-01-17T13:04:06.543766+01:00 diff --git a/stable/artifactory/requirements.yaml b/stable/artifactory/requirements.yaml new file mode 100644 index 0000000000..cdb525c718 --- /dev/null +++ b/stable/artifactory/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: postgresql + version: 0.8.7 + repository: https://kubernetes-charts.storage.googleapis.com/ diff --git a/stable/artifactory/templates/NOTES.txt b/stable/artifactory/templates/NOTES.txt index cb728e4cb6..6250efaead 100644 --- a/stable/artifactory/templates/NOTES.txt +++ b/stable/artifactory/templates/NOTES.txt @@ -2,7 +2,12 @@ Congratulations. You have just deployed JFrog Artifactory Pro! 1. Get the Artifactory URL by running these commands: - {{- if contains "NodePort" .Values.nginx.service.type }} + {{- if .Values.ingress.enabled }} + {{- range .Values.ingress.hosts }} + http://{{ . }} + {{- end }} + + {{- else if contains "NodePort" .Values.nginx.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "artifactory.nginx.name" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT/ diff --git a/stable/artifactory/templates/_helpers.tpl b/stable/artifactory/templates/_helpers.tpl index 17eb60feaf..0a754572b5 100644 --- a/stable/artifactory/templates/_helpers.tpl +++ b/stable/artifactory/templates/_helpers.tpl @@ -6,28 +6,13 @@ Expand the name of the chart. {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{/* -Expand the name artifactory service. -*/}} -{{- define "artifactory.artifactory.name" -}} -{{- default .Values.artifactory.name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Expand the name database service. -*/}} -{{- define "artifactory.database.name" -}} -{{- default .Values.database.name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - {{/* Expand the name nginx service. */}} {{- define "artifactory.nginx.name" -}} -{{- default .Values.nginx.name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- default .Chart.Name .Values.nginx.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). @@ -37,24 +22,6 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{/* -Create a default fully qualified application name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "artifactory.artifactory.fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s-%s" .Release.Name $name .Values.artifactory.name | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified database name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "artifactory.database.fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s-%s" .Release.Name $name .Values.database.name | trunc 63 | trimSuffix "-" -}} -{{- end -}} - {{/* Create a default fully qualified nginx name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). @@ -62,4 +29,4 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- define "artifactory.nginx.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s-%s" .Release.Name $name .Values.nginx.name | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/stable/artifactory/templates/artifactory-deployment.yaml b/stable/artifactory/templates/artifactory-deployment.yaml index 9062135c3b..c199b8803c 100644 --- a/stable/artifactory/templates/artifactory-deployment.yaml +++ b/stable/artifactory/templates/artifactory-deployment.yaml @@ -1,7 +1,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ template "artifactory.artifactory.fullname" . }} + name: {{ template "artifactory.fullname" . }} labels: app: {{ template "artifactory.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version }} @@ -37,23 +37,23 @@ spec: command: - 'sh' - '-c' - - 'until nc -z -w 2 {{ template "artifactory.database.name" . }} {{ .Values.database.externalPort }} && echo database ok; do sleep 2; done' + - 'until nc -z -w 2 {{ .Release.Name }}-postgresql {{ .Values.postgresql.service.port }} && echo database ok; do sleep 2; done' containers: - name: {{ .Values.artifactory.name }} image: "{{ .Values.artifactory.image.repository }}:{{ .Values.artifactory.image.version }}" imagePullPolicy: {{ .Values.artifactory.image.pullPolicy }} env: - name: DB_TYPE - value: {{ .Values.database.env.type }} + value: 'postgresql' - name: DB_USER - value: {{ .Values.database.env.user }} + value: {{.Values.postgresql.postgresUser | quote }} - name: DB_PASSWORD valueFrom: secretKeyRef: - name: {{ template "artifactory.fullname" . }} - key: artifactory-database-password + name: {{ .Release.Name }}-postgresql + key: postgres-password - name: DB_HOST - value: {{ template "artifactory.database.name" . }} + value: {{ .Release.Name }}-postgresql - name: EXTRA_JAVA_OPTIONS value: " {{- if .Values.artifactory.javaOpts.other }} @@ -90,7 +90,7 @@ spec: - name: artifactory-volume {{- if .Values.artifactory.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "artifactory.artifactory.fullname" . }} + claimName: {{ .Values.artifactory.persistence.ExistingClaim | default (include "artifactory.fullname" .) }} {{- else }} emptyDir: {} {{- end -}} diff --git a/stable/artifactory/templates/artifactory-pvc.yaml b/stable/artifactory/templates/artifactory-pvc.yaml index 58e32df343..9eea17b6cb 100755 --- a/stable/artifactory/templates/artifactory-pvc.yaml +++ b/stable/artifactory/templates/artifactory-pvc.yaml @@ -1,8 +1,8 @@ -{{- if .Values.artifactory.persistence.enabled }} +{{- if and .Values.artifactory.persistence.enabled (not .Values.artifactory.persistence.ExistingClaim) -}} kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ template "artifactory.artifactory.fullname" . }} + name: {{ template "artifactory.fullname" . }} labels: app: {{ template "artifactory.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" diff --git a/stable/artifactory/templates/artifactory-service.yaml b/stable/artifactory/templates/artifactory-service.yaml index ace33ffe6a..9e746fce40 100644 --- a/stable/artifactory/templates/artifactory-service.yaml +++ b/stable/artifactory/templates/artifactory-service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Values.artifactory.service.name }} + name: {{ template "artifactory.fullname" . }} labels: app: {{ template "artifactory.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version }} @@ -22,4 +22,4 @@ spec: selector: app: {{ template "artifactory.name" . }} component: "{{ .Values.artifactory.name }}" - release: {{ .Release.Name }} \ No newline at end of file + release: {{ .Release.Name }} diff --git a/stable/artifactory/templates/ingress.yaml b/stable/artifactory/templates/ingress.yaml new file mode 100644 index 0000000000..1cc014f4e6 --- /dev/null +++ b/stable/artifactory/templates/ingress.yaml @@ -0,0 +1,32 @@ +{{- if .Values.ingress.enabled -}} +{{- $serviceName := include "artifactory.fullname" . -}} +{{- $servicePort := .Values.artifactory.externalPort -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "artifactory.fullname" . }} + labels: + app: {{ template "artifactory.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + rules: + {{- range $host := .Values.ingress.hosts }} + - host: {{ $host }} + http: + paths: + - path: / + backend: + serviceName: {{ $serviceName }} + servicePort: {{ $servicePort }} + {{- end -}} + {{- if .Values.ingress.tls }} + tls: +{{ toYaml .Values.ingress.tls | indent 4 }} + {{- end -}} +{{- end -}} diff --git a/stable/artifactory/templates/nginx-deployment.yaml b/stable/artifactory/templates/nginx-deployment.yaml index 2eb3ab2927..7176192ebd 100644 --- a/stable/artifactory/templates/nginx-deployment.yaml +++ b/stable/artifactory/templates/nginx-deployment.yaml @@ -1,3 +1,4 @@ +{{- if .Values.nginx.enabled -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -44,13 +45,13 @@ spec: - '-c' - > until [ -f /etc/nginx/conf.d/artifactory.conf ]; do sleep 1; done; - sed -i -e 's,proxy_pass .*,proxy_pass {{ .Values.nginx.env.artUrl }}/;,g' \ - -e 's,server_name .*,server_name ~(?.+)\\.{{ .Values.artifactory.service.name }} {{ .Values.artifactory.service.name }};,g' \ + sed -i -e 's,proxy_pass .*,proxy_pass http://{{ template "artifactory.fullname" . }}:{{ .Values.artifactory.externalPort }}/artifactory/;,g' \ + -e 's,server_name .*,server_name ~(?.+)\\.{{ template "artifactory.fullname" . }} {{ template "artifactory.fullname" . }};,g' \ /etc/nginx/conf.d/artifactory.conf; sleep 5; nginx -s reload; touch /var/log/nginx/conf.done env: - name: ART_BASE_URL - value: "{{ .Values.nginx.env.artUrl }}" + value: "http://{{ template "artifactory.fullname" . }}:{{ .Values.artifactory.externalPort }}/artifactory" - name: SSL value: "{{ .Values.nginx.env.ssl }}" ports: @@ -69,3 +70,4 @@ spec: {{- else }} emptyDir: {} {{- end -}} +{{- end }} diff --git a/stable/artifactory/templates/nginx-pvc.yaml b/stable/artifactory/templates/nginx-pvc.yaml index 7428cb1eab..972cb840c7 100755 --- a/stable/artifactory/templates/nginx-pvc.yaml +++ b/stable/artifactory/templates/nginx-pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.nginx.persistence.enabled }} +{{- if and .Values.nginx.persistence.enabled (.Values.nginx.enabled ) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/stable/artifactory/templates/nginx-service.yaml b/stable/artifactory/templates/nginx-service.yaml index e8d04c5e62..173ed4cf6b 100644 --- a/stable/artifactory/templates/nginx-service.yaml +++ b/stable/artifactory/templates/nginx-service.yaml @@ -1,7 +1,8 @@ +{{- if .Values.nginx.enabled -}} apiVersion: v1 kind: Service metadata: - name: {{ template "artifactory.nginx.name" . }} + name: {{ template "artifactory.nginx.fullname" . }} labels: app: {{ template "artifactory.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version }} @@ -33,4 +34,5 @@ spec: selector: app: {{ template "artifactory.name" . }} component: "{{ .Values.nginx.name }}" - release: {{ .Release.Name }} \ No newline at end of file + release: {{ .Release.Name }} +{{- end }} diff --git a/stable/artifactory/templates/postgresql-deployment.yaml b/stable/artifactory/templates/postgresql-deployment.yaml deleted file mode 100644 index bb3ca2adf0..0000000000 --- a/stable/artifactory/templates/postgresql-deployment.yaml +++ /dev/null @@ -1,77 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: {{ template "artifactory.database.fullname" . }} - labels: - app: {{ template "artifactory.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - component: "{{ .Values.database.name }}" - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} -spec: - replicas: 1 - template: - metadata: - labels: - app: {{ template "artifactory.name" . }} - component: "{{ .Values.database.name }}" - release: {{ .Release.Name }} - spec: - initContainers: - - name: "remove-lost-found" - image: "{{ .Values.initContainerImage }}" - imagePullPolicy: "{{ .Values.database.image.pullPolicy }}" - command: - - 'sh' - - '-c' - - 'rm -rf {{ .Values.database.persistence.mountPath }}/lost+found' - volumeMounts: - - mountPath: {{ .Values.database.persistence.mountPath | quote }} - name: postgresql-volume - containers: - - name: {{ .Values.database.name }} - image: "{{ .Values.database.image.repository }}:{{ .Values.database.image.version }}" - imagePullPolicy: {{ .Values.database.image.pullPolicy }} - env: - - name: POSTGRES_DB - value: {{ .Values.database.env.name }} - - name: POSTGRES_USER - value: {{ .Values.database.env.user }} - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "artifactory.fullname" . }} - key: artifactory-database-password - ports: - - containerPort: {{ .Values.database.internalPort }} - volumeMounts: - - mountPath: {{ .Values.database.persistence.mountPath | quote }} - name: postgresql-volume - resources: -{{ toYaml .Values.database.resources | indent 10 }} - livenessProbe: - exec: - command: - - sh - - -c - - exec pg_isready - initialDelaySeconds: 60 - timeoutSeconds: 5 - failureThreshold: 6 - readinessProbe: - exec: - command: - - sh - - -c - - exec pg_isready - initialDelaySeconds: 30 - timeoutSeconds: 3 - periodSeconds: 5 - volumes: - - name: postgresql-volume - {{- if .Values.database.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ template "artifactory.database.fullname" . }} - {{- else }} - emptyDir: {} - {{- end -}} diff --git a/stable/artifactory/templates/postgresql-pvc.yaml b/stable/artifactory/templates/postgresql-pvc.yaml deleted file mode 100755 index 4bedb1d4c6..0000000000 --- a/stable/artifactory/templates/postgresql-pvc.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{- if .Values.database.persistence.enabled }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "artifactory.database.fullname" . }} - labels: - app: {{ template "artifactory.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - accessModes: - - {{ .Values.database.persistence.accessMode | quote }} - resources: - requests: - storage: {{ .Values.database.persistence.size | quote }} -{{- if .Values.database.persistence.storageClass }} -{{- if (eq "-" .Values.database.persistence.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.database.persistence.storageClass }}" -{{- end }} -{{- end }} -{{- end }} diff --git a/stable/artifactory/templates/postgresql-secret.yaml b/stable/artifactory/templates/postgresql-secret.yaml deleted file mode 100644 index fa5d8b5082..0000000000 --- a/stable/artifactory/templates/postgresql-secret.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - labels: - app: {{ template "artifactory.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} - name: {{ template "artifactory.fullname" . }} -type: Opaque -data: - {{- if .Values.database.env.pass }} - artifactory-database-password: {{ .Values.database.env.pass | b64enc | quote }} - {{- else }} - artifactory-database-password: {{ randAlphaNum 10 | b64enc | quote }} - {{- end }} diff --git a/stable/artifactory/templates/postgresql-service.yaml b/stable/artifactory/templates/postgresql-service.yaml deleted file mode 100644 index 78267b5fbf..0000000000 --- a/stable/artifactory/templates/postgresql-service.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "artifactory.database.name" . }} - labels: - app: {{ template "artifactory.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - component: "{{ .Values.database.name }}" - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} -{{- if .Values.database.service.annotations }} - annotations: -{{ toYaml .Values.database.service.annotations | indent 4 }} -{{- end }} -spec: - type: {{ .Values.database.service.type }} - ports: - - port: {{ .Values.database.externalPort }} - targetPort: {{ .Values.database.internalPort }} - protocol: TCP - name: {{ .Release.Name }} - selector: - app: {{ template "artifactory.name" . }} - component: "{{ .Values.database.name }}" - release: {{ .Release.Name }} \ No newline at end of file diff --git a/stable/artifactory/values.yaml b/stable/artifactory/values.yaml index 0480df00da..4d26fea128 100644 --- a/stable/artifactory/values.yaml +++ b/stable/artifactory/values.yaml @@ -10,43 +10,19 @@ initContainerImage: "alpine:3.6" # For supporting pulling from private registries imagePullSecrets: -# Database -database: - name: postgresql - env: - type: postgresql - name: artifactory - user: artifactory -# pass: artXifactory1973 - image: - repository: docker.bintray.io/postgres - version: 9.5.2 - pullPolicy: IfNotPresent - service: - type: ClusterIP - annotations: {} - externalPort: 5432 - internalPort: 5432 - persistence: - mountPath: "/var/lib/postgresql/data" - enabled: true - accessMode: ReadWriteOnce - size: 10Gi - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - resources: {} - # requests: - # memory: "512Mi" - # cpu: "100m" - # limits: - # memory: "1Gi" - # cpu: "500m" +ingress: + enabled: false + # Used to create an Ingress record. + hosts: + - artifactory.domain.example + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + tls: + # Secrets must be manually created in the namespace. + # - secretName: chart-example-tls + # hosts: + # - artifactory.domain.example # Artifactory artifactory: @@ -94,6 +70,7 @@ artifactory: # Nginx nginx: + enabled: true name: nginx replicaCount: 1 image: @@ -119,7 +96,7 @@ nginx: ssl: true persistence: mountPath: "/var/opt/jfrog/nginx" - enabled: true + enabled: false accessMode: ReadWriteOnce size: 5Gi ## nginx data Persistent Volume Storage Class @@ -137,3 +114,13 @@ nginx: # limits: # memory: "250Mi" # cpu: "500m" + +## Configuration values for the postgresql dependency +## ref: https://github.com/kubernetes/charts/blob/master/stable/postgressql/README.md +## +postgresql: + postgresUser: "artifactory" + postgresPassword: "artifactory" + postgresDatabase: "artifactory" + persistence: + enabled: true