diff --git a/stable/artifactory/Chart.yaml b/stable/artifactory/Chart.yaml index f3ddf19a66..d497799bc6 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: 7.1.3 +version: 7.1.4 appVersion: 5.10.1 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 c6ca232e01..596e091c5b 100644 --- a/stable/artifactory/README.md +++ b/stable/artifactory/README.md @@ -105,6 +105,18 @@ The following table lists the configurable parameters of the artifactory chart a | `artifactory.service.type`| Artifactory service type | `ClusterIP` | | `artifactory.externalPort` | Artifactory service external port | `8081` | | `artifactory.internalPort` | Artifactory service internal port | `8081` | +| `artifactory.livenessProbe.enabled` | would you like a livessProbed to be enabled | `true` | +| `artifactory.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 180 | +| `artifactory.livenessProbe.periodSeconds` | How often to perform the probe | 10 | +| `artifactory.livenessProbe.timeoutSeconds` | When the probe times out | 10 | +| `artifactory.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 | +| `artifactory.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 10 | +| `artifactory.readinessProbe.enabled` | would you like a readinessProbe to be enabled | `true` | +| `artifactory.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | 60 | +| `artifactory.readinessProbe.periodSeconds` | How often to perform the probe | 10 | +| `artifactory.readinessProbe.timeoutSeconds` | When the probe times out | 10 | +| `artifactory.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | 1 | +| `artifactory.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 10 | | `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` | @@ -133,6 +145,18 @@ The following table lists the configurable parameters of the artifactory chart a | `nginx.internalPortHttp` | Nginx service internal port | `80` | | `nginx.externalPortHttps` | Nginx service external port | `443` | | `nginx.internalPortHttps` | Nginx service internal port | `443` | +| `nginx.livenessProbe.enabled` | would you like a livessProbed to be enabled | `true` | +| `nginx.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 60 | +| `nginx.livenessProbe.periodSeconds` | How often to perform the probe | 10 | +| `nginx.livenessProbe.timeoutSeconds` | When the probe times out | 10 | +| `nginx.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | 10 | +| `nginx.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 1| +| `nginx.readinessProbe.enabled` | would you like a readinessProbe to be enabled | `true` | +| `nginx.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | 60 | +| `nginx.readinessProbe.periodSeconds` | How often to perform the probe | 10 | +| `nginx.readinessProbe.timeoutSeconds` | When the probe times out | 10 | +| `nginx.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | 10 | +| `nginx.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 1 | | `nginx.tlsSecretName` | SSL secret that will be used by the Nginx pod | | | `nginx.env.artUrl` | Nginx Environment variable Artifactory URL | `"http://artifactory:8081/artifactory"` | | `nginx.env.ssl` | Nginx Environment enable ssl | `true` | diff --git a/stable/artifactory/templates/artifactory-deployment.yaml b/stable/artifactory/templates/artifactory-deployment.yaml index a447474f7a..a1017559a6 100644 --- a/stable/artifactory/templates/artifactory-deployment.yaml +++ b/stable/artifactory/templates/artifactory-deployment.yaml @@ -73,19 +73,28 @@ spec: mountPath: {{ .Values.artifactory.persistence.mountPath | quote }} resources: {{ toYaml .Values.artifactory.resources | indent 10 }} + {{- if .Values.artifactory.readinessProbe.enabled }} readinessProbe: httpGet: path: '/artifactory/webapp/#/login' port: 8081 - initialDelaySeconds: 60 - periodSeconds: 10 - failureThreshold: 10 + initialDelaySeconds: {{ .Values.artifactory.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.artifactory.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.artifactory.readinessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.artifactory.readinessProbe.failureThreshold }} + successThreshold: {{ .Values.artifactory.readinessProbe.successThreshold }} + {{- end }} + {{- if .Values.artifactory.livenessProbe.enabled }} livenessProbe: httpGet: path: '/artifactory/webapp/#/login' port: 8081 - initialDelaySeconds: 180 - periodSeconds: 10 + initialDelaySeconds: {{ .Values.artifactory.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.artifactory.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.artifactory.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.artifactory.livenessProbe.failureThreshold }} + successThreshold: {{ .Values.artifactory.livenessProbe.successThreshold }} + {{- end }} volumes: - name: artifactory-volume {{- if .Values.artifactory.persistence.enabled }} diff --git a/stable/artifactory/templates/nginx-deployment.yaml b/stable/artifactory/templates/nginx-deployment.yaml index 120e0db927..37cbc94c39 100644 --- a/stable/artifactory/templates/nginx-deployment.yaml +++ b/stable/artifactory/templates/nginx-deployment.yaml @@ -22,8 +22,8 @@ spec: imagePullSecrets: - name: {{ .Values.imagePullSecrets }} {{- end }} - {{- if .Values.nginx.persistence.enabled }} initContainers: + {{- if .Values.nginx.persistence.enabled }} - name: "remove-lost-found" image: "{{ .Values.initContainerImage }}" imagePullPolicy: {{ .Values.nginx.image.pullPolicy }} @@ -35,6 +35,15 @@ spec: - mountPath: {{ .Values.nginx.persistence.mountPath | quote }} name: nginx-volume {{- end }} + - name: "wait-for-artifactory" + image: "{{ .Values.initContainerImage }}" + command: + - 'sh' + - '-c' + - > + until nc -z -w 2 {{ template "artifactory.fullname" . }} {{ .Values.artifactory.externalPort }} && echo artifactory ok; do + sleep 2; + done; containers: - name: {{ .Values.nginx.name }} image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.version }}" @@ -51,9 +60,11 @@ spec: cp -fv /tmp/ssl/* /var/opt/jfrog/nginx/ssl; fi; until [ -f /etc/nginx/conf.d/artifactory.conf ]; do sleep 1; done; + if ! grep -q 'upstream' /etc/nginx/conf.d/artifactory.conf; then 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; + fi; sleep 5; nginx -s reload; touch /var/log/nginx/conf.done env: - name: ART_BASE_URL @@ -76,6 +87,28 @@ spec: {{- end }} resources: {{ toYaml .Values.nginx.resources | indent 10 }} + {{- if .Values.nginx.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: '/artifactory/webapp/#/login' + port: 80 + initialDelaySeconds: {{ .Values.nginx.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.nginx.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.nginx.readinessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.nginx.readinessProbe.failureThreshold }} + successThreshold: {{ .Values.nginx.readinessProbe.successThreshold }} + {{- end }} + {{- if .Values.nginx.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: '/artifactory/webapp/#/login' + port: 80 + initialDelaySeconds: {{ .Values.nginx.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.nginx.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.nginx.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.nginx.livenessProbe.failureThreshold }} + successThreshold: {{ .Values.nginx.livenessProbe.successThreshold }} + {{- end }} volumes: - name: nginx-volume {{- if .Values.nginx.persistence.enabled }} diff --git a/stable/artifactory/values.yaml b/stable/artifactory/values.yaml index 2b9f5d6e05..7caead9658 100644 --- a/stable/artifactory/values.yaml +++ b/stable/artifactory/values.yaml @@ -39,6 +39,22 @@ artifactory: annotations: {} externalPort: 8081 internalPort: 8081 + ## The following settings are to configure the frequency of the liveness and readiness probes + livenessProbe: + enabled: true + initialDelaySeconds: 180 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 + + readinessProbe: + enabled: true + initialDelaySeconds: 60 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 persistence: mountPath: "/var/opt/jfrog/artifactory" enabled: true @@ -98,6 +114,23 @@ nginx: internalPortHttp: 80 externalPortHttps: 443 internalPortHttps: 443 + ## The following settings are to configure the frequency of the liveness and readiness probes + livenessProbe: + enabled: true + initialDelaySeconds: 60 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 + + readinessProbe: + enabled: true + initialDelaySeconds: 60 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 + ## The SSL secret that will be used by the Nginx pod # tlsSecretName: chart-example-tls env: