Bump images to latest versions

This commit is contained in:
Carlos de Paula 2020-03-18 16:58:42 -03:00
parent fe61d99a73
commit d4be411a81
16 changed files with 173 additions and 246 deletions

View File

@ -3,15 +3,15 @@
versions+:: { versions+:: {
prometheus: 'v2.16.0', prometheus: 'v2.16.0',
alertmanager: 'v0.20.0', alertmanager: 'v0.20.0',
kubeStateMetrics: '1.7.2', kubeStateMetrics: '1.9.5',
kubeRbacProxy: 'v0.4.1', kubeRbacProxy: 'v0.5.0',
addonResizer: 'v1.8.4', addonResizer: '2.3',
nodeExporter: 'v0.18.1', nodeExporter: 'v0.18.1',
prometheusOperator: 'v0.31.1', prometheusOperator: 'v0.37.0',
prometheusAdapter: 'v0.5.0', prometheusAdapter: 'v0.6.0',
grafana: '6.6.2', grafana: '6.6.2',
configmapReloader: 'v0.2.2', configmapReloader: 'latest',
prometheusConfigReloader: 'v0.31.1', prometheusConfigReloader: 'v0.37.0',
armExporter: 'latest', armExporter: 'latest',
smtpServer: 'v1.0.1', smtpServer: 'v1.0.1',
elasticExporter: '1.0.4rc1', elasticExporter: '1.0.4rc1',

View File

@ -4,7 +4,7 @@ metadata:
labels: labels:
app.kubernetes.io/component: controller app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.31.1 app.kubernetes.io/version: v0.37.0
name: prometheus-operator name: prometheus-operator
rules: rules:
- apiGroups: - apiGroups:

View File

@ -4,7 +4,7 @@ metadata:
labels: labels:
app.kubernetes.io/component: controller app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.31.1 app.kubernetes.io/version: v0.37.0
name: prometheus-operator name: prometheus-operator
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io

View File

@ -4,7 +4,7 @@ metadata:
labels: labels:
app.kubernetes.io/component: controller app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.31.1 app.kubernetes.io/version: v0.37.0
name: prometheus-operator name: prometheus-operator
namespace: monitoring namespace: monitoring
spec: spec:
@ -18,15 +18,15 @@ spec:
labels: labels:
app.kubernetes.io/component: controller app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.31.1 app.kubernetes.io/version: v0.37.0
spec: spec:
containers: containers:
- args: - args:
- --kubelet-service=kube-system/kubelet - --kubelet-service=kube-system/kubelet
- --logtostderr=true - --logtostderr=true
- --config-reloader-image=carlosedp/configmap-reload:v0.2.2 - --config-reloader-image=carlosedp/configmap-reload:latest
- --prometheus-config-reloader=carlosedp/prometheus-config-reloader:v0.31.1 - --prometheus-config-reloader=carlosedp/prometheus-config-reloader:v0.37.0
image: carlosedp/prometheus-operator:v0.31.1 image: carlosedp/prometheus-operator:v0.37.0
name: prometheus-operator name: prometheus-operator
ports: ports:
- containerPort: 8080 - containerPort: 8080

View File

@ -4,7 +4,7 @@ metadata:
labels: labels:
app.kubernetes.io/component: controller app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.31.1 app.kubernetes.io/version: v0.37.0
name: prometheus-operator name: prometheus-operator
namespace: monitoring namespace: monitoring
spec: spec:

View File

@ -4,6 +4,6 @@ metadata:
labels: labels:
app.kubernetes.io/component: controller app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.31.1 app.kubernetes.io/version: v0.37.0
name: prometheus-operator name: prometheus-operator
namespace: monitoring namespace: monitoring

View File

@ -3,7 +3,7 @@ kind: ClusterRole
metadata: metadata:
labels: labels:
app.kubernetes.io/name: kube-state-metrics 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 name: kube-state-metrics
rules: rules:
- apiGroups: - apiGroups:

View File

@ -3,7 +3,7 @@ kind: ClusterRoleBinding
metadata: metadata:
labels: labels:
app.kubernetes.io/name: kube-state-metrics 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 name: kube-state-metrics
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io

View File

@ -3,7 +3,7 @@ kind: Deployment
metadata: metadata:
labels: labels:
app.kubernetes.io/name: kube-state-metrics 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 name: kube-state-metrics
namespace: monitoring namespace: monitoring
spec: spec:
@ -15,7 +15,7 @@ spec:
metadata: metadata:
labels: labels:
app.kubernetes.io/name: kube-state-metrics app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.7.2 app.kubernetes.io/version: 1.9.5
spec: spec:
containers: containers:
- args: - args:
@ -23,7 +23,7 @@ spec:
- --port=8081 - --port=8081
- --telemetry-host=127.0.0.1 - --telemetry-host=127.0.0.1
- --telemetry-port=8082 - --telemetry-port=8082
image: carlosedp/kube-state-metrics:v1.7.2 image: carlosedp/kube-state-metrics:v1.9.5
name: kube-state-metrics name: kube-state-metrics
securityContext: securityContext:
runAsUser: 65534 runAsUser: 65534
@ -32,7 +32,7 @@ spec:
- --secure-listen-address=:8443 - --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 - --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/ - --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 name: kube-rbac-proxy-main
ports: ports:
- containerPort: 8443 - containerPort: 8443
@ -44,7 +44,7 @@ spec:
- --secure-listen-address=:9443 - --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 - --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/ - --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 name: kube-rbac-proxy-self
ports: ports:
- containerPort: 9443 - containerPort: 9443

View File

@ -3,7 +3,7 @@ kind: Service
metadata: metadata:
labels: labels:
app.kubernetes.io/name: kube-state-metrics 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 name: kube-state-metrics
namespace: monitoring namespace: monitoring
spec: spec:

View File

@ -3,6 +3,6 @@ kind: ServiceAccount
metadata: metadata:
labels: labels:
app.kubernetes.io/name: kube-state-metrics 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 name: kube-state-metrics
namespace: monitoring namespace: monitoring

View File

@ -3,7 +3,7 @@ kind: ServiceMonitor
metadata: metadata:
labels: labels:
app.kubernetes.io/name: kube-state-metrics 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 name: kube-state-metrics
namespace: monitoring namespace: monitoring
spec: spec:

View File

@ -54,7 +54,7 @@ spec:
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: status.podIP fieldPath: status.podIP
image: carlosedp/kube-rbac-proxy:v0.4.1 image: carlosedp/kube-rbac-proxy:v0.5.0
name: kube-rbac-proxy name: kube-rbac-proxy
ports: ports:
- containerPort: 9100 - containerPort: 9100

View File

@ -25,7 +25,7 @@ spec:
- --metrics-relist-interval=1m - --metrics-relist-interval=1m
- --prometheus-url=http://prometheus-k8s.monitoring.svc:9090/ - --prometheus-url=http://prometheus-k8s.monitoring.svc:9090/
- --secure-port=6443 - --secure-port=6443
image: carlosedp/k8s-prometheus-adapter:v0.5.0 image: carlosedp/k8s-prometheus-adapter:v0.6.0
name: prometheus-adapter name: prometheus-adapter
ports: ports:
- containerPort: 6443 - containerPort: 6443

View File

@ -4,7 +4,7 @@ metadata:
labels: labels:
app.kubernetes.io/component: controller app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.31.1 app.kubernetes.io/version: v0.37.0
name: prometheus-operator name: prometheus-operator
namespace: monitoring namespace: monitoring
spec: spec:
@ -15,4 +15,4 @@ spec:
matchLabels: matchLabels:
app.kubernetes.io/component: controller app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: v0.31.1 app.kubernetes.io/version: v0.37.0

View File

@ -7,298 +7,225 @@ export DOCKER_CLI_EXPERIMENTAL=enabled
REPO=carlosedp REPO=carlosedp
AOR_VERSION=2.1 export AOR_VERSION=2.3
PROM_ADAPTER_VERSION=v0.5.0 export PROM_ADAPTER_VERSION=v0.6.0
KSM_VERSION=v1.7.2 export KSM_VERSION=v1.9.5
PROM_OP_VERSION=v0.31.1 export PROM_OP_VERSION=v0.37.0
KUBE_RBAC_VERSION=v0.4.1 export KUBE_RBAC_VERSION=v0.5.0
PROM_CONFIG_RELOADER_VERSION=v0.31.1 export PROM_CONFIG_RELOADER_VERSION=v0.37.0
CONFIGMAP_RELOAD_VERSION=v0.2.2 export CONFIGMAP_RELOAD_VERSION=latest
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Kubernetes addon-resizer # Kubernetes addon-resizer
# Retag Addon-resizer google images to have unified manifest on DockerHub # Retag Addon-resizer google images to have unified manifest on DockerHub
docker pull gcr.io/google-containers/addon-resizer-arm:$AOR_VERSION ALL_ARCH=(amd64 arm arm64 ppc64le)
docker pull gcr.io/google-containers/addon-resizer-arm64:$AOR_VERSION IMAGE=addon-resizer
docker pull gcr.io/google-containers/addon-resizer-amd64:$AOR_VERSION
docker tag gcr.io/google-containers/addon-resizer-arm:$AOR_VERSION $REPO/addon-resizer:$AOR_VERSION-arm for arch in $ALL_ARCH; do
docker tag gcr.io/google-containers/addon-resizer-arm64:$AOR_VERSION $REPO/addon-resizer:$AOR_VERSION-arm64 if [[ $arch == "arm" ]]; then archdocker="arm32v7";
docker tag gcr.io/google-containers/addon-resizer-amd64:$AOR_VERSION $REPO/addon-resizer:$AOR_VERSION-amd64 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 manifest create --amend $REPO/$IMAGE:$AOR_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$REPO/$IMAGE:$AOR_VERSION\-&~g"`
docker rmi gcr.io/google-containers/addon-resizer-arm64:$AOR_VERSION for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $REPO/$IMAGE:$AOR_VERSION $REPO/$IMAGE:$AOR_VERSION-$arch; done
docker rmi gcr.io/google-containers/addon-resizer-amd64:$AOR_VERSION docker manifest push --purge $REPO/$IMAGE:$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
IMAGE=$REPO/addon-resizer for arch in $ALL_ARCH; do
VERSION=$AOR_VERSION docker rmi gcr.io/google-containers/$IMAGE-$arch:$AOR_VERSION
ALL_ARCH='amd64 arm arm64' 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 # Prometheus-adapter
# Retag prometheus-adapter from directxman12 images to have unified manifest on DockerHub # Retag prometheus-adapter from directxman12 images to have unified manifest on DockerHub
docker pull directxman12/k8s-prometheus-adapter-arm:$PROM_ADAPTER_VERSION ALL_ARCH=(amd64 arm arm64 ppc64le)
docker pull directxman12/k8s-prometheus-adapter-arm64:$PROM_ADAPTER_VERSION IMAGE=k8s-prometheus-adapter
docker pull directxman12/k8s-prometheus-adapter-amd64:$PROM_ADAPTER_VERSION
docker tag directxman12/k8s-prometheus-adapter-arm:$PROM_ADAPTER_VERSION $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm for arch in $ALL_ARCH; do
docker tag directxman12/k8s-prometheus-adapter-arm64:$PROM_ADAPTER_VERSION $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-arm64 if [[ $arch == "arm" ]]; then archdocker="arm32v7";
docker tag directxman12/k8s-prometheus-adapter-amd64:$PROM_ADAPTER_VERSION $REPO/k8s-prometheus-adapter:$PROM_ADAPTER_VERSION-amd64 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 manifest create --amend $REPO/$IMAGE:$PROM_ADAPTER_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$REPO/$IMAGE:$PROM_ADAPTER_VERSION\-&~g"`
docker rmi directxman12/k8s-prometheus-adapter-arm64:$PROM_ADAPTER_VERSION for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $REPO/$IMAGE:$PROM_ADAPTER_VERSION $REPO/$IMAGE:$PROM_ADAPTER_VERSION-$arch; done
docker rmi directxman12/k8s-prometheus-adapter-amd64:$PROM_ADAPTER_VERSION docker manifest push --purge $REPO/$IMAGE:$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
IMAGE=$REPO/k8s-prometheus-adapter for arch in $ALL_ARCH; do
VERSION=$PROM_ADAPTER_VERSION docker rmi directxman12/$IMAGE-$arch:$PROM_ADAPTER_VERSION
ALL_ARCH='amd64 arm arm64' 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 # Kube-state-metrics
IMAGE=carlosedp/kube-state-metrics IMAGE=carlosedp/kube-state-metrics
ALL_ARCH='amd64 arm arm64' ALL_ARCH=(amd64 arm arm64 ppc64le)
VERSION=$KSM_VERSION
rm -rf $GOPATH/src/k8s.io/kube-state-metrics rm -rf $GOPATH/src/k8s.io/kube-state-metrics
mkdir $GOPATH/src/k8s.io/ mkdir $GOPATH/src/k8s.io/
pushd $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 cd kube-state-metrics
git checkout ${KSM_VERSION}
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build . for arch in $ALL_ARCH; do
docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-arm . 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 . 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}-arm64 . 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 manifest create --amend $IMAGE:$KSM_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$KSM_VERSION\-&~g"`
docker build -t $REPO/kube-state-metrics:${KSM_VERSION}-amd64 . 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 for arch in $ALL_ARCH; do
docker push $REPO/kube-state-metrics:$KSM_VERSION-arm64 docker rmi $REPO/kube-state-metrics:$KSM_VERSION-$arch
docker push $REPO/kube-state-metrics:$KSM_VERSION-amd64 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
popd popd
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Prometheus-operator # Prometheus-operator
IMAGE=carlosedp/prometheus-operator IMAGE=carlosedp/prometheus-operator
ALL_ARCH='amd64 arm arm64' ALL_ARCH=(amd64 arm arm64 ppc64le)
VERSION=$PROM_OP_VERSION
rm -rf $GOPATH/src/github.com/coreos/prometheus-operator 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/ 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 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` for arch in $ALL_ARCH; do
docker build -t $REPO/prometheus-operator:${VERSION}-arm -f Dockerfile.arm . docker rmi $REPO/prometheus-operator:$PROM_OP_VERSION-$arch
done
GOOS=linux GOARCH=arm64 $GOPATH/bin/promu build --prefix `pwd` rm -rf Dockerfile.custom
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
popd popd
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# kube-rbac-proxy # kube-rbac-proxy
IMAGE=carlosedp/kube-rbac-proxy IMAGE=carlosedp/kube-rbac-proxy
VERSION=$KUBE_RBAC_VERSION ALL_ARCH=(amd64 arm arm64 ppc64le)
ALL_ARCH='amd64 arm arm64'
go get github.com/brancz/kube-rbac-proxy rm -rf $GOPATH/src/github.com/brancz/
cd $HOME/go/src/github.com/brancz/kube-rbac-proxy mkdir -p $GOPATH/src/github.com/brancz/
git fetch pushd $GOPATH/src/github.com/brancz/
git checkout ${VERSION} git clone https://github.com/brancz/kube-rbac-proxy -b $KUBE_RBAC_VERSION --depth=1
cd kube-rbac-proxy
cat > Dockerfile.arm <<EOF for arch in $ALL_ARCH; do
FROM arm32v6/alpine:3.8 if [[ $arch == "arm" ]]; then archdocker="arm32v7";
COPY qemu-arm-static /usr/bin/qemu-arm-static elif [[ $arch == "arm64" ]]; then archdocker="arm64v8";
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/* else archdocker="$arch"; fi
COPY kube-rbac-proxy . cat > Dockerfile.custom <<EOF
RUN rm /usr/bin/qemu-arm-static FROM $archdocker/alpine:3.11
ENTRYPOINT ["./kube-rbac-proxy"]
EXPOSE 8080
EOF
cat > Dockerfile.arm64 <<EOF
FROM arm64v8/alpine:3.8
COPY qemu-aarch64-static /usr/bin/qemu-aarch64-static
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/* RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/*
COPY kube-rbac-proxy . COPY kube-rbac-proxy .
ENTRYPOINT ["./kube-rbac-proxy"] ENTRYPOINT ["./kube-rbac-proxy"]
EXPOSE 8080 EXPOSE 8080
EOF EOF
GOOS=linux GOARCH=$arch make build
rm -rf kube-rbac-proxy
mv _output/linux/$arch/kube-rbac-proxy ./kube-rbac-proxy
docker build -t $IMAGE:$KUBE_RBAC_VERSION-$arch -f Dockerfile.custom .
docker push $IMAGE:$KUBE_RBAC_VERSION-$arch
done
cat > Dockerfile.amd64 <<EOF docker manifest create --amend $IMAGE:$KUBE_RBAC_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$KUBE_RBAC_VERSION\-&~g"`
FROM amd64/alpine:3.8 for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$KUBE_RBAC_VERSION $IMAGE:$KUBE_RBAC_VERSION-$arch; done
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/* docker manifest push --purge $IMAGE:$KUBE_RBAC_VERSION
COPY kube-rbac-proxy .
ENTRYPOINT ["./kube-rbac-proxy"]
EXPOSE 8080
EOF
docker run --rm --privileged multiarch/qemu-user-static:register --reset for arch in $ALL_ARCH; do
rm qemu-arm-static docker rmi $IMAGE:$KUBE_RBAC_VERSION-$arch
wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-arm-static done
chmod +x qemu-arm-static
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build .
docker build -t $IMAGE:$VERSION-arm -f Dockerfile.arm .
rm qemu-aarch64-static
wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-aarch64-static
chmod +x qemu-aarch64-static
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build .
docker build -t $IMAGE:$VERSION-arm64 -f Dockerfile.arm64 .
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' .
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
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# prometheus-config-reloader # prometheus-config-reloader
IMAGE=carlosedp/prometheus-config-reloader IMAGE=carlosedp/prometheus-config-reloader
ALL_ARCH=(amd64 arm arm64 ppc64le)
VERSION=$PROM_CONFIG_RELOADER_VERSION
ALL_ARCH='amd64 arm arm64'
pushd $GOPATH/src/github.com/coreos/prometheus-operator pushd $GOPATH/src/github.com/coreos/prometheus-operator
cd $GOPATH/src/github.com/coreos/prometheus-operator/cmd/prometheus-config-reloader cd $GOPATH/src/github.com/coreos/prometheus-operator/cmd/prometheus-config-reloader
git checkout ${VERSION} git checkout ${VERSION}
cp ../../Dockerfile ./Dockerfile.new for arch in $ALL_ARCH; do
cat Dockerfile.new |sed -e 's/ADD operator.*/ADD prometheus-config-reloader /bin/prometheus-config-reloader/' |sed -e 's/^ENTRYPOINT.*/ENTRYPOINT ["/bin/prometheus-config-reloader"]/' > Dockerfile.arm 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 for arch in $ALL_ARCH; do
wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-aarch64-static docker rmi $IMAGE:$PROM_CONFIG_RELOADER_VERSION-$arch
chmod +x qemu* 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 rm -rf Dockerfile.custom
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
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# configmap-reload # configmap-reload
IMAGE=carlosedp/configmap-reload IMAGE=carlosedp/configmap-reload
VERSION=$CONFIGMAP_RELOAD_VERSION ALL_ARCH=(amd64 arm arm64 ppc64le)
ALL_ARCH='amd64 arm arm64'
go get github.com/openshift/configmap-reload rm -rf $GOPATH/src/github.com/openshift/configmap-reload
cd $HOME/go/src/github.com/openshift/configmap-reload mkdir -p $GOPATH/src/github.com/openshift/
git fetch pushd $GOPATH/src/github.com/openshift/
git checkout ${VERSION} git clone https://github.com/openshift/configmap-reload
cd configmap-reload
cat > Dockerfile.arm <<EOF for arch in $ALL_ARCH; do
FROM arm32v6/busybox if [[ $arch == "arm" ]]; then archdocker="arm32v7";
COPY configmap-reload /configmap-reload elif [[ $arch == "arm64" ]]; then archdocker="arm64v8";
ENTRYPOINT ["/configmap-reload"] else archdocker="$arch"; fi
cat > Dockerfile.custom <<EOF
FROM $archdocker/busybox
COPY out/configmap-reload /usr/bin/configmap-reload
ENTRYPOINT ["/usr/bin/configmap-reload"]
EOF EOF
GOOS=linux GOARCH=$arch make
docker build -t $IMAGE:$CONFIGMAP_RELOAD_VERSION-$arch -f Dockerfile.custom .
docker push $IMAGE:$CONFIGMAP_RELOAD_VERSION-$arch
done
cat > Dockerfile.arm64 <<EOF docker manifest create --amend $IMAGE:$CONFIGMAP_RELOAD_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$CONFIGMAP_RELOAD_VERSION\-&~g"`
FROM arm64v8/busybox for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$CONFIGMAP_RELOAD_VERSION $IMAGE:$CONFIGMAP_RELOAD_VERSION-$arch; done
COPY configmap-reload /configmap-reload docker manifest push --purge $IMAGE:$CONFIGMAP_RELOAD_VERSION
ENTRYPOINT ["/configmap-reload"]
EOF
cat > Dockerfile.amd64 <<EOF for arch in $ALL_ARCH; do
FROM busybox docker rmi $IMAGE:$CONFIGMAP_RELOAD_VERSION-$arch
COPY configmap-reload /configmap-reload done
ENTRYPOINT ["/configmap-reload"]
EOF
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build . rm -rf Dockerfile.custom
docker build -t $IMAGE:$VERSION-arm -f Dockerfile.arm .
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build .
docker build -t $IMAGE:$VERSION-arm64 -f Dockerfile.arm64 .
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' .
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