diff --git a/.dockerignore b/.dockerignore index 848b7116566b0..0a3872c813d9d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ # a user's workspace, and are only building off of what is locked by dep. vendor Dockerfile-argocd +dist diff --git a/cmd/argocd-application-controller/main.go b/cmd/argocd-application-controller/main.go index 37cb8541380fd..15e01f7da6c72 100644 --- a/cmd/argocd-application-controller/main.go +++ b/cmd/argocd-application-controller/main.go @@ -82,7 +82,7 @@ func newCommand() *cobra.Command { clientConfig = cli.AddKubectlFlagsToCmd(&command) command.Flags().Int64Var(&appResyncPeriod, "app-resync", defaultAppResyncPeriod, "Time period in seconds for application resync.") - command.Flags().StringVar(&repoServerAddress, "reposerveraddr", "localhost:8081", "Repo server address.") + command.Flags().StringVar(&repoServerAddress, "repo-server", "localhost:8081", "Repo server address.") return &command } diff --git a/cmd/argocd-repo-server/main.go b/cmd/argocd-repo-server/main.go index 4b5231b2c0a1b..9a9d20d55595c 100644 --- a/cmd/argocd-repo-server/main.go +++ b/cmd/argocd-repo-server/main.go @@ -23,7 +23,7 @@ import ( const ( // CLIName is the name of the CLI - cliName = "argocd-manifest-server" + cliName = "argocd-repo-server" port = 8081 ) @@ -52,10 +52,10 @@ func newCommand() *cobra.Command { nativeGitClient, err := git.NewNativeGitClient() errors.CheckError(err) grpc := server.CreateGRPC(nativeGitClient) - listener, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", port)) + listener, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0:%d", port)) errors.CheckError(err) - log.Infof("argocd-repo-server %s serving on port %d (namespace: %s)", argocd.GetVersion(), port, namespace) + log.Infof("argocd-repo-server %s serving on %s (namespace: %s)", argocd.GetVersion(), listener.Addr(), namespace) err = grpc.Serve(listener) errors.CheckError(err) return nil diff --git a/cmd/argocd/commands/install.go b/cmd/argocd/commands/install.go index 760f0474aedae..a4e9ea2472d03 100644 --- a/cmd/argocd/commands/install.go +++ b/cmd/argocd/commands/install.go @@ -45,6 +45,7 @@ func NewInstallCommand() *cobra.Command { command.Flags().StringVar(&installOpts.ControllerImage, "controller-image", DefaultControllerImage, "use a specified controller image") command.Flags().StringVar(&installOpts.ServerImage, "server-image", DefaultServerImage, "use a specified api server image") command.Flags().StringVar(&installOpts.UIImage, "ui-image", DefaultUiImage, "use a specified ui image") + command.Flags().StringVar(&installOpts.RepoServerImage, "repo-server-image", DefaultServerImage, "use a specified repo server image") command.Flags().StringVar(&installOpts.ImagePullPolicy, "image-pull-policy", "", "set the image pull policy of the pod specs") clientConfig = cli.AddKubectlFlagsToCmd(command) return command diff --git a/controller/controller.go b/controller/controller.go index 18590286f7351..c32483c3f8bbf 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -151,6 +151,7 @@ func (ctrl *ApplicationController) tryRefreshAppStatus(app *appv1.Application) ( Environment: app.Spec.Source.Environment, }) if err != nil { + log.Errorf("Failed to load application manifest %v", err) return nil, err } targetObjs := make([]*unstructured.Unstructured, len(manifestInfo.Manifests)) diff --git a/install/install.go b/install/install.go index 9070a9cc313e0..41c65b4d6a39b 100644 --- a/install/install.go +++ b/install/install.go @@ -43,6 +43,7 @@ type InstallOptions struct { ControllerImage string UIImage string ServerImage string + RepoServerImage string ImagePullPolicy string } @@ -75,6 +76,7 @@ func (i *Installer) Install() { i.InstallApplicationCRD() i.InstallApplicationController() i.InstallArgoCDServer() + i.InstallArgoCDRepoServer() } func (i *Installer) InstallNamespace() { @@ -129,6 +131,17 @@ func (i *Installer) InstallArgoCDServer() { i.MustInstallResource(kube.MustToUnstructured(&argoCDServerService)) } +func (i *Installer) InstallArgoCDRepoServer() { + var argoCDRepoServerControllerDeployment appsv1beta2.Deployment + var argoCDRepoServerService apiv1.Service + i.unmarshalManifest("04a_argocd-repo-server-deployment.yaml", &argoCDRepoServerControllerDeployment) + i.unmarshalManifest("04b_argocd-repo-server-service.yaml", &argoCDRepoServerService) + argoCDRepoServerControllerDeployment.Spec.Template.Spec.Containers[0].Image = i.RepoServerImage + argoCDRepoServerControllerDeployment.Spec.Template.Spec.Containers[0].ImagePullPolicy = apiv1.PullPolicy(i.ImagePullPolicy) + i.MustInstallResource(kube.MustToUnstructured(&argoCDRepoServerControllerDeployment)) + i.MustInstallResource(kube.MustToUnstructured(&argoCDRepoServerService)) +} + func (i *Installer) unmarshalManifest(fileName string, obj interface{}) { yamlBytes, err := i.box.MustBytes(fileName) errors.CheckError(err) diff --git a/install/manifests/02d_application-controller-deployment.yaml b/install/manifests/02d_application-controller-deployment.yaml index 77080ee0ff313..ec68a3e087df2 100644 --- a/install/manifests/02d_application-controller-deployment.yaml +++ b/install/manifests/02d_application-controller-deployment.yaml @@ -13,8 +13,7 @@ spec: app: application-controller spec: containers: - - command: - - /argocd-application-controller + - command: [/argocd-application-controller, --repo-server, 'argocd-repo-server:8081'] image: argoproj/argocd-application-controller:latest name: application-controller serviceAccountName: application-controller diff --git a/install/manifests/04a_argocd-repo-server-deployment.yaml b/install/manifests/04a_argocd-repo-server-deployment.yaml new file mode 100644 index 0000000000000..6d5dfa1cb300e --- /dev/null +++ b/install/manifests/04a_argocd-repo-server-deployment.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: argocd-repo-server + namespace: argocd +spec: + selector: + matchLabels: + app: argocd-repo-server + template: + metadata: + labels: + app: argocd-repo-server + spec: + containers: + - command: [/argocd-repo-server] + image: argoproj/argocd-repo-server:latest + name: argocd-repo-server + ports: + - containerPort: 8081 diff --git a/install/manifests/04b_argocd-repo-server-service.yaml b/install/manifests/04b_argocd-repo-server-service.yaml new file mode 100644 index 0000000000000..4c169ab3d252a --- /dev/null +++ b/install/manifests/04b_argocd-repo-server-service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: argocd-repo-server + namespace: argocd +spec: + ports: + - port: 8081 + selector: + app: argocd-repo-server diff --git a/reposerver/clientset.go b/reposerver/clientset.go index 71a67a32eef94..694052c967909 100644 --- a/reposerver/clientset.go +++ b/reposerver/clientset.go @@ -3,6 +3,7 @@ package reposerver import ( "github.com/argoproj/argo-cd/reposerver/repository" "github.com/argoproj/argo-cd/util" + log "github.com/sirupsen/logrus" "google.golang.org/grpc" ) @@ -18,6 +19,7 @@ type clientSet struct { func (c *clientSet) NewRepositoryClient() (util.Closer, repository.RepositoryServiceClient, error) { conn, err := grpc.Dial(c.address, grpc.WithInsecure()) if err != nil { + log.Errorf("Unable to connect to repository service with address %s", c.address) return nil, nil, err } return conn, repository.NewRepositoryServiceClient(conn), nil