Skip to content

Commit

Permalink
update kind to v0.3.0, contour to v0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rimusz authored May 17, 2019
1 parent 4e8befc commit b676749
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 20 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
shellcheck -x .test/e2e-kind.sh
shellcheck -x .test/lint-charts-local.sh
shellcheck -x .test/e2e-docker4mac.sh
shellcheck -x .test/e2e-local-gke.sh
lint-charts:
docker:
Expand All @@ -27,8 +28,8 @@ jobs:
CHART_TESTING_IMAGE: quay.io/helmpack/chart-testing
CHART_TESTING_TAG: v2.3.3
CHARTS_REPO: https://github.com/rimusz/charts
K8S_VERSION: v1.13.4
KIND_VERSION: 0.2.1
K8S_VERSION: v1.14.2
KIND_VERSION: v0.3.0
steps:
- checkout
- run:
Expand Down
79 changes: 79 additions & 0 deletions .test/e2e-local-gke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

readonly IMAGE_TAG=${TEST_IMAGE_TAG}
readonly IMAGE_REPOSITORY="gcr.io/kubernetes-charts-ci/test-image"
readonly REPO_ROOT="${REPO_ROOT:-$(git rev-parse --show-toplevel)}"

run_ct_container() {
echo 'Running ct container...'
docker run --rm --interactive --detach --name ct \
--volume "$HOME/.config/gcloud:/root/.config/gcloud" \
--volume "$REPO_ROOT:/workdir" \
--workdir /workdir \
"$IMAGE_REPOSITORY:$IMAGE_TAG" \
cat
echo
}

cleanup() {
echo 'Removing ct container...'
docker kill ct > /dev/null 2>&1

echo 'Done!'
}

docker_exec() {
docker exec --interactive -e HELM_HOST=127.0.0.1:44134 -e HELM_TILLER_SILENT=true ct "$@"
}

connect_to_cluster() {
# copy and update kubeconfig file
docker cp "$HOME/.kube" ct:/root/.kube
# shellcheck disable=SC2086
docker_exec sed -i 's|'${HOME}'||g' /root/.kube/config
# Set to specified cluster
if [[ -e CLUSTER ]]; then
# shellcheck disable=SC1091
source CLUSTER
if [[ -n "${GKE_CLUSTER}" ]]; then
echo
docker_exec kubectl config use-context "${GKE_CLUSTER}"
echo
fi
fi
}

install_tiller() {
docker_exec apk add bash
echo "Install Tillerless Helm plugin..."
docker_exec helm init --client-only
docker_exec helm plugin install https://github.com/rimusz/helm-tiller
docker_exec bash -c 'echo "Starting Tiller..."; helm tiller start-ci >/dev/null 2>&1 &'
docker_exec bash -c 'echo "Waiting Tiller to launch on 44134..."; while ! nc -z localhost 44134; do sleep 1; done; echo "Tiller launched..."'
echo
}

install_charts() {
echo "Add git remote k8s ${CHARTS_REPO}"
git remote add k8s "${CHARTS_REPO}" &> /dev/null || true
git fetch k8s master
echo
# shellcheck disable=SC2086
docker_exec ct install ${CHART_TESTING_ARGS} --config /workdir/test/ct.yaml
echo
}

main() {
run_ct_container
trap cleanup EXIT

connect_to_cluster
install_tiller
install_charts
}

main
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ CHARTS_REPO ?= https://github.com/rimusz/charts
CHART_TESTING_IMAGE ?= quay.io/helmpack/chart-testing
CHART_TESTING_TAG ?= v2.3.3
TEST_IMAGE_TAG ?= v3.3.2
K8S_VERSION ?= v1.13.4
KIND_VERSION ?= 0.2.1

# If the first argument is "lint" or "mac" or "gke" or "kind"
ifneq ( $(filter wordlist 1,lint mac gke kind), $(firstword $(MAKECMDGOALS)))
Expand All @@ -30,6 +28,13 @@ mac:
$(eval export CHART_TESTING_ARGS=${MAC_ARGS})
@.test/e2e-docker4mac.sh

.PHONY: gke
gke:
$(eval export TEST_IMAGE_TAG)
$(eval export CHARTS_REPO)
$(eval export CHART_TESTING_ARGS=${MAC_ARGS})
@.test/e2e-local-gke.sh

.PHONY: publish
publish:
@./.scripts/repo-sync.sh
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,48 @@ make mac -- --all

**Note:** It might take a while to run install test for all charts in `Docker for Mac`.

## Manually testing charts with remote GKE cluster

You can install and test changed charts with `GKE` cluster set in kubeconfig `context`:

```console
make gke
```

### Forcing to install unchanged charts

You can force to install one chart with `--charts` flag:

```console
make gke -- --charts stable/contour
```

You can force to install a list of charts (separated by comma) with `--charts` flag:

```console
make gke -- --charts stable/contour,stable/gcloud-sqlproxy
```

You can force to install all charts with `--all` flag:

```console
make gke -- --all
```

### Using dedicated GKE cluster for manual charts testing

By default it uses the `GKE` cluster set in kubeconfig `context`, you can specify the dedicated cluster (it must be set in the kubeconfig) in the file `CLUSTER`:

```
GKE_CLUSTER=gke_my_cluster_context_name
```

