From 959504d063cfa04a1df68d1e3714a52916b048b9 Mon Sep 17 00:00:00 2001 From: Jainish Shah Date: Thu, 6 Jul 2017 07:52:22 -0700 Subject: [PATCH] Moved Artifactory to stable and updated version to 5.3.2 (#1314) * Upgraded artifactory version to 4.16.0 * changes as per suggestion * Added Stable Artifactory chart * removed Incubator Artifactory chart * Fixed port issue * Fixed path * fixed readme * Added Documentation for all variables. * Updated labels * Fixed Parameter names * Fixed Notes.txt * Updated Artifactory version to 5.4.1 * Fixed metadata * Fixed naming * Changes. * Added release name to selector * Nginx for Oss and Pro * Fixed readme * using secret for database password * renamed secret to postgresql-secret.yaml --- incubator/artifactory/README.md | 54 --------- incubator/artifactory/templates/NOTES.txt | 22 ---- incubator/artifactory/templates/_helpers.tpl | 16 --- .../artifactory/templates/deployment.yaml | 37 ------ incubator/artifactory/templates/svc.yaml | 18 --- incubator/artifactory/values.yaml | 30 ----- {incubator => stable}/artifactory/.helmignore | 0 {incubator => stable}/artifactory/Chart.yaml | 8 +- stable/artifactory/README.md | 111 ++++++++++++++++++ stable/artifactory/templates/NOTES.txt | 27 +++++ stable/artifactory/templates/_helpers.tpl | 65 ++++++++++ .../templates/artifactory-deployment.yaml | 59 ++++++++++ .../templates/artifactory-pvc.yaml | 23 ++++ .../templates/artifactory-service.yaml | 21 ++++ .../templates/nginx-deployment.yaml | 53 +++++++++ stable/artifactory/templates/nginx-pvc.yaml | 23 ++++ .../artifactory/templates/nginx-service.yaml | 25 ++++ .../templates/postgresql-deployment.yaml | 57 +++++++++ .../artifactory/templates/postgresql-pvc.yaml | 23 ++++ .../templates/postgresql-secret.yaml | 16 +++ .../templates/postgresql-service.yaml | 21 ++++ stable/artifactory/values.yaml | 74 ++++++++++++ 22 files changed, 604 insertions(+), 179 deletions(-) delete mode 100644 incubator/artifactory/README.md delete mode 100644 incubator/artifactory/templates/NOTES.txt delete mode 100644 incubator/artifactory/templates/_helpers.tpl delete mode 100644 incubator/artifactory/templates/deployment.yaml delete mode 100644 incubator/artifactory/templates/svc.yaml delete mode 100644 incubator/artifactory/values.yaml rename {incubator => stable}/artifactory/.helmignore (100%) rename {incubator => stable}/artifactory/Chart.yaml (79%) mode change 100755 => 100644 create mode 100644 stable/artifactory/README.md create mode 100644 stable/artifactory/templates/NOTES.txt create mode 100644 stable/artifactory/templates/_helpers.tpl create mode 100644 stable/artifactory/templates/artifactory-deployment.yaml create mode 100755 stable/artifactory/templates/artifactory-pvc.yaml create mode 100644 stable/artifactory/templates/artifactory-service.yaml create mode 100644 stable/artifactory/templates/nginx-deployment.yaml create mode 100755 stable/artifactory/templates/nginx-pvc.yaml create mode 100644 stable/artifactory/templates/nginx-service.yaml create mode 100644 stable/artifactory/templates/postgresql-deployment.yaml create mode 100755 stable/artifactory/templates/postgresql-pvc.yaml create mode 100644 stable/artifactory/templates/postgresql-secret.yaml create mode 100644 stable/artifactory/templates/postgresql-service.yaml create mode 100644 stable/artifactory/values.yaml diff --git a/incubator/artifactory/README.md b/incubator/artifactory/README.md deleted file mode 100644 index f0e6f8549f70..000000000000 --- a/incubator/artifactory/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# JFrog Artifactory Helm Chart - -## Prerequisites Details - -* Artifactory Pro trial license [get one from here](https://www.jfrog.com/artifactory/free-trial/) - -## Todo - -* Implement Support of Reverse proxy for Docker Repo using Nginx -* Smarter upscaling/downscaling - -## Chart Details -This chart will do the following: - -* Deploy Artifactory-oss -* Deploy Artifactory-Pro - -## Installing the Chart - -To install the chart with the release name `my-release`: - -```bash -$ helm install --name my-release incubator/artifactory -``` - -Note: By default it will run Artifactory-oss to run Artifactory-Pro uncomment image in value.yaml or use following command -```bash -$ helm install --name my-release --set image=docker.bintray.io/jfrog/artifactory-pro incubator/artifactory -``` - -## Deleting the Charts - -Deletion of the PetSet doesn't cascade to deleting associated Pods and PVCs. To delete them: - -``` - $ helm delete my-release -``` - -## Configuration - -The following tables lists the configurable parameters of the artifactory chart and their default values. - -| Parameter | Description | Default | -|---------------------------|-----------------------------------|----------------------------------------------------------| -| `Image` | Container image name | `docker.bintray.io/jfrog/artifactory-oss` | -| `ImageTag` | Container image tag | `5.2.0` | -| `ImagePullPolicy` | Container pull policy | `Always` | - -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. - - -## Useful links -https://www.jfrog.com -https://www.jfrog.com/confluence/ diff --git a/incubator/artifactory/templates/NOTES.txt b/incubator/artifactory/templates/NOTES.txt deleted file mode 100644 index 87715abc13f8..000000000000 --- a/incubator/artifactory/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -Get the Artifactory URL to visit by running these commands in the same shell: -{{- if contains "NodePort" .Values.ServiceType }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT/ - -{{- else if contains "LoadBalancer" .Values.ServiceType }} -**** NOTE: It may take a few minutes for the LoadBalancer IP to be available. **** -**** You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}' **** - export SERVICE_IP=$(kubectl get svc {{ template "fullname" . }} --namespace {{ .Release.Namespace }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.httpPort }}/ - -{{- else if contains "ClusterIP" .Values.ServiceType }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}") - echo http://127.0.0.1:{{ .Values.httpPort }} - kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME {{ .Values.httpPort }}:{{ .Values.httpPort }} - -{{- end }} - -Default credential for Artifactory: -user: admin -password: password diff --git a/incubator/artifactory/templates/_helpers.tpl b/incubator/artifactory/templates/_helpers.tpl deleted file mode 100644 index bdf219c3bd0b..000000000000 --- a/incubator/artifactory/templates/_helpers.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{define "name"}}{{default "artifactory" .Values.nameOverride | trunc 24 }}{{end}} - -{{/* -Create a default fully qualified app name. - -We truncate at 24 chars because some Kubernetes name fields are limited to this -(by the DNS naming spec). -*/}} -{{define "fullname"}} -{{- $name := default "artifactory" .Values.nameOverride -}} -{{printf "%s-%s" .Release.Name $name | trunc 24 -}} -{{end}} diff --git a/incubator/artifactory/templates/deployment.yaml b/incubator/artifactory/templates/deployment.yaml deleted file mode 100644 index 7513a7f02c46..000000000000 --- a/incubator/artifactory/templates/deployment.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: {{template "fullname" .}} - labels: - app: {{ template "fullname" . }} - heritage: "{{ .Release.Service }}" - release: "{{ .Release.Name }}" - chart: "{{.Chart.Name}}-{{.Chart.Version}}" -spec: - replicas: {{default 1 .Values.replicaCount}} - template: - metadata: - labels: - app: {{template "fullname" .}} - release: {{.Release.Name | quote }} - spec: - containers: - - name: {{ template "fullname" . }} - image: "{{ .Values.image}}:{{ .Values.imageTag}}" - imagePullPolicy: {{default "IfNotPresent" .Values.ImagePullPolicy}} - resources: -{{ toYaml .Values.resources | indent 10 }} - ports: - - containerPort: 8081 - name: http - volumeMounts: - - name: etc - mountPath: /var/opt/jfrog/artifactory/etc - - name: logs - mountPath: /var/opt/jfrog/artifactory/logs - - name: data - mountPath: /var/opt/jfrog/artifactory/data - volumes: - - name: data - - name: logs - - name: etc \ No newline at end of file diff --git a/incubator/artifactory/templates/svc.yaml b/incubator/artifactory/templates/svc.yaml deleted file mode 100644 index b211ebb5ccc9..000000000000 --- a/incubator/artifactory/templates/svc.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{template "fullname" .}} - labels: - heritage: {{ .Release.Service | quote }} - release: {{ .Release.Name | quote }} - chart: "{{.Chart.Name}}-{{.Chart.Version}}" - app: {{template "fullname" .}} -spec: - ports: - - port: {{default 8081 .Values.httpPort}} - targetPort: 8081 - protocol: TCP - name: http - selector: - app: {{template "fullname" .}} - type: {{.Values.ServiceType}} \ No newline at end of file diff --git a/incubator/artifactory/values.yaml b/incubator/artifactory/values.yaml deleted file mode 100644 index 9fe4e54d353b..000000000000 --- a/incubator/artifactory/values.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# Default values for Artifactory. -# This is a YAML-formatted file. -# Declare name/value pairs to be passed into your templates. -# name: value - -Name: artifactory -Component: "Artifactory" - -## Uncomment following line if you want to run Artifactory-Pro -#image: "docker.bintray.io/jfrog/artifactory-pro" -image: "docker.bintray.io/jfrog/artifactory-oss" -imageTag: "5.2.0" -imagePullPolicy: "Always" -replicaCount: 1 -httpPort: 8081 -## Kubernetes configuration -## For minikube, set this to NodePort, elsewhere use LoadBalancer -## -ServiceType: ClusterIP -resources: - requests: - memory: 2048Mi - cpu: 200m - -## Persist data to a persitent volume -persistence: - enabled: true - storageClass: generic - accessMode: ReadWriteOnce - size: 8Gi diff --git a/incubator/artifactory/.helmignore b/stable/artifactory/.helmignore similarity index 100% rename from incubator/artifactory/.helmignore rename to stable/artifactory/.helmignore diff --git a/incubator/artifactory/Chart.yaml b/stable/artifactory/Chart.yaml old mode 100755 new mode 100644 similarity index 79% rename from incubator/artifactory/Chart.yaml rename to stable/artifactory/Chart.yaml index 9b04b708a751..ffe43f474fba --- a/incubator/artifactory/Chart.yaml +++ b/stable/artifactory/Chart.yaml @@ -1,6 +1,8 @@ +apiVersion: v1 name: artifactory home: https://www.jfrog.com/artifactory/ -version: 5.2.0 +version: 5.4.1 +appVersion: 5.4.1 description: Universal Repository Manager supporting all major packaging formats, build tools and CI servers. keywords: - artifactory @@ -9,6 +11,8 @@ sources: - https://bintray.com/jfrog/product/JFrog-Artifactory-Pro/view - https://github.com/JFrogDev maintainers: - - name: Jainish shah + - name: jainishshah17 email: jainishs@jfrog.com + - name: eldada + email: eldada@jfrog.com icon: https://raw.githubusercontent.com/JFrogDev/artifactory-dcos/master/images/jfrog_med.png diff --git a/stable/artifactory/README.md b/stable/artifactory/README.md new file mode 100644 index 000000000000..d4f1baef5bb9 --- /dev/null +++ b/stable/artifactory/README.md @@ -0,0 +1,111 @@ +# JFrog Artifactory Helm Chart + +## Prerequisites Details + +* Artifactory Pro trial license [get one from here](https://www.jfrog.com/artifactory/free-trial/) + +## Chart Details +This chart will do the following: + +* Deploy Artifactory-Oss +* Deploy Artifactory-Pro + +## Installing the Chart + +To install the chart with the release name `artifactory`: + +```bash +$ helm install --name artifactory stable/artifactory +``` + +### Deploying Artifactory OSS +By default it will run Artifactory-Pro to run Artifactory-Oss use following command: +```bash +$ helm install --name artifactory --set artifactory.image.repository=docker.bintray.io/jfrog/artifactory-oss stable/artifactory +``` + +### Accessing Artifactory +**NOTE:** It might take a few minutes for Artifactory's public IP to become available. +Follow the instructions outputted by the install command to get the Artifactory IP to access it. + +### Updating Artifactory +Once you have a new chart version, you can update your deployment with +```bash +$ helm upgrade artifactory --namespace artifactory stable/artifactory +``` + +This will apply any configuration changes on your existing deployment. + +### 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 +``` + +You can customise other parameters in the same way, by passing them on `helm install` command line. + +### Deleting Artifactory +```bash +$ helm delete --purge artifactory +``` + +This will completely delete your Artifactory Pro deployment. +**IMPORTANT:** This will also delete your data volumes. You will loose all data! + +## Configuration + +The following tables lists the configurable parameters of the artifactory chart and their default values. + +| Parameter | Description | Default | +|---------------------------|-----------------------------------|----------------------------------------------------------| +| `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 | `artXifactory1973` | +| `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` | +| `artifactory.name` | Artifactory name | `artifactory` | +| `artifactory.replicaCount` | Replica count for Artifactory deployment| `1` | +| `artifactory.image.pullPolicy` | Container pull policy | `IfNotPresent` | +| `artifactory.image.repository` | Container image | `docker.bintray.io/jfrog/artifactory-pro` | +| `artifactory.image.version` | Container image tag | `5.4.1` | +| `artifactory.service.type`| Artifactory service type | `ClusterIP` | +| `artifactory.externalPort` | Artifactory service external port | `8081` | +| `artifactory.internalPort` | Artifactory service internal port | `8081` | +| `artifactory.persistence.mountPath` | Artifactory persistence volume mount path | `"/var/opt/jfrog/artifactory"` | +| `artifactory.persistence.enabled` | Artifactory persistence volume enabled | `true` | +| `artifactory.persistence.accessMode` | Artifactory persistence volume access mode | `ReadWriteOnce` | +| `artifactory.persistence.size` | Artifactory persistence volume size | `20Gi` | +| `nginx.name` | Nginx name | `nginx` | +| `nginx.replicaCount` | Nginx replica count | `1` | +| `nginx.image.repository` | Container image | `docker.bintray.io/jfrog/nginx-artifactory-pro` | +| `nginx.image.pullPolicy` | Container pull policy | `IfNotPresent` | +| `nginx.image.version` | Container image tag | `5.4.1` | +| `nginx.service.type`| Nginx service type | `LoadBalancer` | +| `nginx.externalPortHttp` | Nginx service external port | `80` | +| `nginx.internalPortHttp` | Nginx service internal port | `80` | +| `nginx.externalPortHttps` | Nginx service external port | `443` | +| `nginx.internalPortHttps` | Nginx service internal port | `443` | +| `nginx.env.artUrl` | Nginx Environment variable Artifactory URL | `"http://artifactory:8081/artifactory"` | +| `nginx.env.ssl` | Nginx Environment enable ssl | `true` | +| `nginx.persistence.mountPath` | Nginx persistence volume mount path | `"/var/opt/jfrog/nginx"` | +| `nginx.persistence.enabled` | Nginx persistence volume enabled | `true` | +| `nginx.persistence.accessMode` | Nginx persistence volume access mode | `ReadWriteOnce` | +| `nginx.persistence.size` | Nginx persistence volume size | `5Gi` | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + + +## Useful links +https://www.jfrog.com +https://www.jfrog.com/confluence/ diff --git a/stable/artifactory/templates/NOTES.txt b/stable/artifactory/templates/NOTES.txt new file mode 100644 index 000000000000..d744ea9a4449 --- /dev/null +++ b/stable/artifactory/templates/NOTES.txt @@ -0,0 +1,27 @@ +Congratulations. You have just deployed JFrog Artifactory Pro! + +1. Get the Artifactory URL by running these commands: + + {{- if contains "NodePort" .Values.nginx.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "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/ + + {{- else if contains "LoadBalancer" .Values.nginx.service.type }} + + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of the service by running 'kubectl get svc -w {{ template "nginx.name" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "nginx.name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP/ + + {{- else if contains "ClusterIP" .Values.nginx.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "component={{ .Values.nginx.name }}" -o jsonpath="{.items[0].metadata.name}") + echo http://127.0.0.1:{{ .Values.nginx.externalPortHttp }} + kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME {{ .Values.nginx.externalPortHttp }}:{{ .Values.nginx.internalPortHttp }} + + {{- end }} + +2. Open Artifactory in your browser + Default credential for Artifactory: + user: admin + password: password diff --git a/stable/artifactory/templates/_helpers.tpl b/stable/artifactory/templates/_helpers.tpl new file mode 100644 index 000000000000..fc351b14fe5b --- /dev/null +++ b/stable/artifactory/templates/_helpers.tpl @@ -0,0 +1,65 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Expand the name artifactory service. +*/}} +{{- define "artifactory.name" -}} +{{- default .Values.artifactory.name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Expand the name database service. +*/}} +{{- define "database.name" -}} +{{- default .Values.database.name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Expand the name nginx service. +*/}} +{{- define "nginx.name" -}} +{{- default .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). +*/}} +{{- define "fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- 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.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 "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). +*/}} +{{- define "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 diff --git a/stable/artifactory/templates/artifactory-deployment.yaml b/stable/artifactory/templates/artifactory-deployment.yaml new file mode 100644 index 000000000000..6a3c71622c37 --- /dev/null +++ b/stable/artifactory/templates/artifactory-deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "artifactory.fullname" . }} + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.artifactory.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +spec: + replicas: {{ .Values.artReplicaCount }} + template: + metadata: + labels: + app: {{ template "name" . }} + component: "{{ .Values.artifactory.name }}" + release: {{ .Release.Name }} + annotations: + pod.beta.kubernetes.io/init-containers: '[{ + "name": "remove-lost-found", + "image": {{ .Values.initContainerImage | quote }}, + "command": ["rm", "-rf", "{{ .Values.artifactory.persistence.mountPath }}/lost+found"], + "volumeMounts": [{ + "name": "artifactory-volume", + "mountPath": {{ .Values.artifactory.persistence.mountPath | quote }} + }], + "imagePullPolicy": {{ .Values.artifactory.image.pullPolicy | quote }} + }]' + spec: + 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 }} + - name: DB_USER + value: {{ .Values.database.env.user }} + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "fullname" . }} + key: artifactory-database-password + - name: DB_HOST + value: {{ template "database.name" . }} + ports: + - containerPort: {{ .Values.artifactory.internalPort }} + volumeMounts: + - mountPath: {{ .Values.artifactory.persistence.mountPath | quote }} + name: artifactory-volume + volumes: + - name: artifactory-volume + {{- if .Values.artifactory.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ template "artifactory.fullname" . }} + {{- else }} + emptyDir: {} + {{- end -}} \ No newline at end of file diff --git a/stable/artifactory/templates/artifactory-pvc.yaml b/stable/artifactory/templates/artifactory-pvc.yaml new file mode 100755 index 000000000000..0b475eeadd04 --- /dev/null +++ b/stable/artifactory/templates/artifactory-pvc.yaml @@ -0,0 +1,23 @@ +{{- if .Values.artifactory.persistence.enabled }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "artifactory.fullname" . }} + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + annotations: + {{- if .Values.artifactory.persistence.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.artifactory.persistence.storageClass | quote }} + {{- else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} +spec: + accessModes: + - {{ .Values.artifactory.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.artifactory.persistence.size | quote }} +{{- end }} \ No newline at end of file diff --git a/stable/artifactory/templates/artifactory-service.yaml b/stable/artifactory/templates/artifactory-service.yaml new file mode 100644 index 000000000000..f925b8819d81 --- /dev/null +++ b/stable/artifactory/templates/artifactory-service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "artifactory.name" . }} + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.artifactory.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +spec: + type: {{ .Values.artifactory.service.type }} + ports: + - port: {{ .Values.artifactory.externalPort }} + targetPort: {{ .Values.artifactory.internalPort }} + protocol: TCP + name: {{ .Release.Name }} + selector: + app: {{ template "name" . }} + component: "{{ .Values.artifactory.name }}" + release: {{ .Release.Name }} \ No newline at end of file diff --git a/stable/artifactory/templates/nginx-deployment.yaml b/stable/artifactory/templates/nginx-deployment.yaml new file mode 100644 index 000000000000..df05aa488c4a --- /dev/null +++ b/stable/artifactory/templates/nginx-deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "nginx.fullname" . }} + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.nginx.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +spec: + replicas: {{ .Values.nginx.replicaCount }} + template: + metadata: + labels: + app: {{ template "name" . }} + component: "{{ .Values.nginx.name }}" + release: {{ .Release.Name }} + annotations: + pod.beta.kubernetes.io/init-containers: '[{ + "name": "remove-lost-found", + "image": {{ .Values.initContainerImage | quote }}, + "command": ["rm", "-rf", "{{ .Values.nginx.persistence.mountPath }}/lost+found"], + "volumeMounts": [{ + "name": "nginx-volume", + "mountPath": {{ .Values.nginx.persistence.mountPath | quote }} + }], + "imagePullPolicy": {{ .Values.nginx.image.pullPolicy | quote }} + }]' + spec: + containers: + - name: {{ .Values.nginx.name }} + image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.version }}" + imagePullPolicy: {{ .Values.nginx.image.pullPolicy }} + env: + - name: ART_BASE_URL + value: {{ .Values.nginx.env.artUrl }} + - name: SSL + value: "{{ .Values.nginx.env.ssl }}" + ports: + - containerPort: {{ .Values.nginx.internalPortHttp }} + - containerPort: {{ .Values.nginx.internalPortHttps }} + volumeMounts: + - mountPath: {{ .Values.nginx.persistence.mountPath | quote }} + name: nginx-volume + volumes: + - name: nginx-volume + {{- if .Values.nginx.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ template "nginx.fullname" . }} + {{- else }} + emptyDir: {} + {{- end -}} \ No newline at end of file diff --git a/stable/artifactory/templates/nginx-pvc.yaml b/stable/artifactory/templates/nginx-pvc.yaml new file mode 100755 index 000000000000..7c499120ffc1 --- /dev/null +++ b/stable/artifactory/templates/nginx-pvc.yaml @@ -0,0 +1,23 @@ +{{- if .Values.nginx.persistence.enabled }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "nginx.fullname" . }} + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + annotations: + {{- if .Values.nginx.persistence.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.nginx.persistence.storageClass | quote }} + {{- else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} +spec: + accessModes: + - {{ .Values.nginx.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.nginx.persistence.size | quote }} +{{- end }} \ No newline at end of file diff --git a/stable/artifactory/templates/nginx-service.yaml b/stable/artifactory/templates/nginx-service.yaml new file mode 100644 index 000000000000..a550c15fba8f --- /dev/null +++ b/stable/artifactory/templates/nginx-service.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "nginx.name" . }} + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.nginx.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +spec: + type: {{ .Values.nginx.service.type }} + ports: + - port: {{ .Values.nginx.externalPortHttp }} + targetPort: {{ .Values.nginx.internalPortHttp }} + protocol: TCP + name: {{ .Values.nginx.name }}http + - port: {{ .Values.nginx.externalPortHttps }} + targetPort: {{ .Values.nginx.internalPortHttps }} + protocol: TCP + name: {{ .Release.Name }}https + selector: + app: {{ template "name" . }} + component: "{{ .Values.nginx.name }}" + release: {{ .Release.Name }} \ No newline at end of file diff --git a/stable/artifactory/templates/postgresql-deployment.yaml b/stable/artifactory/templates/postgresql-deployment.yaml new file mode 100644 index 000000000000..029f3b65d5bf --- /dev/null +++ b/stable/artifactory/templates/postgresql-deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "database.fullname" . }} + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.database.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ template "name" . }} + component: "{{ .Values.database.name }}" + release: {{ .Release.Name }} + annotations: + pod.beta.kubernetes.io/init-containers: '[{ + "name": "remove-lost-found", + "image": {{ .Values.initContainerImage | quote }}, + "command": ["rm", "-rf", "{{ .Values.database.persistence.mountPath }}/lost+found"], + "volumeMounts": [{ + "name": "postgresql-volume", + "mountPath": {{ .Values.database.persistence.mountPath | quote }} + }], + "imagePullPolicy": {{ .Values.database.image.pullPolicy | quote }} + }]' + spec: + 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 "fullname" . }} + key: artifactory-database-password + ports: + - containerPort: {{ .Values.database.internalPort }} + volumeMounts: + - mountPath: {{ .Values.database.persistence.mountPath | quote }} + name: postgresql-volume + volumes: + - name: postgresql-volume + {{- if .Values.database.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ template "database.fullname" . }} + {{- else }} + emptyDir: {} + {{- end -}} \ No newline at end of file diff --git a/stable/artifactory/templates/postgresql-pvc.yaml b/stable/artifactory/templates/postgresql-pvc.yaml new file mode 100755 index 000000000000..2fc90cc7c337 --- /dev/null +++ b/stable/artifactory/templates/postgresql-pvc.yaml @@ -0,0 +1,23 @@ +{{- if .Values.database.persistence.enabled }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "database.fullname" . }} + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + annotations: + {{- if .Values.database.persistence.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.database.persistence.storageClass | quote }} + {{- else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} +spec: + accessModes: + - {{ .Values.database.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.database.persistence.size | quote }} +{{- end }} diff --git a/stable/artifactory/templates/postgresql-secret.yaml b/stable/artifactory/templates/postgresql-secret.yaml new file mode 100644 index 000000000000..3bd612f0b839 --- /dev/null +++ b/stable/artifactory/templates/postgresql-secret.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Secret +metadata: + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "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 new file mode 100644 index 000000000000..b29695521d10 --- /dev/null +++ b/stable/artifactory/templates/postgresql-service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "database.name" . }} + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.database.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +spec: + type: {{ .Values.database.service.type }} + ports: + - port: {{ .Values.database.externalPort }} + targetPort: {{ .Values.database.internalPort }} + protocol: TCP + name: {{ .Release.Name }} + selector: + app: {{ template "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 new file mode 100644 index 000000000000..00ff26bf9772 --- /dev/null +++ b/stable/artifactory/values.yaml @@ -0,0 +1,74 @@ +# Default values for artifactory. +# This is a YAML-formatted file. + +# Beware when changing values here. You should know what you are doing! +# Access the values with {{ .Values.key.subkey }} + +# Common +initContainerImage: "busybox:1.26.2" + +# Database +database: + name: postgresql + replicaCount: 1 + env: + type: postgresql + name: artifactory + user: artifactory +# pass: artXifactory1973 + image: + repository: docker.bintray.io/postgres + version: 9.5.2 + pullPolicy: IfNotPresent + service: + type: ClusterIP + externalPort: 5432 + internalPort: 5432 + persistence: + mountPath: "/var/lib/postgresql/data" + enabled: true + accessMode: ReadWriteOnce + size: 10Gi + +# Artifactory +artifactory: + name: artifactory + replicaCount: 1 + image: + #repository: "docker.bintray.io/jfrog/artifactory-oss" + repository: "docker.bintray.io/jfrog/artifactory-pro" + version: 5.4.2 + pullPolicy: IfNotPresent + service: + type: ClusterIP + externalPort: 8081 + internalPort: 8081 + persistence: + mountPath: "/var/opt/jfrog/artifactory" + enabled: true + accessMode: ReadWriteOnce + size: 20Gi + +# Nginx +nginx: + name: nginx + replicaCount: 1 + image: + repository: "docker.bintray.io/jfrog/nginx-artifactory-pro" + version: 5.4.2 + pullPolicy: IfNotPresent + service: + ## For minikube, set this to NodePort, elsewhere use LoadBalancer + type: LoadBalancer + externalPortHttp: 80 + internalPortHttp: 80 + externalPortHttps: 443 + internalPortHttps: 443 + env: + artUrl: "http://artifactory:8081/artifactory" + ssl: true + persistence: + mountPath: "/var/opt/jfrog/nginx" + enabled: true + accessMode: ReadWriteOnce + size: 5Gi \ No newline at end of file