Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kumahq/kuma into feature/add-secu…
Browse files Browse the repository at this point in the history
…rity-contexts-to-helm
  • Loading branch information
bartsmykla committed Apr 11, 2022
2 parents 1ab18d8 + aafdd83 commit 9441a9a
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 32 deletions.
16 changes: 8 additions & 8 deletions test/dockerfiles/Dockerfile.universal
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ RUN ssh-keygen -A \
ARG ARCH
ARG ENVOY_VERSION

ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/kuma-cp/kuma-cp /usr/bin
ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/kuma-dp/kuma-dp /usr/bin
ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/envoy/envoy-$ENVOY_VERSION-alpine /usr/bin/envoy
ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/coredns/coredns /usr/bin
ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/kumactl/kumactl /usr/bin
ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/test-server/test-server /usr/bin
ADD $KUMA_ROOT/test/server/certs/server.crt /kuma
ADD $KUMA_ROOT/test/server/certs/server.key /kuma
ADD /build/artifacts-linux-$ARCH/kuma-cp/kuma-cp /usr/bin
ADD /build/artifacts-linux-$ARCH/kuma-dp/kuma-dp /usr/bin
ADD /build/artifacts-linux-$ARCH/envoy/envoy-$ENVOY_VERSION-alpine /usr/bin/envoy
ADD /build/artifacts-linux-$ARCH/coredns/coredns /usr/bin
ADD /build/artifacts-linux-$ARCH/kumactl/kumactl /usr/bin
ADD /build/artifacts-linux-$ARCH/test-server/test-server /usr/bin
ADD /test/server/certs/server.crt /kuma
ADD /test/server/certs/server.key /kuma

