-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
✨ add new build for new k8s registry infra-prow #3362
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:kube-rbac-proxy-releases
from
camilamacedo86:kube-rbac-proxy-releases-new
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,50 @@ | ||
# Copyright 2021 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. | ||
|
||
#!/usr/bin/env bash | ||
|
||
# This script effectively retags the quay.io/brancz/kube-rbac-proxy image | ||
# as a grc.io/kubebuilder registry image and pushes it (and all constituent images). | ||
# This script cannot be inlined due to: | ||
# https://github.com/GoogleCloudPlatform/cloud-build-local/issues/129 | ||
|
||
set -eu | ||
|
||
SOURCE_IMAGE_TAG="quay.io/brancz/kube-rbac-proxy:${KUBE_RBAC_PROXY_VERSION}" | ||
TARGET_IMAGE_TAG="gcr.io/kubebuilder/kube-rbac-proxy:${KUBE_RBAC_PROXY_VERSION}" | ||
|
||
# Each arch to pull an image for. | ||
declare ARCHES | ||
ARCHES=( amd64 arm64 ppc64le s390x ) | ||
|
||
declare IMAGES | ||
for a in ${ARCHES[@]}; do | ||
docker pull "${SOURCE_IMAGE_TAG}-$a" | ||
docker tag "${SOURCE_IMAGE_TAG}-$a" "${TARGET_IMAGE_TAG}-$a" | ||
# These images must exist remotely to build a manifest list. | ||
docker push "${TARGET_IMAGE_TAG}-$a" | ||
# weird syntax for bash<4.4 | ||
IMAGES=( ${IMAGES[@]+"${IMAGES[@]}"} "${TARGET_IMAGE_TAG}-$a" ) | ||
done | ||
|
||
# `manifest` is an experimental CLI feature. | ||
export DOCKER_CLI_EXPERIMENTAL=enabled | ||
|
||
# If $TARGET_IMAGE_TAG exists, `manifest create` will fail. | ||
docker manifest rm "$TARGET_IMAGE_TAG" || true | ||
docker manifest create "$TARGET_IMAGE_TAG" ${IMAGES[@]} | ||
for a in ${ARCHES[@]}; do | ||
docker manifest annotate "$TARGET_IMAGE_TAG" "${TARGET_IMAGE_TAG}-$a" --arch $a | ||
done | ||
docker manifest push "$TARGET_IMAGE_TAG" |
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 @@ | ||
# Copyright 2021 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. | ||
|
||
substitutions: | ||
# This is the kube-rbac-proxy version, source image tags for which must exist remotely. | ||
_KUBE_RBAC_PROXY_VERSION: v0.14.1 | ||
steps: | ||
- name: "gcr.io/cloud-builders/docker" | ||
env: | ||
- "KUBE_RBAC_PROXY_VERSION=${_KUBE_RBAC_PROXY_VERSION}" | ||
entrypoint: "/usr/bin/env" | ||
args: ["bash", "-c", "./build-legacy/build.sh"] | ||
images: ["gcr.io/kubebuilder/kube-rbac-proxy:${_KUBE_RBAC_PROXY_VERSION}"] |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rikatz,
See that I just changed the step name and image to be built.
Is that right? We need to:
docker pull k8s.io/kubebuilder/kube-rbac-proxy:<TAG>
c/c @varshaprasad96 @yashsingh74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost 100% :)
(and I am almost 100% sure on what I am saying!)
the one thing that we do in ingress is to do the push from the build script, and not from the cloudbuild job.
Take a look in https://github.com/kubernetes/ingress-nginx/blob/main/cloudbuild.yaml#L17-L21
We need a credential to push the image (so this is the
gcloud auth ....
) and after this, the container is able to push images, so our release just calls "docker buildx" to build the image and push it:https://github.com/kubernetes/ingress-nginx/blob/main/Makefile#L235
The thing to be clear here is:
Anyway, we can get that PR on test-infra merged, and test the things from this branch later. it is a staging repo anyway :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the image to re-tag it see
gcr.io/kubebuilder/kube-rbac-proxy
the above one. So, I don't know how we would use it anymore. Maybe I am missing something.See that we download quay.io/brancz/kube-rbac-proxy from https://github.com/brancz/kube-rbac-proxy and then rebuild it with a new tag so that we can store that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
images
field is not required but can be useful to explicitly declare the name of the image(s) you want to build.