Skip to content

Commit

Permalink
Merge pull request #354 from Kong/next
Browse files Browse the repository at this point in the history
[kong] release 2.1.0
  • Loading branch information
Travis Raines authored Apr 27, 2021
2 parents e4089d5 + d0741b8 commit bd8e860
Show file tree
Hide file tree
Showing 18 changed files with 166 additions and 23 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

jobs:
lint-test:
env:
COMMON_CT_ARGS: "--chart-repos bitnami=https://charts.bitnami.com/bitnami --remote origin --target-branch main"
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -35,14 +37,14 @@ jobs:
fi
- name: Run chart-testing (lint)
run: ct lint --chart-repos bitnami=https://charts.bitnami.com/bitnami --remote origin
run: ct lint $COMMON_CT_ARGS

- name: Create kind cluster
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
run: ct install
run: ct install $COMMON_CT_ARGS
release:
needs: lint-test
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/non-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:

jobs:
lint-test:
env:
COMMON_CT_ARGS: "--chart-repos bitnami=https://charts.bitnami.com/bitnami --remote origin --target-branch next"
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -39,11 +41,11 @@ jobs:
fi
- name: Run chart-testing (lint)
run: ct lint --chart-repos bitnami=https://charts.bitnami.com/bitnami --check-version-increment false --remote origin
run: ct lint $COMMON_CT_ARGS --check-version-increment=false

- name: Create kind cluster
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
run: ct install
run: ct install $COMMON_CT_ARGS
21 changes: 21 additions & 0 deletions charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 2.1.0

### Improvements

