forked from kubernetes/ingress-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First sidecar module: OpenTelemetry (kubernetes#8013)
* remove opentelemetry from main nginx image * add opentelemetry sidecar image * handle extra modules in helm chart * fix running helm chart * mount the modules volume in the init container * merge the mounted folder * fix the otel image * fix licence year * fix cloudbuild image * use the same nginx version as in the main image * only retrieve /etc/nginx/modules for now
- Loading branch information
Showing
14 changed files
with
353 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
controller: | ||
kind: DaemonSet | ||
image: | ||
repository: ingress-controller/controller | ||
tag: 1.0.0-dev | ||
service: | ||
type: ClusterIP | ||
extraModules: | ||
- name: opentelemetry | ||
image: busybox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
controller: | ||
image: | ||
repository: ingress-controller/controller | ||
tag: 1.0.0-dev | ||
digest: null | ||
service: | ||
type: ClusterIP | ||
extraModules: | ||
- name: opentelemetry | ||
image: busybox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
if [ -d "/modules_mount/etc/nginx/modules" ]; then | ||
for dir in /modules_mount/etc/nginx/modules/*; do | ||
cp "$dir"/* "/etc/nginx/modules/$(basename "$dir")" | ||
done | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Copyright 2021 The Kubernetes Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
.DEFAULT_GOAL:=build | ||
|
||
# set default shell | ||
SHELL=/bin/bash -o pipefail -o errexit | ||
|
||
DIR:=$(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))) | ||
INIT_BUILDX=$(DIR)/../../hack/init-buildx.sh | ||
|
||
# 0.0.0 shouldn't clobber any released builds | ||
TAG ?= 0.0 | ||
REGISTRY ?= gcr.io/k8s-staging-ingress-nginx | ||
|
||
IMAGE = $(REGISTRY)/opentelemetry | ||
|
||
# required to enable buildx | ||
export DOCKER_CLI_EXPERIMENTAL=enabled | ||
|
||
# build with buildx | ||
PLATFORMS?=linux/amd64,linux/arm | ||
OUTPUT= | ||
PROGRESS=plain | ||
build: ensure-buildx | ||
docker buildx build \ | ||
--platform=${PLATFORMS} $(OUTPUT) \ | ||
--progress=$(PROGRESS) \ | ||
--pull \ | ||
--tag $(IMAGE):$(TAG) rootfs | ||
|
||
# push the cross built image | ||
push: OUTPUT=--push | ||
push: build | ||
|
||
# enable buildx | ||
ensure-buildx: | ||
# this is required for cloudbuild | ||
ifeq ("$(wildcard $(INIT_BUILDX))","") | ||
@curl -sSL https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/hack/init-buildx.sh | bash | ||
else | ||
@exec $(INIT_BUILDX) | ||
endif | ||
@echo "done" | ||
|
||
.PHONY: build push ensure-buildx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# OpenTelemetry library builder | ||
|
||
**How to use this image:** | ||
This image only contains the necessary files in /usr/local and /etc/nginx/opentelemetry to | ||
be copied to Ingress Controller deployment when OpenTelemetry is enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
timeout: 10800s | ||
options: | ||
substitution_option: ALLOW_LOOSE | ||
# job builds a multi-arch docker image for amd64,arm,arm64 and s390x. | ||
machineType: N1_HIGHCPU_32 | ||
steps: | ||
- name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 | ||
entrypoint: bash | ||
env: | ||
- DOCKER_CLI_EXPERIMENTAL=enabled | ||
- TAG=$_GIT_TAG | ||
- BASE_REF=$_PULL_BASE_REF | ||
- REGISTRY=gcr.io/k8s-staging-ingress-nginx | ||
# default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx | ||
# set the home to /root explicitly to if using docker buildx | ||
- HOME=/root | ||
args: | ||
- -c | ||
- | | ||
gcloud auth configure-docker \ | ||
&& make push | ||
substitutions: | ||
_GIT_TAG: "12345" | ||
_PULL_BASE_REF: "master" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2021 The Kubernetes Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
FROM alpine:3.14.2 as builder | ||
|
||
COPY . / | ||
|
||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add -U bash \ | ||
&& /build.sh | ||
|
||
FROM busybox:latest | ||
|
||
COPY --from=builder init_module.sh /usr/local/bin/init_module.sh | ||
COPY --from=builder /etc/nginx/modules /etc/nginx/modules |
Oops, something went wrong.