From d4be411a8105601cdbbdc1c3f2c9ace88061804f Mon Sep 17 00:00:00 2001 From: Carlos de Paula Date: Wed, 18 Mar 2020 16:58:42 -0300 Subject: [PATCH] Bump images to latest versions --- image_sources_versions.jsonnet | 14 +- .../0prometheus-operator-clusterRole.yaml | 2 +- ...rometheus-operator-clusterRoleBinding.yaml | 2 +- .../0prometheus-operator-deployment.yaml | 10 +- manifests/0prometheus-operator-service.yaml | 2 +- .../0prometheus-operator-serviceAccount.yaml | 2 +- manifests/kube-state-metrics-clusterRole.yaml | 2 +- ...kube-state-metrics-clusterRoleBinding.yaml | 2 +- manifests/kube-state-metrics-deployment.yaml | 10 +- manifests/kube-state-metrics-service.yaml | 2 +- .../kube-state-metrics-serviceAccount.yaml | 2 +- .../kube-state-metrics-serviceMonitor.yaml | 2 +- manifests/node-exporter-daemonset.yaml | 2 +- manifests/prometheus-adapter-deployment.yaml | 2 +- .../prometheus-operator-serviceMonitor.yaml | 4 +- scripts/build_images.sh | 359 +++++++----------- 16 files changed, 173 insertions(+), 246 deletions(-) diff --git a/image_sources_versions.jsonnet b/image_sources_versions.jsonnet index 209019b..1961e0d 100644 --- a/image_sources_versions.jsonnet +++ b/image_sources_versions.jsonnet @@ -3,15 +3,15 @@ versions+:: { prometheus: 'v2.16.0', alertmanager: 'v0.20.0', - kubeStateMetrics: '1.7.2', - kubeRbacProxy: 'v0.4.1', - addonResizer: 'v1.8.4', + kubeStateMetrics: '1.9.5', + kubeRbacProxy: 'v0.5.0', + addonResizer: '2.3', nodeExporter: 'v0.18.1', - prometheusOperator: 'v0.31.1', - prometheusAdapter: 'v0.5.0', + prometheusOperator: 'v0.37.0', + prometheusAdapter: 'v0.6.0', grafana: '6.6.2', - configmapReloader: 'v0.2.2', - prometheusConfigReloader: 'v0.31.1', + configmapReloader: 'latest', + prometheusConfigReloader: 'v0.37.0', armExporter: 'latest', smtpServer: 'v1.0.1', elasticExporter: '1.0.4rc1', diff --git a/manifests/0prometheus-operator-clusterRole.yaml b/manifests/0prometheus-operator-clusterRole.yaml index 2b7898d..733d194 100644 --- a/manifests/0prometheus-operator-clusterRole.yaml +++ b/manifests/0prometheus-operator-clusterRole.yaml @@ -4,7 +4,7 @@ metadata: labels: app.kubernetes.io/component: controller app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.31.1 + app.kubernetes.io/version: v0.37.0 name: prometheus-operator rules: - apiGroups: diff --git a/manifests/0prometheus-operator-clusterRoleBinding.yaml b/manifests/0prometheus-operator-clusterRoleBinding.yaml index 5c29081..274e09e 100644 --- a/manifests/0prometheus-operator-clusterRoleBinding.yaml +++ b/manifests/0prometheus-operator-clusterRoleBinding.yaml @@ -4,7 +4,7 @@ metadata: labels: app.kubernetes.io/component: controller app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.31.1 + app.kubernetes.io/version: v0.37.0 name: prometheus-operator roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/manifests/0prometheus-operator-deployment.yaml b/manifests/0prometheus-operator-deployment.yaml index b74c46a..1161432 100644 --- a/manifests/0prometheus-operator-deployment.yaml +++ b/manifests/0prometheus-operator-deployment.yaml @@ -4,7 +4,7 @@ metadata: labels: app.kubernetes.io/component: controller app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.31.1 + app.kubernetes.io/version: v0.37.0 name: prometheus-operator namespace: monitoring spec: @@ -18,15 +18,15 @@ spec: labels: app.kubernetes.io/component: controller app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.31.1 + app.kubernetes.io/version: v0.37.0 spec: containers: - args: - --kubelet-service=kube-system/kubelet - --logtostderr=true - - --config-reloader-image=carlosedp/configmap-reload:v0.2.2 - - --prometheus-config-reloader=carlosedp/prometheus-config-reloader:v0.31.1 - image: carlosedp/prometheus-operator:v0.31.1 + - --config-reloader-image=carlosedp/configmap-reload:latest + - --prometheus-config-reloader=carlosedp/prometheus-config-reloader:v0.37.0 + image: carlosedp/prometheus-operator:v0.37.0 name: prometheus-operator ports: - containerPort: 8080 diff --git a/manifests/0prometheus-operator-service.yaml b/manifests/0prometheus-operator-service.yaml index c5aef6b..071210b 100644 --- a/manifests/0prometheus-operator-service.yaml +++ b/manifests/0prometheus-operator-service.yaml @@ -4,7 +4,7 @@ metadata: labels: app.kubernetes.io/component: controller app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.31.1 + app.kubernetes.io/version: v0.37.0 name: prometheus-operator namespace: monitoring spec: diff --git a/manifests/0prometheus-operator-serviceAccount.yaml b/manifests/0prometheus-operator-serviceAccount.yaml index 0462b1e..c009ad4 100644 --- a/manifests/0prometheus-operator-serviceAccount.yaml +++ b/manifests/0prometheus-operator-serviceAccount.yaml @@ -4,6 +4,6 @@ metadata: labels: app.kubernetes.io/component: controller app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.31.1 + app.kubernetes.io/version: v0.37.0 name: prometheus-operator namespace: monitoring diff --git a/manifests/kube-state-metrics-clusterRole.yaml b/manifests/kube-state-metrics-clusterRole.yaml index 0c7e28d..a365fee 100644 --- a/manifests/kube-state-metrics-clusterRole.yaml +++ b/manifests/kube-state-metrics-clusterRole.yaml @@ -3,7 +3,7 @@ kind: ClusterRole metadata: labels: app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 1.7.2 + app.kubernetes.io/version: 1.9.5 name: kube-state-metrics rules: - apiGroups: diff --git a/manifests/kube-state-metrics-clusterRoleBinding.yaml b/manifests/kube-state-metrics-clusterRoleBinding.yaml index cc144a2..ddf6bc6 100644 --- a/manifests/kube-state-metrics-clusterRoleBinding.yaml +++ b/manifests/kube-state-metrics-clusterRoleBinding.yaml @@ -3,7 +3,7 @@ kind: ClusterRoleBinding metadata: labels: app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 1.7.2 + app.kubernetes.io/version: 1.9.5 name: kube-state-metrics roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/manifests/kube-state-metrics-deployment.yaml b/manifests/kube-state-metrics-deployment.yaml index 44556a2..d210a5a 100644 --- a/manifests/kube-state-metrics-deployment.yaml +++ b/manifests/kube-state-metrics-deployment.yaml @@ -3,7 +3,7 @@ kind: Deployment metadata: labels: app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 1.7.2 + app.kubernetes.io/version: 1.9.5 name: kube-state-metrics namespace: monitoring spec: @@ -15,7 +15,7 @@ spec: metadata: labels: app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 1.7.2 + app.kubernetes.io/version: 1.9.5 spec: containers: - args: @@ -23,7 +23,7 @@ spec: - --port=8081 - --telemetry-host=127.0.0.1 - --telemetry-port=8082 - image: carlosedp/kube-state-metrics:v1.7.2 + image: carlosedp/kube-state-metrics:v1.9.5 name: kube-state-metrics securityContext: runAsUser: 65534 @@ -32,7 +32,7 @@ spec: - --secure-listen-address=:8443 - --tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - --upstream=http://127.0.0.1:8081/ - image: carlosedp/kube-rbac-proxy:v0.4.1 + image: carlosedp/kube-rbac-proxy:v0.5.0 name: kube-rbac-proxy-main ports: - containerPort: 8443 @@ -44,7 +44,7 @@ spec: - --secure-listen-address=:9443 - --tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - --upstream=http://127.0.0.1:8082/ - image: carlosedp/kube-rbac-proxy:v0.4.1 + image: carlosedp/kube-rbac-proxy:v0.5.0 name: kube-rbac-proxy-self ports: - containerPort: 9443 diff --git a/manifests/kube-state-metrics-service.yaml b/manifests/kube-state-metrics-service.yaml index 4b99bd4..59881ce 100644 --- a/manifests/kube-state-metrics-service.yaml +++ b/manifests/kube-state-metrics-service.yaml @@ -3,7 +3,7 @@ kind: Service metadata: labels: app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 1.7.2 + app.kubernetes.io/version: 1.9.5 name: kube-state-metrics namespace: monitoring spec: diff --git a/manifests/kube-state-metrics-serviceAccount.yaml b/manifests/kube-state-metrics-serviceAccount.yaml index 564a3f6..5dd13bb 100644 --- a/manifests/kube-state-metrics-serviceAccount.yaml +++ b/manifests/kube-state-metrics-serviceAccount.yaml @@ -3,6 +3,6 @@ kind: ServiceAccount metadata: labels: app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 1.7.2 + app.kubernetes.io/version: 1.9.5 name: kube-state-metrics namespace: monitoring diff --git a/manifests/kube-state-metrics-serviceMonitor.yaml b/manifests/kube-state-metrics-serviceMonitor.yaml index ad5880c..f84324e 100644 --- a/manifests/kube-state-metrics-serviceMonitor.yaml +++ b/manifests/kube-state-metrics-serviceMonitor.yaml @@ -3,7 +3,7 @@ kind: ServiceMonitor metadata: labels: app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 1.7.2 + app.kubernetes.io/version: 1.9.5 name: kube-state-metrics namespace: monitoring spec: diff --git a/manifests/node-exporter-daemonset.yaml b/manifests/node-exporter-daemonset.yaml index 6e15dc6..a05a751 100644 --- a/manifests/node-exporter-daemonset.yaml +++ b/manifests/node-exporter-daemonset.yaml @@ -54,7 +54,7 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP - image: carlosedp/kube-rbac-proxy:v0.4.1 + image: carlosedp/kube-rbac-proxy:v0.5.0 name: kube-rbac-proxy ports: - containerPort: 9100 diff --git a/manifests/prometheus-adapter-deployment.yaml b/manifests/prometheus-adapter-deployment.yaml index c21be90..94ad383 100644 --- a/manifests/prometheus-adapter-deployment.yaml +++ b/manifests/prometheus-adapter-deployment.yaml @@ -25,7 +25,7 @@ spec: - --metrics-relist-interval=1m - --prometheus-url=http://prometheus-k8s.monitoring.svc:9090/ - --secure-port=6443 - image: carlosedp/k8s-prometheus-adapter:v0.5.0 + image: carlosedp/k8s-prometheus-adapter:v0.6.0 name: prometheus-adapter ports: - containerPort: 6443 diff --git a/manifests/prometheus-operator-serviceMonitor.yaml b/manifests/prometheus-operator-serviceMonitor.yaml index 468a815..0b8c037 100644 --- a/manifests/prometheus-operator-serviceMonitor.yaml +++ b/manifests/prometheus-operator-serviceMonitor.yaml @@ -4,7 +4,7 @@ metadata: labels: app.kubernetes.io/component: controller app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.31.1 + app.kubernetes.io/version: v0.37.0 name: prometheus-operator namespace: monitoring spec: @@ -15,4 +15,4 @@ spec: matchLabels: app.kubernetes.io/component: controller app.kubernetes.io/name: prometheus-operator - app.kubernetes.io/version: v0.31.1 + app.kubernetes.io/version: v0.37.0 diff --git a/scripts/build_images.sh b/scripts/build_images.sh index de7a3eb..5667a7d 100755 --- a/scripts/build_images.sh +++ b/scripts/build_images.sh @@ -7,298 +7,225 @@ export DOCKER_CLI_EXPERIMENTAL=enabled REPO=carlosedp -AOR_VERSION=2.1 -PROM_ADAPTER_VERSION=v0.5.0 -KSM_VERSION=v1.7.2 -PROM_OP_VERSION=v0.31.1 -KUBE_RBAC_VERSION=v0.4.1 -PROM_CONFIG_RELOADER_VERSION=v0.31.1 -CONFIGMAP_RELOAD_VERSION=v0.2.2 +export AOR_VERSION=2.3 +export PROM_ADAPTER_VERSION=v0.6.0 +export KSM_VERSION=v1.9.5 +export PROM_OP_VERSION=v0.37.0 +export KUBE_RBAC_VERSION=v0.5.0 +export PROM_CONFIG_RELOADER_VERSION=v0.37.0 +export CONFIGMAP_RELOAD_VERSION=latest #------------------------------------------------------------------------------- # Kubernetes addon-resizer # Retag Addon-resizer google images to have unified manifest on DockerHub -docker pull gcr.io/google-containers/addon-resizer-arm:$AOR_VERSION -docker pull gcr.io/google-containers/addon-resizer-arm64:$AOR_VERSION -docker pull gcr.io/google-containers/addon-resizer-amd64:$AOR_VERSION +ALL_ARCH=(amd64 arm arm64 ppc64le) +IMAGE=addon-resizer -docker tag gcr.io/google-containers/addon-resizer-arm:$AOR_VERSION $REPO/addon-resizer:$AOR_VERSION-arm -docker tag gcr.io/google-containers/addon-resizer-arm64:$AOR_VERSION $REPO/addon-resizer:$AOR_VERSION-arm64 -docker tag gcr.io/google-containers/addon-resizer-amd64:$AOR_VERSION $REPO/addon-resizer:$AOR_VERSION-amd64 +for arch in $ALL_ARCH; do + if [[ $arch == "arm" ]]; then archdocker="arm32v7"; + elif [[ $arch == "arm64" ]]; then archdocker="arm64v8"; + else archdocker="$arch"; fi + docker pull gcr.io/google-containers/$IMAGE-$arch:$AOR_VERSION + docker tag gcr.io/google-containers/$IMAGE-$arch:$AOR_VERSION $REPO/$IMAGE:$AOR_VERSION-$arch + docker push $REPO/$IMAGE:$AOR_VERSION-$arch +done -docker push $REPO/addon-resizer:$AOR_VERSION-arm -docker push $REPO/addon-resizer:$AOR_VERSION-arm64 -docker push $REPO/addon-resizer:$AOR_VERSION-amd64 -docker rmi gcr.io/google-containers/addon-resizer-arm:$AOR_VERSION -docker rmi gcr.io/google-containers/addon-resizer-arm64:$AOR_VERSION -docker rmi gcr.io/google-containers/addon-resizer-amd64:$AOR_VERSION -docker rmi $REPO/addon-resizer:$AOR_VERSION-arm -docker rmi $REPO/addon-resizer:$AOR_VERSION-arm64 -docker rmi $REPO/addon-resizer:$AOR_VERSION-amd64 +docker manifest create --amend $REPO/$IMAGE:$AOR_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$REPO/$IMAGE:$AOR_VERSION\-&~g"` +for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $REPO/$IMAGE:$AOR_VERSION $REPO/$IMAGE:$AOR_VERSION-$arch; done +docker manifest push --purge $REPO/$IMAGE:$AOR_VERSION -IMAGE=$REPO/addon-resizer -VERSION=$AOR_VERSION -ALL_ARCH='amd64 arm arm64' +for arch in $ALL_ARCH; do + docker rmi gcr.io/google-containers/$IMAGE-$arch:$AOR_VERSION + docker rmi $REPO/$IMAGE:$AOR_VERSION-$arch +done -docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"` -for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done -docker manifest push --purge $IMAGE:$VERSION #------------------------------------------------------------------------------- # Prometheus-adapter # Retag prometheus-adapter from directxman12 images to have unified manifest on DockerHub -docker pull directxman12/k8s-prometheus-adapter-arm:$PROM_ADAPTER_VERSION -docker pull directxman12/k8s-prometheus-adapter-arm64:$PROM_ADAPTER_VERSION -docker pull directxman12/k8s-prometheus-adapter-amd64:$PROM_ADAPTER_VERSION +ALL_ARCH=(amd64 arm arm64 ppc64le) +IMAGE=k8s-prometheus-adapter -docker tag directxman12/k8s-prometheus-adapter-arm:$PROM_ADAPTER_VERSION $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm -docker tag directxman12/k8s-prometheus-adapter-arm64:$PROM_ADAPTER_VERSION $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm64 -docker tag directxman12/k8s-prometheus-adapter-amd64:$PROM_ADAPTER_VERSION $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-amd64 +for arch in $ALL_ARCH; do + if [[ $arch == "arm" ]]; then archdocker="arm32v7"; + elif [[ $arch == "arm64" ]]; then archdocker="arm64v8"; + else archdocker="$arch"; fi + docker pull directxman12/$IMAGE-$arch:$PROM_ADAPTER_VERSION + docker tag directxman12/$IMAGE-$arch:$PROM_ADAPTER_VERSION $REPO/$IMAGE:$PROM_ADAPTER_VERSION-$arch + docker push $REPO/$IMAGE:$PROM_ADAPTER_VERSION-$arch +done -docker push $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm -docker push $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm64 -docker push $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-amd64 -docker rmi directxman12/k8s-prometheus-adapter-arm:$PROM_ADAPTER_VERSION -docker rmi directxman12/k8s-prometheus-adapter-arm64:$PROM_ADAPTER_VERSION -docker rmi directxman12/k8s-prometheus-adapter-amd64:$PROM_ADAPTER_VERSION -docker rmi $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm -docker rmi $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm64 -docker rmi $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-amd64 +docker manifest create --amend $REPO/$IMAGE:$PROM_ADAPTER_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$REPO/$IMAGE:$PROM_ADAPTER_VERSION\-&~g"` +for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $REPO/$IMAGE:$PROM_ADAPTER_VERSION $REPO/$IMAGE:$PROM_ADAPTER_VERSION-$arch; done +docker manifest push --purge $REPO/$IMAGE:$PROM_ADAPTER_VERSION -IMAGE=$REPO/k8s-prometheus-adapter -VERSION=$PROM_ADAPTER_VERSION -ALL_ARCH='amd64 arm arm64' +for arch in $ALL_ARCH; do + docker rmi directxman12/$IMAGE-$arch:$PROM_ADAPTER_VERSION + docker rmi $REPO/$IMAGE:$PROM_ADAPTER_VERSION-$arch +done -docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"` -for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done -docker manifest push --purge $IMAGE:$VERSION #------------------------------------------------------------------------------- # Kube-state-metrics - IMAGE=carlosedp/kube-state-metrics -ALL_ARCH='amd64 arm arm64' -VERSION=$KSM_VERSION +ALL_ARCH=(amd64 arm arm64 ppc64le) rm -rf $GOPATH/src/k8s.io/kube-state-metrics mkdir $GOPATH/src/k8s.io/ pushd $GOPATH/src/k8s.io/ -git clone https://github.com/kubernetes/kube-state-metrics +git clone https://github.com/kubernetes/kube-state-metrics -b $KSM_VERSION --depth=1 cd kube-state-metrics -git checkout ${KSM_VERSION} -CGO_ENABLED=0 GOOS=linux GOARCH=arm go build . -docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-arm . +for arch in $ALL_ARCH; do + if [[ $arch == "arm" ]]; then archdocker="arm32v7"; + elif [[ $arch == "arm64" ]]; then archdocker="arm64v8"; + else archdocker="$arch"; fi -CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build . -docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-arm64 . + CGO_ENABLED=0 GOOS=linux GOARCH=$arch go build -a -installsuffix cgo -ldflags '-s -w -extldflags "-static"' -o kube-state-metrics . + docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-$arch . + docker push $REPO/kube-state-metrics:$KSM_VERSION-$arch +done -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' . -docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-amd64 . +docker manifest create --amend $IMAGE:$KSM_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$KSM_VERSION\-&~g"` +for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$KSM_VERSION $IMAGE:$KSM_VERSION-$arch; done +docker manifest push --purge $IMAGE:$KSM_VERSION -docker push $REPO/kube-state-metrics:$KSM_VERSION-arm -docker push $REPO/kube-state-metrics:$KSM_VERSION-arm64 -docker push $REPO/kube-state-metrics:$KSM_VERSION-amd64 - -docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"` -for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done -docker manifest push --purge $IMAGE:$VERSION +for arch in $ALL_ARCH; do + docker rmi $REPO/kube-state-metrics:$KSM_VERSION-$arch +done popd #------------------------------------------------------------------------------- # Prometheus-operator IMAGE=carlosedp/prometheus-operator -ALL_ARCH='amd64 arm arm64' -VERSION=$PROM_OP_VERSION +ALL_ARCH=(amd64 arm arm64 ppc64le) rm -rf $GOPATH/src/github.com/coreos/prometheus-operator -mkdir $GOPATH/src/github.com/coreos/ +mkdir -p $GOPATH/src/github.com/coreos/ pushd $GOPATH/src/github.com/coreos/ -git clone https://github.com/coreos/prometheus-operator +git clone https://github.com/coreos/prometheus-operator -b $PROM_OP_VERSION --depth=1 cd prometheus-operator -git checkout ${VERSION} -go get -u github.com/prometheus/promu +for arch in $ALL_ARCH; do + if [[ $arch == "arm" ]]; then archdocker="arm32v7"; + elif [[ $arch == "arm64" ]]; then archdocker="arm64v8"; + else archdocker="$arch"; fi -cat Dockerfile |sed -e 's/\.build\/linux-amd64\/operator/operator/' |sed -e 's/^FROM.*/FROM arm32v6\/busybox/' > Dockerfile.arm + cat Dockerfile |sed -e 's/\.build\/linux-amd64\/operator/operator/' |sed -e "s/^FROM.*/FROM $archdocker\/busybox/" > Dockerfile.custom + CGO_ENABLED=0 GOOS=linux GOARCH=$arch go build -ldflags="-s -X github.com/coreos/prometheus-operator/pkg/version.Version=$(cat VERSION | tr -d " \t\n\r")" -o operator cmd/operator/main.go + rm -rf operator + docker build -t $REPO/prometheus-operator:${PROM_OP_VERSION}-$arch -f Dockerfile.custom . + docker push $REPO/prometheus-operator:$PROM_OP_VERSION-arm +done -cat Dockerfile |sed -e 's/\.build\/linux-amd64\/operator/operator/' |sed -e 's/^FROM.*/FROM arm64v8\/busybox/' > Dockerfile.arm64 -cat Dockerfile |sed -e 's/\.build\/linux-amd64\/operator/operator/' |sed -e 's/^FROM.*/FROM amd64\/busybox/' > Dockerfile.amd64 +docker manifest create --amend $IMAGE:$PROM_OP_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$PROM_OP_VERSION\-&~g"` +for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$PROM_OP_VERSION $IMAGE:$PROM_OP_VERSION-$arch; done +docker manifest push --purge $IMAGE:$PROM_OP_VERSION -GOOS=linux GOARCH=arm $GOPATH/bin/promu build --prefix `pwd` -docker build -t $REPO/prometheus-operator:${VERSION}-arm -f Dockerfile.arm . +for arch in $ALL_ARCH; do + docker rmi $REPO/prometheus-operator:$PROM_OP_VERSION-$arch +done -GOOS=linux GOARCH=arm64 $GOPATH/bin/promu build --prefix `pwd` -docker build -t $REPO/prometheus-operator:${VERSION}-arm64 -f Dockerfile.arm64 . - -GOOS=linux GOARCH=amd64 $GOPATH/bin/promu build --prefix `pwd` -docker build -t $REPO/prometheus-operator:${VERSION}-amd64 -f Dockerfile.amd64 . - -docker push $REPO/prometheus-operator:$VERSION-arm -docker push $REPO/prometheus-operator:$VERSION-arm64 -docker push $REPO/prometheus-operator:$VERSION-amd64 - -docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"` -for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done -docker manifest push --purge $IMAGE:$VERSION - -rm Dockerfile.arm -rm Dockerfile.arm64 -rm Dockerfile.amd64 +rm -rf Dockerfile.custom popd #------------------------------------------------------------------------------- # kube-rbac-proxy IMAGE=carlosedp/kube-rbac-proxy -VERSION=$KUBE_RBAC_VERSION -ALL_ARCH='amd64 arm arm64' +ALL_ARCH=(amd64 arm arm64 ppc64le) -go get github.com/brancz/kube-rbac-proxy -cd $HOME/go/src/github.com/brancz/kube-rbac-proxy -git fetch -git checkout ${VERSION} +rm -rf $GOPATH/src/github.com/brancz/ +mkdir -p $GOPATH/src/github.com/brancz/ +pushd $GOPATH/src/github.com/brancz/ +git clone https://github.com/brancz/kube-rbac-proxy -b $KUBE_RBAC_VERSION --depth=1 +cd kube-rbac-proxy -cat > Dockerfile.arm < Dockerfile.arm64 < Dockerfile.custom < Dockerfile.amd64 < Dockerfile.arm +for arch in $ALL_ARCH; do + if [[ $arch == "arm" ]]; then archdocker="arm32v7"; + elif [[ $arch == "arm64" ]]; then archdocker="arm64v8"; + else archdocker="$arch"; fi + cat Dockerfile | sed -e "s/^FROM.*/FROM $archdocker\/busybox/" > Dockerfile.custom + GOOS=linux GOARCH=$arch CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s -w -extldflags "-static"' -o prometheus-config-reloader main.go + docker build -t $IMAGE:$PROM_CONFIG_RELOADER_VERSION-$arch -f Dockerfile.custom . + docker push $IMAGE:$PROM_CONFIG_RELOADER_VERSION-$arch +done +docker manifest create --amend $IMAGE:$PROM_CONFIG_RELOADER_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$PROM_CONFIG_RELOADER_VERSION\-&~g"` +for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$PROM_CONFIG_RELOADER_VERSION $IMAGE:$PROM_CONFIG_RELOADER_VERSION-$arch; done +docker manifest push --purge $IMAGE:$PROM_CONFIG_RELOADER_VERSION -wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-arm-static -wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-aarch64-static -chmod +x qemu* +for arch in $ALL_ARCH; do + docker rmi $IMAGE:$PROM_CONFIG_RELOADER_VERSION-$arch +done -cat Dockerfile.new |sed -e 's/^FROM.*/FROM arm32v6\/busybox/'|sed -e 's/ADD operator.*/ADD prometheus-config-reloader \/bin\/prometheus-config-reloader/' |sed -e 's/^ENTRYPOINT.*/ENTRYPOINT \["\/bin\/prometheus-config-reloader"\]/' > Dockerfile.arm - -cat Dockerfile.new |sed -e 's/^FROM.*/FROM arm64v8\/busybox/'|sed -e 's/ADD operator.*/ADD prometheus-config-reloader \/bin\/prometheus-config-reloader/' |sed -e 's/^ENTRYPOINT.*/ENTRYPOINT \["\/bin\/prometheus-config-reloader"\]/' > Dockerfile.arm64 - -cat Dockerfile.new |sed -e 's/^FROM.*/FROM amd64\/busybox/'|sed -e 's/ADD operator.*/ADD prometheus-config-reloader \/bin\/prometheus-config-reloader/' |sed -e 's/^ENTRYPOINT.*/ENTRYPOINT \["\/bin\/prometheus-config-reloader"\]/' > Dockerfile.amd64 - -GOOS=linux GOARCH=arm CGO_ENABLED=0 go build -o prometheus-config-reloader main.go -docker build -t $IMAGE:$VERSION-arm -f Dockerfile.arm . - -GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o prometheus-config-reloader main.go -docker build -t $IMAGE:$VERSION-arm64 -f Dockerfile.arm64 . - -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o prometheus-config-reloader main.go -docker build -t $IMAGE:$VERSION-amd64 -f Dockerfile.amd64 . - -docker push $IMAGE:$VERSION-arm -docker push $IMAGE:$VERSION-arm64 -docker push $IMAGE:$VERSION-amd64 - -docker manifest create --amend $IMAGE:$VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$VERSION\-&~g"` -for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$VERSION $IMAGE:$VERSION-$arch; done -docker manifest push --purge $IMAGE:$VERSION - -rm Dockerfile.arm -rm Dockerfile.arm64 -rm Dockerfile.amd64 -rm Dockerfile.new +rm -rf Dockerfile.custom #------------------------------------------------------------------------------- # configmap-reload IMAGE=carlosedp/configmap-reload -VERSION=$CONFIGMAP_RELOAD_VERSION -ALL_ARCH='amd64 arm arm64' +ALL_ARCH=(amd64 arm arm64 ppc64le) -go get github.com/openshift/configmap-reload -cd $HOME/go/src/github.com/openshift/configmap-reload -git fetch -git checkout ${VERSION} +rm -rf $GOPATH/src/github.com/openshift/configmap-reload +mkdir -p $GOPATH/src/github.com/openshift/ +pushd $GOPATH/src/github.com/openshift/ +git clone https://github.com/openshift/configmap-reload +cd configmap-reload -cat > Dockerfile.arm < Dockerfile.custom < Dockerfile.arm64 < Dockerfile.amd64 <