* Added support for user-defined volumes, volume mounts, and init containers.
([#317](https://github.com/Kong/charts/pull/317))
* Tolerations are now applied to migration Job Pods also.
([#341](https://github.com/Kong/charts/pull/341))
* Added support for using a DaemonSet instead of Deployment.
([#347](https://github.com/Kong/charts/pull/347))
* Updated default image versions and completed migration off Bintray
repositories.
([#349](https://github.com/Kong/charts/pull/349))
* PDB ignores migration Job Pods.
([#352](https://github.com/Kong/charts/pull/352))

### Documentation

* Clarified service monitor usage information.
([#345](https://github.com/Kong/charts/pull/345))

## 2.0.0

### Breaking changes
Expand Down
4 changes: 2 additions & 2 deletions charts/kong/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ maintainers:
email: [email protected]
name: kong
sources:
version: 2.0.0
appVersion: 2.3
version: 2.1.0
appVersion: "2.4"
33 changes: 30 additions & 3 deletions charts/kong/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ $ helm install kong/kong --generate-name
- [Standalone controller nodes](#standalone-controller-nodes)
- [Hybrid mode](#hybrid-mode)
- [CRD management](#crd-management)
- [InitContainers](#initContainers)
- [Sidecar containers](#sidecar-containers)
- [User Defined Volumes](#user-defined-volumes)
- [User Defined Volume Mounts](#user-defined-volume-mounts)
- [Using a DaemonSet](#using-a-daemonset)
- [Example configurations](#example-configurations)
- [Configuration](#configuration)
- [Kong Parameters](#kong-parameters)
Expand Down Expand Up @@ -426,6 +430,10 @@ you do (your resources will have a `meta.helm.sh/release-name` annotation), we
_strongly_ recommend that you back up all associated custom resources in the
event you need to recover from unintended CRD deletion.

### InitContainers

The chart able to deploy initcontainers along with Kong. This can be very useful when require to setup additional custom initialization. The `deployment.initcontainers` field in values.yaml takes an array of objects that get appended as-is to the existing `spec.template.initContainers` array in the kong deployment resource.

### Sidecar Containers

The chart can deploy additional containers along with the Kong and Ingress
Expand All @@ -435,6 +443,21 @@ be useful to include network proxies or logging services along with Kong. The
that get appended as-is to the existing `spec.template.spec.containers` array
in the Kong deployment resource.

### User Defined Volumes

The chart can deploy additional volumes along with Kong. This can be useful to include additional volumes which required during iniatilization phase (InitContainer). The `deployment.userDefinedVolumes` field in values.yaml takes an array of objects that get appended as-is to the existing `spec.template.spec.volumes` array in the kong deployment resource.

### User Defined Volume Mounts

The chart can mount the volumes which defined in the `user defined volume` or others. The `deployment.userDefinedVolumeMounts` field in values.yaml takes an array of object that get appended as-is to the existing `spec.template.spec.containers[].volumeMounts` and `spec.template.spec.initContainers[].volumeMounts` array in the kong deployment resource.

### Using a DaemonSet

Setting `deployment.daemonset: true` deploys Kong using a [DaemonSet
controller](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/)
instead of a Deployment controller. This runs a Kong Pod on every kubelet in
the Kubernetes cluster.

### Example configurations

Several example values.yaml are available in the
Expand All @@ -448,7 +471,7 @@ directory.
| Parameter | Description | Default |
| ---------------------------------- | ------------------------------------------------------------------------------------- | ------------------- |
| image.repository | Kong image | `kong` |
| image.tag | Kong image version | `2.0` |
| image.tag | Kong image version | `2.4` |
| image.pullPolicy | Image pull policy | `IfNotPresent` |
| image.pullSecrets | Image pull secrets | `null` |
| replicaCount | Kong instance count. It has no effect when `autoscaling.enabled` is set to true | `1` |
Expand Down Expand Up @@ -547,8 +570,8 @@ section of `values.yaml` file:
| Parameter | Description | Default |
| ---------------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| enabled | Deploy the ingress controller, rbac and crd | true |
| image.repository | Docker image with the ingress controller | kong-docker-kubernetes-ingress-controller.bintray.io/kong-ingress-controller |
| image.tag | Version of the ingress controller | 0.9.1 |
| image.repository | Docker image with the ingress controller | kong/kubernetes-ingress-controller |
| image.tag | Version of the ingress controller | 1.2.0 |
| readinessProbe | Kong ingress controllers readiness probe | |
| livenessProbe | Kong ingress controllers liveness probe | |
| installCRDs | Creates managed CRDs. | false
Expand All @@ -572,6 +595,10 @@ For a complete list of all configuration values you can set in the
| ---------------------------------- | ------------------------------------------------------------------------------------- | ------------------- |
| namespace | Namespace to deploy chart resources | |
| deployment.kong.enabled | Enable or disable deploying Kong | `true` |
| deployment.initContainers | Create initContainers. Please go to Kubernetes doc for the spec of the initContainers | |
| deployment.daemonset | Use a DaemonSet instead of a Deployment | `false` |
| deployment.userDefinedVolumes | Create volumes. Please go to Kubernetes doc for the spec of the volumes | |
| deployment.userDefinedVolumeMounts | Create volumeMounts. Please go to Kubernetes doc for the spec of the volumeMounts | |
| autoscaling.enabled | Set this to `true` to enable autoscaling | `false` |
| autoscaling.minReplicas | Set minimum number of replicas | `2` |
| autoscaling.maxReplicas | Set maximum number of replicas | `5` |
Expand Down
14 changes: 14 additions & 0 deletions charts/kong/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ upgrading from a previous version.
## Table of contents

- [Upgrade considerations for all versions](#upgrade-considerations-for-all-versions)
- [2.1.0](#210)
- [2.0.0](#200)
- [1.14.0](#1140)
- [1.11.0](#1110)
Expand Down Expand Up @@ -57,6 +58,19 @@ text ending with `field is immutable`. This is typically due to a bug with the
If you encounter this error, deleting any existing `init-migrations` jobs will
clear it.

## 2.1.0

### Migration off Bintray

Bintray, the Docker registry previously used for several images used by this
chart, is [sunsetting May 1,
2021](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/).

The chart default `values.yaml` now uses the new Docker Hub repositories for all
affected images. You should check your release `values.yaml` files to confirm that
they do not still reference Bintray repositories. If they do, update them to
use the Docker Hub repositories now in the default `values.yaml`.

## 2.0.0

### Support for Helm 2 dropped
Expand Down
4 changes: 2 additions & 2 deletions charts/kong/ci/single-image-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# use single image strings instead of repository/tag

image:
unifiedRepoTag: kong:2.3
unifiedRepoTag: kong:2.4
proxy:
type: NodePort

Expand All @@ -12,5 +12,5 @@ ingressController:
env:
anonymous_reports: "false"
image:
unifiedRepoTag: kong-docker-kubernetes-ingress-controller.bintray.io/kong-ingress-controller:1.1.1
unifiedRepoTag: kong/kubernetes-ingress-controller:1.2.0
installCRDs: false
21 changes: 21 additions & 0 deletions charts/kong/ci/test3-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,24 @@ dblessConfig:
message: "dbless-config"
proxy:
type: NodePort
deployment:
initContainers:
- name: "bash"
image: "bash:latest"
command: ["/bin/sh", "-c", "true"]
resources:
limits:
cpu: "100m"
memory: "64Mi"
requests:
cpu: "100m"
memory: "64Mi"
volumeMounts:
- name: "tmpdir"
mountPath: "/opt/tmp"
userDefinedVolumes:
- name: "tmpdir"
emptyDir: {}
userDefinedVolumeMounts:
- name: "tmpdir"
mountPath: "/opt/tmp"
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# the Portal and Portal API.

image:
repository: kong-docker-kong-gateway-docker.bintray.io/kong-enterprise-edition
tag: "2.3.2.0-alpine"
repository: kong/kong-gateway
tag: "2.3.3.2-alpine"

env:
prefix: /kong_prefix/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# kubectl port-forward deploy/your-deployment-kong 8001:8001 8002:8002

image:
repository: kong-docker-kong-gateway-docker.bintray.io/kong-enterprise-edition
tag: "2.3.2.0-alpine"
repository: kong/kong-gateway
tag: "2.3.3.2-alpine"

admin:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Secrets. These Secrets must be created before installation.

image:
repository: kong-docker-kong-gateway-docker.bintray.io/kong-enterprise-edition
tag: "2.3.2.0-alpine"
repository: kong/kong-gateway
tag: "2.3.3.2-alpine"

enterprise:
enabled: true
Expand Down
13 changes: 13 additions & 0 deletions charts/kong/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,12 @@ The name of the service used for the ingress controller's validation webhook
{{- end -}}
{{- define "kong.userDefinedVolumes" -}}
{{- if .Values.deployment.userDefinedVolumes }}
{{- toYaml .Values.deployment.userDefinedVolumes }}
{{- end }}
{{- end -}}
{{- define "kong.volumes" -}}
- name: {{ template "kong.fullname" . }}-prefix-dir
emptyDir: {}
Expand Down Expand Up @@ -417,6 +423,12 @@ The name of the service used for the ingress controller's validation webhook
{{- end }}
{{- end -}}
{{- define "kong.userDefinedVolumeMounts" -}}
{{- if .Values.deployment.userDefinedVolumeMounts }}
{{- toYaml .Values.deployment.userDefinedVolumeMounts }}
{{- end }}
{{- end -}}
{{- define "kong.volumeMounts" -}}
- name: {{ template "kong.fullname" . }}-prefix-dir
mountPath: /kong_prefix/
Expand Down Expand Up @@ -495,6 +507,7 @@ The name of the service used for the ingress controller's validation webhook
command: [ "/bin/sh", "-c", "until kong start; do echo 'waiting for db'; sleep 1; done; kong stop; rm -fv {{ $sockFile | squote }}"]
volumeMounts:
{{- include "kong.volumeMounts" . | nindent 4 }}
{{- include "kong.userDefinedVolumeMounts" . | nindent 4 }}
resources:
{{- toYaml .Values.resources | nindent 4 }}
{{- end -}}
Expand Down
21 changes: 19 additions & 2 deletions charts/kong/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{- if or .Values.deployment.kong.enabled .Values.ingressController.enabled }}
apiVersion: apps/v1
{{- if .Values.deployment.daemonset }}
kind: DaemonSet
{{- else }}
kind: Deployment
{{- end }}
metadata:
name: {{ template "kong.fullname" . }}
namespace: {{ template "kong.namespace" . }}
Expand All @@ -15,13 +19,19 @@ metadata:
{{- end }}
spec:
{{- if not .Values.autoscaling.enabled }}
{{- if not .Values.deployment.daemonset }}
replicas: {{ .Values.replicaCount }}
{{- end }}
{{- end }}
selector:
matchLabels:
{{- include "kong.selectorLabels" . | nindent 6 }}
{{- if .Values.updateStrategy }}
{{- if .Values.deployment.daemonset }}
updateStrategy:
{{- else }}
strategy:
{{- end }}
{{ toYaml .Values.updateStrategy | indent 4 }}
{{- end }}

Expand Down Expand Up @@ -57,9 +67,14 @@ spec:
- name: {{ . }}
{{- end }}
{{- end }}
{{- if (and (not (eq .Values.env.database "off")) .Values.waitImage.enabled) }}
{{- if (or (and (not (eq .Values.env.database "off")) .Values.waitImage.enabled) .Values.deployment.initContainers) }}
initContainers:
{{- include "kong.wait-for-db" . | nindent 6 }}
{{- if .Values.deployment.initContainers }}
{{- toYaml .Values.deployment.initContainers | nindent 6 }}
{{- end }}
{{- if (and (not (eq .Values.env.database "off")) .Values.waitImage.enabled) }}
{{- include "kong.wait-for-db" . | nindent 6 }}
{{- end }}
{{- end }}
containers:
{{- if .Values.ingressController.enabled }}
Expand Down Expand Up @@ -206,6 +221,7 @@ spec:
{{- end }}
volumeMounts:
{{- include "kong.volumeMounts" . | nindent 10 }}
{{- include "kong.userDefinedVolumeMounts" . | nindent 10 }}
readinessProbe:
{{ toYaml .Values.readinessProbe | indent 10 }}
livenessProbe:
Expand All @@ -232,4 +248,5 @@ spec:
{{ toYaml .Values.tolerations | indent 8 }}
volumes:
{{- include "kong.volumes" . | nindent 8 -}}
{{- include "kong.userDefinedVolumes" . | nindent 8 -}}
{{- end }}
4 changes: 4 additions & 0 deletions charts/kong/templates/migrations-post-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ spec:
nodeSelector:
{{- toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
restartPolicy: OnFailure
volumes:
{{- include "kong.volumes" . | nindent 6 -}}
Expand Down
4 changes: 4 additions & 0 deletions charts/kong/templates/migrations-pre-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ spec:
nodeSelector:
{{- toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
restartPolicy: OnFailure
volumes:
{{- include "kong.volumes" . | nindent 6 -}}
Expand Down
4 changes: 4 additions & 0 deletions charts/kong/templates/migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ spec:
nodeSelector:
{{- toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
restartPolicy: OnFailure
volumes:
{{- include "kong.volumes" . | nindent 6 -}}
Expand Down
1 change: 1 addition & 0 deletions charts/kong/templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ spec:
selector:
matchLabels:
{{- include "kong.metaLabels" . | nindent 6 }}
app.kubernetes.io/component: app
{{- end }}
Loading

0 comments on commit bd8e860

Please sign in to comment.