Skip to content

Commit

Permalink
ingress annotation changes specifially to support docker registry
Browse files Browse the repository at this point in the history
  • Loading branch information
zendril committed Oct 18, 2018
1 parent b385285 commit aef35eb
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
26 changes: 26 additions & 0 deletions stable/artifactory-ha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ The following table lists the configurable parameters of the artifactory chart a
| `ingress.hosts` | Artifactory Ingress hostnames | `[]` |
| `ingress.tls` | Artifactory Ingress TLS configuration (YAML) | `[]` |
| `ingress.defaultBackend.enabled` | If true, the default `backend` will be added using serviceName and servicePort | `true` |
| `ingress.annotations` | Ingress annotations, which are written out if annotations section exists in values. Everything inside of the annotations section will appear verbatim inside the resulting manifest. See `Ingress annotations` section below for examples of how to leverage the annotations, specifically for how to enable docker authentication. | |
| `nginx.enabled` | Deploy nginx server | `true` |
| `nginx.name` | Nginx name | `nginx` |
| `nginx.replicaCount` | Nginx replica count | `1` |
Expand Down Expand Up @@ -495,6 +496,31 @@ Include the secret's name, along with the desired hostnames, in the Artifactory
- artifactory.domain.com
```

### Ingress annotations

The following is helpful for configuring ingress to expose docker login.

```
ingress:
enabled: true
defaultBackend:
enabled: false
hosts:
- myhost.example.com
annotations:
ingress.kubernetes.io/force-ssl-redirect: "true"
ingress.kubernetes.io/proxy-body-size: "0"
ingress.kubernetes.io/proxy-read-timeout: "600"
ingress.kubernetes.io/proxy-send-timeout: "600"
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/(v2)/token /artifactory/api/docker/null/v2/token;
rewrite ^/(v2)/([^\/]*)/(.*) /artifactory/api/docker/$2/$1/$3;
nginx.ingress.kubernetes.io/proxy-body-size: "0"
tls:
- hosts:
- "myhost.example.com"
```

## Useful links
- https://www.jfrog.com/confluence/display/EP/Getting+Started
Expand Down
6 changes: 3 additions & 3 deletions stable/artifactory-ha/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ metadata:
chart: {{ template "artifactory-ha.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.ingress.annotations }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{ .Values.ingress.annotations | toYaml | trimSuffix "\n" | indent 4 -}}
{{- end }}
spec:
{{- if .Values.ingress.defaultBackend.enabled }}
backend:
Expand Down
27 changes: 27 additions & 0 deletions stable/artifactory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ The following table lists the configurable parameters of the artifactory chart a
| `ingress.hosts` | Artifactory Ingress hostnames | `[]` |
| `ingress.tls` | Artifactory Ingress TLS configuration (YAML) | `[]` |
| `ingress.defaultBackend.enabled` | If true, the default `backend` will be added using serviceName and servicePort | `true` |
| `ingress.annotations` | Ingress annotations, which are written out if annotations section exists in values. Everything inside of the annotations section will appear verbatim inside the resulting manifest. See `Ingress annotations` section below for examples of how to leverage the annotations, specifically for how to enable docker authentication. | |
| `nginx.name` | Nginx name | `nginx` |
| `nginx.enabled` | Deploy nginx server | `true` |
| `nginx.replicaCount` | Nginx replica count | `1` |
Expand Down Expand Up @@ -338,6 +339,32 @@ Include the secret's name, along with the desired hostnames, in the Artifactory
- artifactory.domain.com
```

### Ingress annotations

The following is helpful for configuring ingress to expose docker login.

```
ingress:
enabled: true
defaultBackend:
enabled: false
hosts:
- myhost.example.com
annotations:
ingress.kubernetes.io/force-ssl-redirect: "true"
ingress.kubernetes.io/proxy-body-size: "0"
ingress.kubernetes.io/proxy-read-timeout: "600"
ingress.kubernetes.io/proxy-send-timeout: "600"
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/(v2)/token /artifactory/api/docker/null/v2/token;
rewrite ^/(v2)/([^\/]*)/(.*) /artifactory/api/docker/$2/$1/$3;
nginx.ingress.kubernetes.io/proxy-body-size: "0"
tls:
- hosts:
- "myhost.example.com"
```

## Useful links
https://www.jfrog.com
https://www.jfrog.com/confluence/
6 changes: 3 additions & 3 deletions stable/artifactory/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ metadata:
chart: {{ template "artifactory.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.ingress.annotations }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{ .Values.ingress.annotations | toYaml | trimSuffix "\n" | indent 4 -}}
{{- end }}
spec:
{{- if .Values.ingress.defaultBackend.enabled }}
backend:
Expand Down

0 comments on commit aef35eb

Please sign in to comment.