# do not detach (-D), log to stderr (-e)
CMD ["/usr/sbin/sshd", "-D", "-e"]
2 changes: 1 addition & 1 deletion tools/releases/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENVOY_VERSION="${ENVOY_VERSION:-1.21.1}"
function build() {
for component in ${KUMA_COMPONENTS}; do
msg "Building $component..."
docker build --build-arg KUMA_ROOT="$(pwd)" --build-arg ARCH="amd64" --build-arg ENVOY_VERSION="${ENVOY_VERSION}" -t "${KUMA_DOCKER_REPO_ORG}/${component}:${KUMA_VERSION}" \
docker build --build-arg ARCH="amd64" --build-arg ENVOY_VERSION="${ENVOY_VERSION}" -t "${KUMA_DOCKER_REPO_ORG}/${component}:${KUMA_VERSION}" \
-f tools/releases/dockerfiles/Dockerfile."${component}" .
docker tag "${KUMA_DOCKER_REPO_ORG}/${component}:${KUMA_VERSION}" "${KUMA_DOCKER_REPO_ORG}/${component}:latest"
msg_green "... done!"
Expand Down
10 changes: 5 additions & 5 deletions tools/releases/dockerfiles/Dockerfile.kuma-cp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ FROM alpine:3.15.3

ARG ARCH

ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/kuma-cp/kuma-cp /usr/bin
ADD /build/artifacts-linux-$ARCH/kuma-cp/kuma-cp /usr/bin

RUN mkdir -p /etc/kuma
ADD $KUMA_ROOT/pkg/config/app/kuma-cp/kuma-cp.defaults.yaml /etc/kuma
ADD /pkg/config/app/kuma-cp/kuma-cp.defaults.yaml /etc/kuma

COPY $KUMA_ROOT/tools/releases/templates/LICENSE \
$KUMA_ROOT/tools/releases/templates/README \
COPY /tools/releases/templates/LICENSE \
/tools/releases/templates/README \
/kuma/

COPY $KUMA_ROOT/tools/releases/templates/NOTICE /kuma/
COPY /tools/releases/templates/NOTICE /kuma/

RUN addgroup -S -g 6789 kuma-cp \
&& adduser -S -D -G kuma-cp -u 6789 kuma-cp
Expand Down
12 changes: 6 additions & 6 deletions tools/releases/dockerfiles/Dockerfile.kuma-dp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ FROM gcr.io/distroless/base-debian11:debug-nonroot
ARG ENVOY_VERSION
ARG ARCH

ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/kuma-dp/kuma-dp /usr/bin
ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/envoy/envoy-$ENVOY_VERSION-alpine /usr/bin/envoy
ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/coredns/coredns /usr/bin
ADD /build/artifacts-linux-$ARCH/kuma-dp/kuma-dp /usr/bin
ADD /build/artifacts-linux-$ARCH/envoy/envoy-$ENVOY_VERSION-alpine /usr/bin/envoy
ADD /build/artifacts-linux-$ARCH/coredns/coredns /usr/bin

COPY $KUMA_ROOT/tools/releases/templates/LICENSE \
$KUMA_ROOT/tools/releases/templates/README \
COPY /tools/releases/templates/LICENSE \
/tools/releases/templates/README \
/kuma/

COPY $KUMA_ROOT/tools/releases/templates/NOTICE /kuma/
COPY /tools/releases/templates/NOTICE /kuma/

USER nobody:nobody

Expand Down
8 changes: 4 additions & 4 deletions tools/releases/dockerfiles/Dockerfile.kuma-init
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ RUN apt-get update && \
apt-get -y install iptables iproute2 && \
rm -rf /var/lib/apt/lists/*

ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/kumactl/kumactl /usr/bin
ADD /build/artifacts-linux-$ARCH/kumactl/kumactl /usr/bin

COPY $KUMA_ROOT/tools/releases/templates/LICENSE \
$KUMA_ROOT/tools/releases/templates/README \
COPY /tools/releases/templates/LICENSE \
/tools/releases/templates/README \
/kuma/

COPY $KUMA_ROOT/tools/releases/templates/NOTICE-kumactl /kuma/NOTICE
COPY /tools/releases/templates/NOTICE-kumactl /kuma/NOTICE

RUN adduser --system --disabled-password --group kumactl --uid 5678

Expand Down
8 changes: 4 additions & 4 deletions tools/releases/dockerfiles/Dockerfile.kuma-prometheus-sd
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ FROM alpine:3.15.3

ARG ARCH

ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/kuma-prometheus-sd/kuma-prometheus-sd /usr/bin
ADD /build/artifacts-linux-$ARCH/kuma-prometheus-sd/kuma-prometheus-sd /usr/bin

COPY $KUMA_ROOT/tools/releases/templates/LICENSE \
$KUMA_ROOT/tools/releases/templates/README \
COPY /tools/releases/templates/LICENSE \
/tools/releases/templates/README \
/kuma/

COPY $KUMA_ROOT/tools/releases/templates/NOTICE /kuma/
COPY /tools/releases/templates/NOTICE /kuma/

USER nobody:nobody

Expand Down
8 changes: 4 additions & 4 deletions tools/releases/dockerfiles/Dockerfile.kumactl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ ARG ARCH

RUN apk add --no-cache curl

ADD $KUMA_ROOT/build/artifacts-linux-$ARCH/kumactl/kumactl /usr/bin
ADD /build/artifacts-linux-$ARCH/kumactl/kumactl /usr/bin

COPY $KUMA_ROOT/tools/releases/templates/LICENSE \
$KUMA_ROOT/tools/releases/templates/README \
COPY /tools/releases/templates/LICENSE \
/tools/releases/templates/README \
/kuma/

COPY $KUMA_ROOT/tools/releases/templates/NOTICE-kumactl /kuma/NOTICE
COPY /tools/releases/templates/NOTICE-kumactl /kuma/NOTICE

RUN addgroup -S -g 6789 kumactl \
&& adduser -S -D -G kumactl -u 6789 kumactl
Expand Down
12 changes: 12 additions & 0 deletions tools/releases/helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ GH_PAGES_BRANCH="gh-pages"
# version:
# with the git commit suffix, if the kuma version has a git commit suffix
# otherwise it leaves version alone, assuming it's been chosen intentionally
# dependencies:
# for any dependency $chart where charts/$chart exists, it deletes $chart from
# .dependencies so that the embedded $chart is used and not the one fetched
# from the repository. `cr` fetches explicit dependencies and they take
# precedence over embedded files.
function dev_version {
for dir in "${CHARTS_DIR}"/*; do
if [ ! -d "${dir}" ]; then
Expand All @@ -32,6 +37,13 @@ function dev_version {

IFS=- read -r _version_core version_extra <<< "${kuma_version}"

for chart in $(yq e '.dependencies[].name' "${dir}/Chart.yaml"); do
if [ ! -d "${dir}/charts/${chart}" ]; then
continue
fi
yq -i e "del(.dependencies[] | select(.name == \"${chart}\"))" "${dir}/Chart.yaml"
done

chart_version=$(yq '.version' "${dir}/Chart.yaml")

# helm is semver-friendly, so we tweak the version.sh output a bit
Expand Down

0 comments on commit 9441a9a

Please sign in to comment.