Then store the `CLUSTER` file in the root folder of the repo. It is also ignored by git.

In such setup your local default cluster can be different from the charts testing one.

## Docs

For more information on using Helm, refer to the Helm's [documentation](https://docs.helm.sh/using_helm/#quickstart-guide).

To get a quick introduction to Charts see this Chart's [documentation](https://docs.helm.sh/developing_charts/#charts).
To get a quick introduction to Charts see this Chart's [documentation](https://docs.helm.sh/developing_charts/#charts).
4 changes: 2 additions & 2 deletions stable/contour/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
name: contour
description: A Helm chart for Heptio Contour
version: 0.2.8
version: 0.3.0
# Note that we use appVersion to get images tag, so make sure this is correct.
appVersion: v0.10.0
appVersion: v0.12.0
source: https://github.com/rimusz/charts/blob/master/stable/contour
home: https://github.com/heptio/contour
keywords:
Expand Down
7 changes: 3 additions & 4 deletions stable/contour/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ The following table lists the configurable parameters of the `Contour` chart and
|--------------------------------------|----------------------------------------------------|-------------------------------------|
| `replicaCount` | Default replicaCount | `1` |
| `annotationsprometheus.io/scrape` | Enable Prometheus scrape | `true` |
| `annotationsprometheus.io/port` | Set Prometheus scrape port | `9001` |
| `annotationsprometheus.io/path` | Set Prometheus scrape path | `stats` |
| `annotationsprometheus.io/format` | Set Prometheus scrape format | `prometheus` |
| `annotationsprometheus.io/port` | Set Prometheus scrape port | `8002` |
| `annotationsprometheus.io/path` | Set Prometheus scrape path | `/stats/prometheus` |
| `controller.image.repository` | Set Controller image repository | `gcr.io/heptio-images/contour` |
| `controller.image.PullPolicy` | Set Controller image pull policy | `IfNotPresent` |
| `controller.statsd.enabled` | Enable Controller `statsd` | `false` |
| `controller.stats` | Set Controller `stats` | `{}` |
| `proxy.image.repository` | Set Proxy image repository | `docker.io/envoyproxy/envoy-alpine` |
| `proxy.image.tag` | Set Proxy image tag | `v1.8.0` |
| `proxy.image.tag` | Set Proxy image tag | `v1.9.1` |
| `proxy.image.PullPolicy` | Set Proxy image pull policy | `IfNotPresent` |
| `service.type` | Service type | `LoadBalancer` |
| `service.loadBalancerIP` | Loadbalancer IP | `` |
Expand Down
19 changes: 18 additions & 1 deletion stable/contour/templates/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
properties:
secretName:
type: string
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ # DNS-1123 subdomain
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?([\.\/][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minimumProtocolVersion:
type: string
enum:
Expand Down Expand Up @@ -154,3 +154,20 @@ spec:
names:
plural: tlscertificatedelegations
kind: TLSCertificateDelegation
validation:
openAPIV3Schema:
properties:
spec:
properties:
delegations:
type: array
items:
type: object
required:
- secretName
- targetNamespaces
properties:
match:
type: string
targetNamespaces:
type: array
10 changes: 7 additions & 3 deletions stable/contour/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
name: contour
command: ["contour"]
args: ["serve", "--incluster"]
args: ["serve", "--incluster", "--envoy-service-http-port", "8080", "--envoy-service-https-port", "8443"]
- image: "{{ .Values.proxy.image.repository }}:{{ .Values.proxy.image.tag }}"
imagePullPolicy: {{ .Values.proxy.image.pullPolicy }}
name: envoy
Expand All @@ -44,7 +44,6 @@ spec:
- --service-cluster cluster0
- --service-node node0
- --log-level info
- --v2-config-only
readinessProbe:
httpGet:
path: /healthz
Expand All @@ -57,7 +56,7 @@ spec:
lifecycle:
preStop:
exec:
command: ["wget", "-qO-", "http://localhost:9001/healthcheck/fail"]
command: ["wget", "-qO-", "--post-data=''", "http://localhost:9001/healthcheck/fail"]
volumeMounts:
- name: contour-config
mountPath: /config
Expand All @@ -81,6 +80,11 @@ spec:
volumeMounts:
- name: contour-config
mountPath: /config
env:
- name: CONTOUR_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumes:
- name: contour-config
emptyDir: {}
Expand Down
11 changes: 6 additions & 5 deletions stable/contour/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ replicaCount: 1
# Contour Deployment specific annotations
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9001"
prometheus.io/path: "/stats"
prometheus.io/format: "prometheus"
prometheus.io/port: "8002"
prometheus.io/path: "/stats/prometheus"

controller:
image:
Expand All @@ -27,14 +26,16 @@ controller:
proxy:
image:
repository: docker.io/envoyproxy/envoy-alpine
tag: v1.9.0
tag: v1.9.1
pullPolicy: IfNotPresent

service:
type: LoadBalancer
loadBalancerIP: ""
# Contour specific Service annotations
annotations: {}
annotations:
prometheus.io/port: "8000"
prometheus.io/scrape: "true"
# This annotation puts the AWS ELB into "TCP" mode so that it does not
# do HTTP negotiation for HTTPS connections at the ELB edge.
# The downside of this is the remote IP address of all connections will
Expand Down

0 comments on commit b676749

Please sign in to comment.