From 361931f104fd15e5fdedd9b7e27bae3988e823e1 Mon Sep 17 00:00:00 2001 From: Jesse Suen Date: Thu, 15 Nov 2018 03:46:10 -0800 Subject: [PATCH] Move to single master image for all argocd services (issue #762) --- .argo-ci/ci.yaml | 4 +- Dockerfile | 9 --- Gopkg.lock | 69 ------------------- Makefile | 29 ++------ hack/update-manifests.sh | 4 +- .../application-controller-deployment.yaml | 2 +- .../base/argocd-repo-server-deployment.yaml | 4 +- manifests/base/argocd-server-deployment.yaml | 4 +- manifests/base/dex-server-deployment.yaml | 4 +- manifests/install.yaml | 20 +++--- manifests/namespace-install.yaml | 20 +++--- 11 files changed, 36 insertions(+), 133 deletions(-) diff --git a/.argo-ci/ci.yaml b/.argo-ci/ci.yaml index ec0a5be53b386..d8332199f82dd 100644 --- a/.argo-ci/ci.yaml +++ b/.argo-ci/ci.yaml @@ -21,7 +21,7 @@ spec: - name: cmd value: "{{item}}" withItems: - - make controller-image server-image repo-server-image + - make image - name: test template: ci-builder arguments: @@ -91,7 +91,7 @@ spec: cpu: 200m sidecars: - name: dind - image: docker:17.10-dind + image: docker:18.09-dind securityContext: privileged: true mirrorVolumeMounts: true diff --git a/Dockerfile b/Dockerfile index e4f2a1f4e552b..ba1886f18181d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,17 +120,8 @@ ENV USER=argocd COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/* /usr/local/bin/ -# Symlink argocd binaries under root for backwards compatibility that expect it under / -RUN ln -s /usr/local/bin/argocd /argocd && \ - ln -s /usr/local/bin/argocd-server /argocd-server && \ - ln -s /usr/local/bin/argocd-util /argocd-util && \ - ln -s /usr/local/bin/argocd-application-controller /argocd-application-controller && \ - ln -s /usr/local/bin/argocd-repo-server /argocd-repo-server - USER argocd RUN helm init --client-only WORKDIR /home/argocd -ARG BINARY -CMD ${BINARY} diff --git a/Gopkg.lock b/Gopkg.lock index 27ad654b6e61c..eb0725df91a93 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1197,50 +1197,8 @@ "discovery/fake", "dynamic", "dynamic/fake", - "informers", - "informers/admissionregistration", - "informers/admissionregistration/v1alpha1", - "informers/admissionregistration/v1beta1", - "informers/apps", - "informers/apps/v1", - "informers/apps/v1beta1", - "informers/apps/v1beta2", - "informers/autoscaling", - "informers/autoscaling/v1", - "informers/autoscaling/v2beta1", - "informers/autoscaling/v2beta2", - "informers/batch", - "informers/batch/v1", - "informers/batch/v1beta1", - "informers/batch/v2alpha1", - "informers/certificates", - "informers/certificates/v1beta1", - "informers/coordination", - "informers/coordination/v1beta1", - "informers/core", "informers/core/v1", - "informers/events", - "informers/events/v1beta1", - "informers/extensions", - "informers/extensions/v1beta1", "informers/internalinterfaces", - "informers/networking", - "informers/networking/v1", - "informers/policy", - "informers/policy/v1beta1", - "informers/rbac", - "informers/rbac/v1", - "informers/rbac/v1alpha1", - "informers/rbac/v1beta1", - "informers/scheduling", - "informers/scheduling/v1alpha1", - "informers/scheduling/v1beta1", - "informers/settings", - "informers/settings/v1alpha1", - "informers/storage", - "informers/storage/v1", - "informers/storage/v1alpha1", - "informers/storage/v1beta1", "kubernetes", "kubernetes/fake", "kubernetes/scheme", @@ -1306,33 +1264,7 @@ "kubernetes/typed/storage/v1alpha1/fake", "kubernetes/typed/storage/v1beta1", "kubernetes/typed/storage/v1beta1/fake", - "listers/admissionregistration/v1alpha1", - "listers/admissionregistration/v1beta1", - "listers/apps/v1", - "listers/apps/v1beta1", - "listers/apps/v1beta2", - "listers/autoscaling/v1", - "listers/autoscaling/v2beta1", - "listers/autoscaling/v2beta2", - "listers/batch/v1", - "listers/batch/v1beta1", - "listers/batch/v2alpha1", - "listers/certificates/v1beta1", - "listers/coordination/v1beta1", "listers/core/v1", - "listers/events/v1beta1", - "listers/extensions/v1beta1", - "listers/networking/v1", - "listers/policy/v1beta1", - "listers/rbac/v1", - "listers/rbac/v1alpha1", - "listers/rbac/v1beta1", - "listers/scheduling/v1alpha1", - "listers/scheduling/v1beta1", - "listers/settings/v1alpha1", - "listers/storage/v1", - "listers/storage/v1alpha1", - "listers/storage/v1beta1", "pkg/apis/clientauthentication", "pkg/apis/clientauthentication/v1alpha1", "pkg/apis/clientauthentication/v1beta1", @@ -1524,7 +1456,6 @@ "k8s.io/client-go/discovery/fake", "k8s.io/client-go/dynamic", "k8s.io/client-go/dynamic/fake", - "k8s.io/client-go/informers", "k8s.io/client-go/informers/core/v1", "k8s.io/client-go/kubernetes", "k8s.io/client-go/kubernetes/fake", diff --git a/Makefile b/Makefile index 7517aec2a5b6a..cf00c2829c1b2 100644 --- a/Makefile +++ b/Makefile @@ -62,14 +62,14 @@ cli: clean-debug .PHONY: cli-linux cli-linux: clean-debug - docker build --iidfile /tmp/argocd-linux-id --target argocd-build --build-arg MAKE_TARGET="cli IMAGE_TAG=$(IMAGE_TAG) IMAGE_NAMESPACE=$(IMAGE_NAMESPACE) CLI_NAME=argocd-linux-amd64" . + docker build --iidfile /tmp/argocd-linux-id --target argocd-build --build-arg MAKE_TARGET="cli CLI_NAME=argocd-linux-amd64" . docker create --name tmp-argocd-linux `cat /tmp/argocd-linux-id` docker cp tmp-argocd-linux:/go/src/github.com/argoproj/argo-cd/dist/argocd-linux-amd64 dist/ docker rm tmp-argocd-linux .PHONY: cli-darwin cli-darwin: clean-debug - docker build --iidfile /tmp/argocd-darwin-id --target argocd-build --build-arg MAKE_TARGET="cli GOOS=darwin IMAGE_TAG=$(IMAGE_TAG) IMAGE_NAMESPACE=$(IMAGE_NAMESPACE) CLI_NAME=argocd-darwin-amd64" . + docker build --iidfile /tmp/argocd-darwin-id --target argocd-build --build-arg MAKE_TARGET="cli GOOS=darwin CLI_NAME=argocd-darwin-amd64" . docker create --name tmp-argocd-darwin `cat /tmp/argocd-darwin-id` docker cp tmp-argocd-darwin:/go/src/github.com/argoproj/argo-cd/dist/argocd-darwin-amd64 dist/ docker rm tmp-argocd-darwin @@ -86,33 +86,18 @@ manifests: server: clean-debug CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-server ./cmd/argocd-server -.PHONY: server-image -server-image: - docker build --build-arg BINARY=argocd-server -t $(IMAGE_PREFIX)argocd-server:$(IMAGE_TAG) . - @if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-server:$(IMAGE_TAG) ; fi - .PHONY: repo-server repo-server: CGO_ENABLED=0 go build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-repo-server ./cmd/argocd-repo-server -.PHONY: repo-server-image -repo-server-image: - docker build --build-arg BINARY=argocd-repo-server -t $(IMAGE_PREFIX)argocd-repo-server:$(IMAGE_TAG) . - @if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-repo-server:$(IMAGE_TAG) ; fi - .PHONY: controller controller: CGO_ENABLED=0 go build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-application-controller ./cmd/argocd-application-controller -.PHONY: controller-image -controller-image: - docker build --build-arg BINARY=argocd-application-controller -t $(IMAGE_PREFIX)argocd-application-controller:$(IMAGE_TAG) . - @if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-application-controller:$(IMAGE_TAG) ; fi - -.PHONY: cli-image -cli-image: - docker build --build-arg BINARY=argocd -t $(IMAGE_PREFIX)argocd-cli:$(IMAGE_TAG) . - @if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-cli:$(IMAGE_TAG) ; fi +.PHONY: image +image: + docker build -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) . + @if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) ; fi .PHONY: builder-image builder-image: @@ -149,4 +134,4 @@ release-precheck: manifests @if [ "$(GIT_TAG)" != "v`cat VERSION`" ]; then echo 'VERSION does not match git tag'; exit 1; fi .PHONY: release -release: release-precheck precheckin cli-darwin cli-linux server-image controller-image repo-server-image cli-image +release: release-precheck precheckin cli-darwin cli-linux image diff --git a/hack/update-manifests.sh b/hack/update-manifests.sh index 23b77966c487f..af57aad572d2d 100755 --- a/hack/update-manifests.sh +++ b/hack/update-manifests.sh @@ -5,10 +5,10 @@ AUTOGENMSG="# This is an auto-generated file. DO NOT EDIT" update_image () { if [ ! -z "${IMAGE_NAMESPACE}" ]; then - sed -i '' 's| image: \(.*\)/\(argocd-.*\)| image: '"${IMAGE_NAMESPACE}"'/\2|g' ${1} + sed -i '' 's| image: \(.*\)/\(argocd.*\)| image: '"${IMAGE_NAMESPACE}"'/\2|g' ${1} fi if [ ! -z "${IMAGE_TAG}" ]; then - sed -i '' 's|\( image: .*/argocd-.*\)\:.*|\1:'"${IMAGE_TAG}"'|g' ${1} + sed -i '' 's|\( image: .*/argocd.*\)\:.*|\1:'"${IMAGE_TAG}"'|g' ${1} fi } diff --git a/manifests/base/application-controller-deployment.yaml b/manifests/base/application-controller-deployment.yaml index 190c1086c9bbe..b49faf3ee4d80 100644 --- a/manifests/base/application-controller-deployment.yaml +++ b/manifests/base/application-controller-deployment.yaml @@ -13,7 +13,7 @@ spec: spec: containers: - command: - - /argocd-application-controller + - argocd-application-controller - --repo-server - argocd-repo-server:8081 - --status-processors diff --git a/manifests/base/argocd-repo-server-deployment.yaml b/manifests/base/argocd-repo-server-deployment.yaml index 0a1f6d40bfdf3..247fe4a1c81a2 100644 --- a/manifests/base/argocd-repo-server-deployment.yaml +++ b/manifests/base/argocd-repo-server-deployment.yaml @@ -14,8 +14,8 @@ spec: automountServiceAccountToken: false containers: - name: argocd-repo-server - image: argoproj/argocd-repo-server:latest - command: [/argocd-repo-server] + image: argoproj/argocd:latest + command: [argocd-repo-server] ports: - containerPort: 8081 readinessProbe: diff --git a/manifests/base/argocd-server-deployment.yaml b/manifests/base/argocd-server-deployment.yaml index f056f4a9c57f4..9ad39d8ba53f0 100644 --- a/manifests/base/argocd-server-deployment.yaml +++ b/manifests/base/argocd-server-deployment.yaml @@ -21,8 +21,8 @@ spec: name: static-files containers: - name: argocd-server - image: argoproj/argocd-server:latest - command: [/argocd-server, --staticassets, /shared/app, --repo-server, 'argocd-repo-server:8081'] + image: argoproj/argocd:latest + command: [argocd-server, --staticassets, /shared/app] volumeMounts: - mountPath: /shared name: static-files diff --git a/manifests/base/dex-server-deployment.yaml b/manifests/base/dex-server-deployment.yaml index ec42f3974ff4e..07b9ae90154a1 100644 --- a/manifests/base/dex-server-deployment.yaml +++ b/manifests/base/dex-server-deployment.yaml @@ -14,8 +14,8 @@ spec: serviceAccountName: dex-server initContainers: - name: copyutil - image: argoproj/argocd-server:latest - command: [cp, /argocd-util, /shared] + image: argoproj/argocd:latest + command: [cp, /usr/local/bin/argocd-util, /shared] volumeMounts: - mountPath: /shared name: static-files diff --git a/manifests/install.yaml b/manifests/install.yaml index d677ea361d2ad..d088f65138c45 100644 --- a/manifests/install.yaml +++ b/manifests/install.yaml @@ -332,14 +332,14 @@ spec: spec: containers: - command: - - /argocd-application-controller + - argocd-application-controller - --repo-server - argocd-repo-server:8081 - --status-processors - "20" - --operation-processors - "10" - image: argoproj/argocd-application-controller:latest + image: jessesuen/argocd-application-controller:latest name: application-controller serviceAccountName: application-controller --- @@ -359,8 +359,8 @@ spec: automountServiceAccountToken: false containers: - command: - - /argocd-repo-server - image: argoproj/argocd-repo-server:latest + - argocd-repo-server + image: jessesuen/argocd:latest name: argocd-repo-server ports: - containerPort: 8081 @@ -385,12 +385,10 @@ spec: spec: containers: - command: - - /argocd-server + - argocd-server - --staticassets - /shared/app - - --repo-server - - argocd-repo-server:8081 - image: argoproj/argocd-server:latest + image: jessesuen/argocd:latest name: argocd-server readinessProbe: httpGet: @@ -407,7 +405,7 @@ spec: - -r - /app - /shared - image: argoproj/argocd-ui:latest + image: jessesuen/argocd-ui:latest name: ui volumeMounts: - mountPath: /shared @@ -445,9 +443,9 @@ spec: initContainers: - command: - cp - - /argocd-util + - /usr/local/bin/argocd-util - /shared - image: argoproj/argocd-server:latest + image: jessesuen/argocd:latest name: copyutil volumeMounts: - mountPath: /shared diff --git a/manifests/namespace-install.yaml b/manifests/namespace-install.yaml index 0665493f2b741..ff113f272e991 100644 --- a/manifests/namespace-install.yaml +++ b/manifests/namespace-install.yaml @@ -265,14 +265,14 @@ spec: spec: containers: - command: - - /argocd-application-controller + - argocd-application-controller - --repo-server - argocd-repo-server:8081 - --status-processors - "20" - --operation-processors - "10" - image: argoproj/argocd-application-controller:latest + image: jessesuen/argocd-application-controller:latest name: application-controller serviceAccountName: application-controller --- @@ -292,8 +292,8 @@ spec: automountServiceAccountToken: false containers: - command: - - /argocd-repo-server - image: argoproj/argocd-repo-server:latest + - argocd-repo-server + image: jessesuen/argocd:latest name: argocd-repo-server ports: - containerPort: 8081 @@ -318,12 +318,10 @@ spec: spec: containers: - command: - - /argocd-server + - argocd-server - --staticassets - /shared/app - - --repo-server - - argocd-repo-server:8081 - image: argoproj/argocd-server:latest + image: jessesuen/argocd:latest name: argocd-server readinessProbe: httpGet: @@ -340,7 +338,7 @@ spec: - -r - /app - /shared - image: argoproj/argocd-ui:latest + image: jessesuen/argocd-ui:latest name: ui volumeMounts: - mountPath: /shared @@ -378,9 +376,9 @@ spec: initContainers: - command: - cp - - /argocd-util + - /usr/local/bin/argocd-util - /shared - image: argoproj/argocd-server:latest + image: jessesuen/argocd:latest name: copyutil volumeMounts: - mountPath: /shared