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+:: {
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',

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <<EOF
FROM arm32v6/alpine:3.8
COPY qemu-arm-static /usr/bin/qemu-arm-static
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/*
COPY kube-rbac-proxy .
RUN rm /usr/bin/qemu-arm-static
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
for arch in $ALL_ARCH; do
if [[ $arch == "arm" ]]; then archdocker="arm32v7";
elif [[ $arch == "arm64" ]]; then archdocker="arm64v8";
else archdocker="$arch"; fi
cat > Dockerfile.custom <<EOF
FROM $archdocker/alpine:3.11
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/*
COPY kube-rbac-proxy .
ENTRYPOINT ["./kube-rbac-proxy"]
EXPOSE 8080
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
FROM amd64/alpine:3.8
RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/*
COPY kube-rbac-proxy .
ENTRYPOINT ["./kube-rbac-proxy"]
EXPOSE 8080
EOF
docker manifest create --amend $IMAGE:$KUBE_RBAC_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$KUBE_RBAC_VERSION\-&~g"`
for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$KUBE_RBAC_VERSION $IMAGE:$KUBE_RBAC_VERSION-$arch; done
docker manifest push --purge $IMAGE:$KUBE_RBAC_VERSION
docker run --rm --privileged multiarch/qemu-user-static:register --reset
rm qemu-arm-static
wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-arm-static
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
for arch in $ALL_ARCH; do
docker rmi $IMAGE:$KUBE_RBAC_VERSION-$arch
done
#-------------------------------------------------------------------------------
# prometheus-config-reloader
IMAGE=carlosedp/prometheus-config-reloader
VERSION=$PROM_CONFIG_RELOADER_VERSION
ALL_ARCH='amd64 arm arm64'
ALL_ARCH=(amd64 arm arm64 ppc64le)
pushd $GOPATH/src/github.com/coreos/prometheus-operator
cd $GOPATH/src/github.com/coreos/prometheus-operator/cmd/prometheus-config-reloader
git checkout ${VERSION}
cp ../../Dockerfile ./Dockerfile.new
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
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 <<EOF
FROM arm32v6/busybox
COPY configmap-reload /configmap-reload
ENTRYPOINT ["/configmap-reload"]
for arch in $ALL_ARCH; do
if [[ $arch == "arm" ]]; then archdocker="arm32v7";
elif [[ $arch == "arm64" ]]; then archdocker="arm64v8";
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
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
FROM arm64v8/busybox
COPY configmap-reload /configmap-reload
ENTRYPOINT ["/configmap-reload"]
EOF
docker manifest create --amend $IMAGE:$CONFIGMAP_RELOAD_VERSION `echo $ALL_ARCH | sed -e "s~[^ ]*~$IMAGE:$CONFIGMAP_RELOAD_VERSION\-&~g"`
for arch in $ALL_ARCH; do docker manifest annotate --arch $arch $IMAGE:$CONFIGMAP_RELOAD_VERSION $IMAGE:$CONFIGMAP_RELOAD_VERSION-$arch; done
docker manifest push --purge $IMAGE:$CONFIGMAP_RELOAD_VERSION
cat > Dockerfile.amd64 <<EOF
FROM busybox
COPY configmap-reload /configmap-reload
ENTRYPOINT ["/configmap-reload"]
EOF
for arch in $ALL_ARCH; do
docker rmi $IMAGE:$CONFIGMAP_RELOAD_VERSION-$arch
done
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build .
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
rm -rf Dockerfile.custom