Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(*) encapsulate proxy init container #495

Merged
merged 5 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ Changes:
[#501](https://github.com/Kong/kuma/pull/501)
* feature: add proto definitions for metrics that should be collected and exposed by dataplanes
[#500](https://github.com/Kong/kuma/pull/500)
* chore: encapsulate proxy init into kuma-init container
[#495](https://github.com/Kong/kuma/pull/495)
* feature: display CA type in kumactl get meshes
[#494](https://github.com/Kong/kuma/pull/494)
* chore: update Envoy to v1.12.2
[#493](https://github.com/Kong/kuma/pull/493)

Breaking changes:

* ⚠️ An `--dataplane-init-version` argument was removed. Init container was changed to `kuma-init` which version is in sync with the rest of the Kuma containers.

## [0.3.1]

> Released on 2019/12/13
Expand Down
40 changes: 28 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.PHONY: help clean clean/build clean/proto \
start/k8s start/kind start/control-plane/k8s \
deploy/example-app/k8s deploy/control-plane/k8s \
kind/load/control-plane kind/load/kuma-dp kind/load/kuma-injector \
kind/load/control-plane kind/load/kuma-dp kind/load/kuma-injector kind/load/kuma-init \
generate protoc/pkg/config/app/kumactl/v1alpha1 protoc/pkg/test/apis/sample/v1alpha1 generate/kumactl/install/control-plane \ generate/gui \
fmt fmt/go fmt/proto vet golangci-lint check test integration build run/k8s run/universal/memory run/universal/postgres \
images image/kuma-cp image/kuma-dp image/kumactl image/kuma-injector image/kuma-tcp-echo \
docker/build docker/build/kuma-cp docker/build/kuma-dp docker/build/kumactl docker/build/kuma-injector docker/build/kuma-tcp-echo \
docker/save docker/save/kuma-cp docker/save/kuma-dp docker/save/kumactl docker/save/kuma-injector docker/save/kuma-tcp-echo \
docker/load docker/load/kuma-cp docker/load/kuma-dp docker/load/kumactl docker/load/kuma-injector docker/load/kuma-tcp-echo \
build/kuma-cp build/kuma-dp build/kumactl build/kuma-injector build/kuma-tcp-echo \
images image/kuma-cp image/kuma-dp image/kumactl image/kuma-injector image/kuma-init image/kuma-tcp-echo \
docker/build docker/build/kuma-cp docker/build/kuma-dp docker/build/kumactl docker/build/kuma-injector docker/build/kuma-init docker/build/kuma-tcp-echo \
docker/save docker/save/kuma-cp docker/save/kuma-dp docker/save/kumactl docker/save/kuma-injector docker/save/kuma-init docker/save/kuma-tcp-echo \
docker/load docker/load/kuma-cp docker/load/kuma-dp docker/load/kumactl docker/load/kuma-injector docker/load/kuma-init docker/load/kuma-tcp-echo \
build/kuma-cp build/kuma-dp build/kumactl build/kuma-injector build/kuma-init build/kuma-tcp-echo \
build/kuma-cp/linux-amd64 build/kuma-dp/linux-amd64 build/kumactl/linux-amd64 build/kuma-injector/linux-amd64 build/kuma-tcp-echo/linux-amd64 \
docs _docs_ docs/kumactl \
run/example/envoy config_dump/example/envoy \
Expand Down Expand Up @@ -96,16 +96,18 @@ KUMA_CP_DOCKER_IMAGE_NAME ?= $(DOCKER_REGISTRY)/kuma-cp
KUMA_DP_DOCKER_IMAGE_NAME ?= $(DOCKER_REGISTRY)/kuma-dp
KUMACTL_DOCKER_IMAGE_NAME ?= $(DOCKER_REGISTRY)/kumactl
KUMA_INJECTOR_DOCKER_IMAGE_NAME ?= $(DOCKER_REGISTRY)/kuma-injector
KUMA_INIT_DOCKER_IMAGE_NAME ?= $(DOCKER_REGISTRY)/kuma-init
KUMA_TCP_ECHO_DOCKER_IMAGE_NAME ?= $(DOCKER_REGISTRY)/kuma-tcp-echo

export KUMA_CP_DOCKER_IMAGE ?= $(KUMA_CP_DOCKER_IMAGE_NAME):$(BUILD_INFO_VERSION)
export KUMA_DP_DOCKER_IMAGE ?= $(KUMA_DP_DOCKER_IMAGE_NAME):$(BUILD_INFO_VERSION)
export KUMACTL_DOCKER_IMAGE ?= $(KUMACTL_DOCKER_IMAGE_NAME):$(BUILD_INFO_VERSION)
export KUMA_INJECTOR_DOCKER_IMAGE ?= $(KUMA_INJECTOR_DOCKER_IMAGE_NAME):$(BUILD_INFO_VERSION)
export KUMA_INIT_DOCKER_IMAGE ?= $(KUMA_INIT_DOCKER_IMAGE_NAME):$(BUILD_INFO_VERSION)
export KUMA_TCP_ECHO_DOCKER_IMAGE ?= $(KUMA_TCP_ECHO_DOCKER_IMAGE_NAME):$(BUILD_INFO_VERSION)

ifeq ($(KUMACTL_INSTALL_USE_LOCAL_IMAGES),true)
KUMACTL_INSTALL_CONTROL_PLANE_IMAGES := --control-plane-image=$(KUMA_CP_DOCKER_IMAGE_NAME) --dataplane-image=$(KUMA_DP_DOCKER_IMAGE_NAME) --injector-image=$(KUMA_INJECTOR_DOCKER_IMAGE_NAME)
KUMACTL_INSTALL_CONTROL_PLANE_IMAGES := --control-plane-image=$(KUMA_CP_DOCKER_IMAGE_NAME) --dataplane-image=$(KUMA_DP_DOCKER_IMAGE_NAME) --injector-image=$(KUMA_INJECTOR_DOCKER_IMAGE_NAME) --dataplane-init-image=$(KUMA_INIT_DOCKER_IMAGE_NAME)
else
KUMACTL_INSTALL_CONTROL_PLANE_IMAGES :=
endif
Expand Down Expand Up @@ -206,6 +208,9 @@ kind/load/kuma-dp: image/kuma-dp
kind/load/kuma-injector: image/kuma-injector
kind load docker-image $(KUMA_INJECTOR_DOCKER_IMAGE) --name=kuma

kind/load/kuma-init: image/kuma-init
kind load docker-image $(KUMA_INIT_DOCKER_IMAGE) --name=kuma

deploy/control-plane/k8s: build/kumactl
kumactl install control-plane $(KUMACTL_INSTALL_CONTROL_PLANE_IMAGES) | KUBECONFIG=$(KIND_KUBECONFIG) kubectl apply -f -
KUBECONFIG=$(KIND_KUBECONFIG) kubectl delete -n kuma-system pod -l app=kuma-injector
Expand All @@ -214,7 +219,7 @@ deploy/control-plane/k8s: build/kumactl
KUBECONFIG=$(KIND_KUBECONFIG) kubectl delete -n $(EXAMPLE_NAMESPACE) pod -l app=example-app
KUBECONFIG=$(KIND_KUBECONFIG) kubectl wait --timeout=60s --for=condition=Ready -n $(EXAMPLE_NAMESPACE) pods -l app=example-app

start/control-plane/k8s: kind/load/control-plane kind/load/kuma-dp kind/load/kuma-injector deploy/control-plane/k8s ## Bootstrap: Deploy Control Plane on Kubernetes (KIND)
start/control-plane/k8s: kind/load/control-plane kind/load/kuma-dp kind/load/kuma-injector kind/load/kuma-init deploy/control-plane/k8s ## Bootstrap: Deploy Control Plane on Kubernetes (KIND)

clean: clean/build ## Dev: Clean

Expand Down Expand Up @@ -371,7 +376,7 @@ run/example/envoy: build/kuma-dp build/kumactl ## Dev: Run Envoy configured agai
config_dump/example/envoy: ## Dev: Dump effective configuration of example Envoy
curl -s localhost:$(ENVOY_ADMIN_PORT)/config_dump

images: image/kuma-cp image/kuma-dp image/kumactl image/kuma-injector image/kuma-tcp-echo ## Dev: Build all Docker images
images: image/kuma-cp image/kuma-dp image/kumactl image/kuma-injector image/kuma-init image/kuma-tcp-echo ## Dev: Build all Docker images

build/kuma-cp/linux-amd64:
GOOS=linux GOARCH=amd64 $(MAKE) build/kuma-cp
Expand All @@ -388,7 +393,7 @@ build/kuma-injector/linux-amd64:
build/kuma-tcp-echo/linux-amd64:
GOOS=linux GOARCH=amd64 $(MAKE) build/kuma-tcp-echo

docker/build: docker/build/kuma-cp docker/build/kuma-dp docker/build/kumactl docker/build/kuma-injector docker/build/kuma-tcp-echo
docker/build: docker/build/kuma-cp docker/build/kuma-dp docker/build/kumactl docker/build/kuma-injector docker/build/kuma-init docker/build/kuma-tcp-echo

docker/build/kuma-cp: build/artifacts-linux-amd64/kuma-cp/kuma-cp
docker build -t $(KUMA_CP_DOCKER_IMAGE) -f tools/releases/dockerfiles/Dockerfile.kuma-cp .
Expand All @@ -402,6 +407,9 @@ docker/build/kumactl: build/artifacts-linux-amd64/kumactl/kumactl
docker/build/kuma-injector: build/artifacts-linux-amd64/kuma-injector/kuma-injector
docker build -t $(KUMA_INJECTOR_DOCKER_IMAGE) -f tools/releases/dockerfiles/Dockerfile.kuma-injector .

docker/build/kuma-init:
docker build -t $(KUMA_INIT_DOCKER_IMAGE) -f tools/releases/dockerfiles/Dockerfile.kuma-init .

docker/build/kuma-tcp-echo: build/artifacts-linux-amd64/kuma-tcp-echo/kuma-tcp-echo
docker build -t $(KUMA_TCP_ECHO_DOCKER_IMAGE) -f tools/releases/dockerfiles/Dockerfile.kuma-tcp-echo .

Expand All @@ -413,12 +421,14 @@ image/kumactl: build/kumactl/linux-amd64 docker/build/kumactl ## Dev: Build `kum

image/kuma-injector: build/kuma-injector/linux-amd64 docker/build/kuma-injector ## Dev: Build `kuma-injector` Docker image

image/kuma-init: docker/build/kuma-init ## Dev: Build `kuma-init` Docker image

image/kuma-tcp-echo: build/kuma-tcp-echo/linux-amd64 docker/build/kuma-tcp-echo ## Dev: Build `kuma-tcp-echo` Docker image

${BUILD_DOCKER_IMAGES_DIR}:
mkdir -p ${BUILD_DOCKER_IMAGES_DIR}

docker/save: docker/save/kuma-cp docker/save/kuma-dp docker/save/kumactl docker/save/kuma-injector docker/save/kuma-tcp-echo
docker/save: docker/save/kuma-cp docker/save/kuma-dp docker/save/kumactl docker/save/kuma-injector docker/save/kuma-init docker/save/kuma-tcp-echo

docker/save/kuma-cp: ${BUILD_DOCKER_IMAGES_DIR}
docker save --output ${BUILD_DOCKER_IMAGES_DIR}/kuma-cp.tar $(KUMA_CP_DOCKER_IMAGE)
Expand All @@ -432,10 +442,13 @@ docker/save/kumactl: ${BUILD_DOCKER_IMAGES_DIR}
docker/save/kuma-injector: ${BUILD_DOCKER_IMAGES_DIR}
docker save --output ${BUILD_DOCKER_IMAGES_DIR}/kuma-injector.tar $(KUMA_INJECTOR_DOCKER_IMAGE)

docker/save/kuma-init: ${BUILD_DOCKER_IMAGES_DIR}
docker save --output ${BUILD_DOCKER_IMAGES_DIR}/kuma-init.tar $(KUMA_INIT_DOCKER_IMAGE)

docker/save/kuma-tcp-echo: ${BUILD_DOCKER_IMAGES_DIR}
docker save --output ${BUILD_DOCKER_IMAGES_DIR}/kuma-tcp-echo.tar $(KUMA_TCP_ECHO_DOCKER_IMAGE)

docker/load: docker/load/kuma-cp docker/load/kuma-dp docker/load/kumactl docker/load/kuma-injector docker/load/kuma-tcp-echo
docker/load: docker/load/kuma-cp docker/load/kuma-dp docker/load/kumactl docker/load/kuma-injector docker/load/kuma-init docker/load/kuma-tcp-echo

docker/load/kuma-cp: ${BUILD_DOCKER_IMAGES_DIR}/kuma-cp.tar
docker load --input ${BUILD_DOCKER_IMAGES_DIR}/kuma-cp.tar
Expand All @@ -449,6 +462,9 @@ docker/load/kumactl: ${BUILD_DOCKER_IMAGES_DIR}/kumactl.tar
docker/load/kuma-injector: ${BUILD_DOCKER_IMAGES_DIR}/kuma-injector.tar
docker load --input ${BUILD_DOCKER_IMAGES_DIR}/kuma-injector.tar

docker/load/kuma-init: ${BUILD_DOCKER_IMAGES_DIR}/kuma-init.tar
docker load --input ${BUILD_DOCKER_IMAGES_DIR}/kuma-init.tar

docker/load/kuma-tcp-echo: ${BUILD_DOCKER_IMAGES_DIR}/kuma-tcp-echo.tar
docker load --input ${BUILD_DOCKER_IMAGES_DIR}/kuma-tcp-echo.tar

Expand Down
1 change: 1 addition & 0 deletions Makefile.e2e.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ define pull_docker_images
&& docker pull $(KUMA_CP_DOCKER_IMAGE) \
&& docker pull $(KUMA_DP_DOCKER_IMAGE) \
&& docker pull $(KUMA_INJECTOR_DOCKER_IMAGE) \
&& docker pull $(KUMA_INIT_DOCKER_IMAGE) \
&& docker pull $(KUMA_TCP_ECHO_DOCKER_IMAGE) \
&& docker pull $(KUMACTL_DOCKER_IMAGE) \
&& set +x \
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Kuma
Copyright 2019 Kong Inc.

This product includes software developed at Kong Inc (https://konghq.com/).
This product includes software developed at Kong Inc (https://konghq.com/).
5 changes: 1 addition & 4 deletions app/kumactl/cmd/install/install_control_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func newInstallControlPlaneCmd(pctx *kumactl_cmd.RootContext) *cobra.Command {
InjectorTlsKey string
DataplaneImage string
DataplaneInitImage string
DataplaneInitVersion string
SdsTlsCert string
SdsTlsKey string
}{
Expand All @@ -56,8 +55,7 @@ func newInstallControlPlaneCmd(pctx *kumactl_cmd.RootContext) *cobra.Command {
InjectorTlsCert: "",
InjectorTlsKey: "",
DataplaneImage: "kong-docker-kuma-docker.bintray.io/kuma-dp",
DataplaneInitImage: "docker.io/istio/proxy_init",
DataplaneInitVersion: "1.1.2",
DataplaneInitImage: "kong-docker-kuma-docker.bintray.io/kuma-init",
SdsTlsCert: "",
SdsTlsKey: "",
}
Expand Down Expand Up @@ -147,7 +145,6 @@ func newInstallControlPlaneCmd(pctx *kumactl_cmd.RootContext) *cobra.Command {
cmd.Flags().StringVar(&args.InjectorTlsKey, "injector-tls-key", args.InjectorTlsKey, "TLS key for the mutating web hook implemented by the Kuma Injector component")
cmd.Flags().StringVar(&args.DataplaneImage, "dataplane-image", args.DataplaneImage, "image of the Kuma Dataplane component")
cmd.Flags().StringVar(&args.DataplaneInitImage, "dataplane-init-image", args.DataplaneInitImage, "init image of the Kuma Dataplane component")
cmd.Flags().StringVar(&args.DataplaneInitVersion, "dataplane-init-version", args.DataplaneInitVersion, "version of the init image of the Kuma Dataplane component")
cmd.Flags().StringVar(&args.SdsTlsCert, "sds-tls-cert", args.SdsTlsCert, "TLS certificate for the SDS server")
cmd.Flags().StringVar(&args.SdsTlsKey, "sds-tls-key", args.SdsTlsKey, "TLS key for the SDS server")
return cmd
Expand Down
1 change: 0 additions & 1 deletion app/kumactl/cmd/install/install_control_plane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ var _ = Describe("kumactl install control-plane", func() {
"--injector-tls-key", "InjectorKey",
"--dataplane-image", "kuma-ci/kuma-dp",
"--dataplane-init-image", "kuma-ci/kuma-init",
"--dataplane-init-version", "dev",
"--sds-tls-cert", "SdsCert",
"--sds-tls-key", "SdsKey",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3549,7 +3549,7 @@ spec:
- name: KUMA_INJECTOR_SIDECAR_CONTAINER_IMAGE
value: kong-docker-kuma-docker.bintray.io/kuma-dp:0.0.1
- name: KUMA_INJECTOR_INIT_CONTAINER_IMAGE
value: docker.io/istio/proxy_init:1.1.2
value: kong-docker-kuma-docker.bintray.io/kuma-init:0.0.1
args:
- run
- --log-level=info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3550,7 +3550,7 @@ spec:
- name: KUMA_INJECTOR_SIDECAR_CONTAINER_IMAGE
value: kuma-ci/kuma-dp:greatest
- name: KUMA_INJECTOR_INIT_CONTAINER_IMAGE
value: kuma-ci/kuma-init:dev
value: kuma-ci/kuma-init:greatest
args:
- run
- --log-level=info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
- name: KUMA_INJECTOR_SIDECAR_CONTAINER_IMAGE
value: {{ .DataplaneImage }}:{{ .ControlPlaneVersion }}
- name: KUMA_INJECTOR_INIT_CONTAINER_IMAGE
value: {{ .DataplaneInitImage }}:{{ .DataplaneInitVersion }}
value: {{ .DataplaneInitImage }}:{{ .ControlPlaneVersion }}
args:
- run
- --log-level=info
Expand Down
38 changes: 19 additions & 19 deletions app/kumactl/pkg/install/k8s/control-plane/templates_vfsdata.go

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/cmd/kumactl/HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ Flags:
--control-plane-service-name string Service name of the Kuma Control Plane (default "kuma-control-plane")
--control-plane-version string version shared by all components of the Kuma Control Plane (default "latest")
--dataplane-image string image of the Kuma Dataplane component (default "kong-docker-kuma-docker.bintray.io/kuma-dp")
--dataplane-init-image string init image of the Kuma Dataplane component (default "docker.io/istio/proxy_init")
--dataplane-init-version string version of the init image of the Kuma Dataplane component (default "1.1.2")
Copy link
Contributor

@yskopets yskopets Dec 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's document this as a backwards-incompatible change (removal of --dataplane-init-version option)

--dataplane-init-image string init image of the Kuma Dataplane component (default "kong-docker-kuma-docker.bintray.io/kuma-init")
-h, --help help for control-plane
--image-pull-policy string image pull policy that applies to all components of the Kuma Control Plane (default "IfNotPresent")
--injector-failure-policy string failue policy of the mutating web hook implemented by the Kuma Injector component (default "Ignore")
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/app/kuma-injector/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func DefaultConfig() Config {
},
},
InitContainer: InitContainer{
Image: "docker.io/istio/proxy_init:1.1.2",
Image: "kuma/kuma-init:latest",
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ injector:
cpu: 1000m
memory: 512Mi
initContainer:
image: docker.io/istio/proxy_init:1.1.2
image: kuma/kuma-init:latest
2 changes: 1 addition & 1 deletion tools/releases/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

[ -z "$KUMA_DOCKER_REPO" ] && KUMA_DOCKER_REPO="kong-docker-kuma-docker.bintray.io"
KUMA_COMPONENTS=("kuma-cp" "kuma-dp" "kuma-injector" "kuma-tcp-echo" "kumactl")
KUMA_COMPONENTS=("kuma-cp" "kuma-dp" "kuma-injector" "kuma-tcp-echo" "kumactl", "kuma-init")

function msg_green {
builtin echo -en "\033[1;32m"
Expand Down
6 changes: 6 additions & 0 deletions tools/releases/dockerfiles/Dockerfile.kuma-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM docker.io/istio/proxy_init:1.1.2

RUN mkdir /kuma
COPY $KUMA_ROOT/tools/releases/templates/LICENSE /kuma
COPY $KUMA_ROOT/tools/releases/templates/NOTICE-kuma-init /kuma/NOTICE
COPY $KUMA_ROOT/tools/releases/templates/README /kuma
2 changes: 1 addition & 1 deletion tools/releases/templates/NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Kuma
Copyright 2019 Kong Inc.

This product includes software developed at Kong Inc (https://konghq.com/).
This product includes software developed at Kong Inc (https://konghq.com/).
5 changes: 5 additions & 0 deletions tools/releases/templates/NOTICE-kuma-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Kuma
Copyright 2019 Kong Inc.

This product includes software developed at Kong Inc (https://konghq.com/).
This product includes software developed by Istio (https://istio.io/).