From 2712e9ce7b5795ebedaab41e4cc176310a4cda87 Mon Sep 17 00:00:00 2001 From: volodymyrZotov Date: Mon, 24 Oct 2022 11:52:19 +0300 Subject: [PATCH] Use custom image name for the manager controller --- Makefile | 2 +- README.md | 21 +++++++++------------ config/manager/manager.yaml | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 4656a23..db498b4 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ ifeq ($(USE_IMAGE_DIGESTS), true) endif # Image URL to use all building/pushing image targets -IMG ?= controller:latest +IMG ?= 1password/onepassword-operator:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.24.2 diff --git a/README.md b/README.md index 8cd7a05..9eb8f24 100644 --- a/README.md +++ b/README.md @@ -29,15 +29,18 @@ Prerequisites: If 1Password Connect is already running, you can skip this step. There are options to deploy 1Password Connect: + - [Deploy with Helm](#deploy-with-helm) - [Deploy using the Connect Operator](#deploy-using-the-connect-operator) #### Deploy with Helm + The 1Password Connect Helm Chart helps to simplify the deployment of 1Password Connect and the 1Password Connect Kubernetes Operator to Kubernetes. [The 1Password Connect Helm Chart can be found here.](https://github.com/1Password/connect-helm-charts) #### Deploy using the Connect Operator + This guide will provide a quickstart option for deploying a default configuration of 1Password Connect via starting the deploying the 1Password Connect Operator, however it is recommended that you instead deploy your own manifest file if customization of the 1Password Connect deployment is desired. Encode the 1password-credentials.json file you generated in the prerequisite steps and save it to a file named op-session: @@ -48,15 +51,18 @@ cat 1password-credentials.json | base64 | \ ``` Create a Kubernetes secret from the op-session file: + ```bash kubectl create secret generic op-credentials --from-file=op-session ``` Add the following environment variable to the onepassword-connect-operator container in `/config/manager/manager.yaml`: + ```yaml - name: MANAGE_CONNECT value: "true" ``` + Adding this environment variable will have the operator automatically deploy a default configuration of 1Password Connect to the current namespace. ### Kubernetes Operator Deployment @@ -70,15 +76,11 @@ kubectl create secret generic onepassword-token --from-literal=token= op-k8s-operator --vault ) ``` -**Build Operator docker image** -``` -make docker-build -``` - **Deploying the Operator** An sample Deployment yaml can be found at `/config/manager/manager.yaml`. @@ -98,6 +100,7 @@ make deploy ``` **Undeploy Operator** + ``` make undeploy ``` @@ -230,13 +233,7 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si kubectl apply -f config/samples/ ``` -2. Build and push your image to the location specified by `IMG`: - -```sh -make docker-build docker-push IMG=/onepassword-operator:tag -``` - -3. Deploy the controller to the cluster with the image specified by `IMG`: +2. Deploy the controller to the cluster with the image specified by `IMG`: ```sh make deploy IMG=/onepassword-operator:tag diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 55af5ce..7d65011 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -38,7 +38,7 @@ spec: - /manager args: - --leader-elect - image: controller:latest + image: 1password/onepassword-operator:latest name: manager env: - name: WATCH_NAMESPACE