mirror of
				https://github.com/1Password/onepassword-operator.git
				synced 2025-10-31 03:39:39 +00:00 
			
		
		
		
	Compare commits
	
		
			26 Commits
		
	
	
		
			goreleaser
			...
			deploy-1.2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | cd43475098 | ||
|   | 9dabac4a55 | ||
|   | d927a08790 | ||
|   | 933f7c4e2c | ||
|   | 81eb9a521f | ||
|   | eb32bd7f94 | ||
|   | a5781af949 | ||
|   | 0aa5781acd | ||
|   | 700be4426f | ||
|   | 76ef9aa372 | ||
|   | d7e6704314 | ||
|   | 2443979602 | ||
|   | 5b65196d31 | ||
|   | e7df8a485d | ||
|   | ded76138da | ||
|   | a5db6aeb81 | ||
|   | d45f682c37 | ||
|   | d0c1235e58 | ||
|   | 9e8f621020 | ||
|   | 8dd7a28456 | ||
|   | 43b06dd7aa | ||
|   | e8e01d6578 | ||
|   | b53e017b77 | ||
|   | b2565cebf8 | ||
|   | 9459d2e292 | ||
|   | 0409b17ef4 | 
							
								
								
									
										36
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | |||||||
|  | --- | ||||||
|  | name: Bug report | ||||||
|  | about: Report bugs and errors found while using the Operator. | ||||||
|  | title: '' | ||||||
|  | labels: bug | ||||||
|  | assignees: '' | ||||||
|  |  | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | ### Your environment | ||||||
|  |  | ||||||
|  | <!-- Version of the Operator when the error occurred --> | ||||||
|  | Operator Version: | ||||||
|  |  | ||||||
|  | <!-- What version of the Connect server are you running? | ||||||
|  | You can get this information from the Integrations section in 1Password | ||||||
|  | https://start.1password.com/integrations/active | ||||||
|  | --> | ||||||
|  | Connect Server Version: | ||||||
|  |  | ||||||
|  | <!-- What version of Kubernetes have you deployed the operator to? --> | ||||||
|  | Kubernetes Version: | ||||||
|  |  | ||||||
|  | ## What happened? | ||||||
|  | <!-- Describe the bug or error --> | ||||||
|  |  | ||||||
|  | ## What did you expect to happen? | ||||||
|  | <!-- Describe what should have happened --> | ||||||
|  |  | ||||||
|  | ## Steps to reproduce | ||||||
|  | 1. <!-- Describe Steps to reproduce the issue --> | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ## Notes & Logs | ||||||
|  | <!-- Paste any logs here that may help with debugging. | ||||||
|  | Remember to remove any sensitive information before sharing! --> | ||||||
							
								
								
									
										9
									
								
								.github/ISSUE_TEMPLATE/config.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								.github/ISSUE_TEMPLATE/config.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | # docs: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser | ||||||
|  | blank_issues_enabled: true | ||||||
|  | contact_links: | ||||||
|  |   - name: 1Password Community | ||||||
|  |     url: https://1password.community/categories/secrets-automation | ||||||
|  |     about: Please ask general Secrets Automation questions here. | ||||||
|  |   - name: 1Password Security Bug Bounty | ||||||
|  |     url: https://bugcrowd.com/agilebits | ||||||
|  |     about: Please report security vulnerabilities here. | ||||||
							
								
								
									
										32
									
								
								.github/ISSUE_TEMPLATE/feature_request.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								.github/ISSUE_TEMPLATE/feature_request.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | |||||||
|  | --- | ||||||
|  | name: Feature request | ||||||
|  | about: Suggest an idea for the Operator | ||||||
|  | title: '' | ||||||
|  | labels: feature-request | ||||||
|  | assignees: '' | ||||||
|  |  | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | ### Summary | ||||||
|  | <!-- Briefly describe the feature in one or two sentences. You can include more details later. --> | ||||||
|  |  | ||||||
|  | ### Use cases | ||||||
|  | <!-- Describe the use cases that make this feature useful to others. | ||||||
|  | The description should help the reader understand why the feature is necessary. | ||||||
|  | The better we understand your use case, the better we can help create an appropriate solution. --> | ||||||
|  |  | ||||||
|  | ### Proposed solution | ||||||
|  | <!-- If you already have an idea for how the feature should work, use this space to describe it. | ||||||
|  | We'll work with you to find a workable approach, and any implementation details are appreciated. | ||||||
|  | --> | ||||||
|  |  | ||||||
|  | ### Is there a workaround to accomplish this today? | ||||||
|  | <!-- If there's a way to accomplish this feature request without changes to the codebase, we'd like to hear it. | ||||||
|  | --> | ||||||
|  |  | ||||||
|  | ### References & Prior Work | ||||||
|  | <!-- If a similar feature was implemented in another project or tool, add a link so we can better understand your request. | ||||||
|  | Links to relevant documentation or RFCs are also appreciated. --> | ||||||
|  |  | ||||||
|  | * <!-- Reference 1 --> | ||||||
|  | * <!-- Reference 2, etc --> | ||||||
							
								
								
									
										52
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										52
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,13 +1,15 @@ | |||||||
| name: goreleaser | name: release | ||||||
|  |  | ||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
|     tags: |     tags: | ||||||
|       - '*' |       - 'v*' | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   goreleaser: |   release-docker: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|  |     env: | ||||||
|  |       DOCKER_CLI_EXPERIMENTAL: "enabled" | ||||||
|     steps: |     steps: | ||||||
|       - |       - | ||||||
|         name: Checkout |         name: Checkout | ||||||
| @@ -15,15 +17,41 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           fetch-depth: 0 |           fetch-depth: 0 | ||||||
|       - |       - | ||||||
|         name: Set up Go |         name: Docker meta | ||||||
|         uses: actions/setup-go@v2 |         id: meta | ||||||
|  |         uses: crazy-max/ghaction-docker-meta@v2 | ||||||
|         with: |         with: | ||||||
|           go-version: 1.15 |           images: | | ||||||
|  |             1password/onepassword-operator | ||||||
|  |           # Publish image for x.y.z and x.y | ||||||
|  |           # The latest tag is automatically added for semver tags | ||||||
|  |           tags: | | ||||||
|  |             type=semver,pattern={{version}} | ||||||
|  |             type=semver,pattern={{major}}.{{minor}} | ||||||
|  |       - name: Get the version from tag | ||||||
|  |         id: get_version | ||||||
|  |         run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v} | ||||||
|       - |       - | ||||||
|         name: Run GoReleaser |         name: Set up QEMU | ||||||
|         uses: goreleaser/goreleaser-action@v2 |         uses: docker/setup-qemu-action@v1 | ||||||
|  |       - | ||||||
|  |         name: Set up Docker Buildx | ||||||
|  |         uses: docker/setup-buildx-action@v1 | ||||||
|  |       - | ||||||
|  |         name: Docker Login | ||||||
|  |         uses: docker/login-action@v1 | ||||||
|         with: |         with: | ||||||
|           version: latest |           username: ${{ secrets.DOCKERHUB_USERNAME }} | ||||||
|           args: release --rm-dist |           password: ${{ secrets.DOCKERHUB_TOKEN }} | ||||||
|         env: |       - | ||||||
|           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |         name: Build and push | ||||||
|  |         uses: docker/build-push-action@v2 | ||||||
|  |         with: | ||||||
|  |           context: . | ||||||
|  |           file: Dockerfile | ||||||
|  |           platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||||||
|  |           push: true | ||||||
|  |           tags: ${{ steps.meta.outputs.tags }} | ||||||
|  |           labels: ${{ steps.meta.outputs.labels }} | ||||||
|  |           build-args: | | ||||||
|  |             operator_version=${{ steps.get_version.outputs.VERSION }} | ||||||
|   | |||||||
| @@ -1,55 +0,0 @@ | |||||||
| project_name: onepassword-operator |  | ||||||
| builds: |  | ||||||
|   - env: |  | ||||||
|       - CGO_ENABLED=0 |  | ||||||
|     binary: manager |  | ||||||
|     main: ./cmd/manager/main.go |  | ||||||
|     flags: |  | ||||||
|       - -mod=vendor |  | ||||||
|       - -trimpath |  | ||||||
|     ldflags: |  | ||||||
|       - -s -w -X "github.com/1Password/onepassword-operator/version.Version={{ .Version }}" |  | ||||||
|     mod_timestamp: '{{ .CommitTimestamp }}' |  | ||||||
|     goos: |  | ||||||
|       - linux |  | ||||||
|     goarch: |  | ||||||
|       - amd64 |  | ||||||
|       - arm64 |  | ||||||
| dockers: |  | ||||||
|   - image_templates: ["1password/{{ .ProjectName }}:{{ .Version }}-amd64"] |  | ||||||
|     goos: linux |  | ||||||
|     goarch: amd64 |  | ||||||
|     dockerfile: Dockerfile-goreleaser |  | ||||||
|     use_buildx: true |  | ||||||
|     extra_files: |  | ||||||
|       - deploy/connect/ |  | ||||||
|     build_flag_templates: |  | ||||||
|       - --platform=linux/amd64 |  | ||||||
|       - --label=org.opencontainers.image.title={{ .ProjectName }} |  | ||||||
|       - --label=org.opencontainers.image.description={{ .ProjectName }} |  | ||||||
|       - --label=org.opencontainers.image.url=https://github.com/1Password/onepassword-operator |  | ||||||
|       - --label=org.opencontainers.image.source=https://github.com/1Password/onepassword-operator |  | ||||||
|       - --label=org.opencontainers.image.version={{ .Version }} |  | ||||||
|       - --label=org.opencontainers.image.revision={{ .FullCommit }} |  | ||||||
|       - --label=org.opencontainers.image.licenses=MIT |  | ||||||
|   - image_templates: ["1password/{{ .ProjectName }}:{{ .Version }}-arm64v8"] |  | ||||||
|     goos: linux |  | ||||||
|     goarch: arm64 |  | ||||||
|     dockerfile: Dockerfile-goreleaser |  | ||||||
|     use_buildx: true |  | ||||||
|     extra_files: |  | ||||||
|       - deploy/connect/ |  | ||||||
|     build_flag_templates: |  | ||||||
|       - --platform=linux/arm64/v8 |  | ||||||
|       - --label=org.opencontainers.image.title={{ .ProjectName }} |  | ||||||
|       - --label=org.opencontainers.image.description={{ .ProjectName }} |  | ||||||
|       - --label=org.opencontainers.image.url=https://github.com/1Password/onepassword-operator |  | ||||||
|       - --label=org.opencontainers.image.source=https://github.com/1Password/onepassword-operator |  | ||||||
|       - --label=org.opencontainers.image.version={{ .Version }} |  | ||||||
|       - --label=org.opencontainers.image.revision={{ .FullCommit }} |  | ||||||
|       - --label=org.opencontainers.image.licenses=MIT |  | ||||||
| docker_manifests: |  | ||||||
|   - name_template: 1password/{{ .ProjectName }}:{{ .Version }} |  | ||||||
|     image_templates: |  | ||||||
|       - 1password/{{ .ProjectName }}:{{ .Version }}-amd64 |  | ||||||
|       - 1password/{{ .ProjectName }}:{{ .Version }}-arm64v8 |  | ||||||
| @@ -12,6 +12,15 @@ | |||||||
|  |  | ||||||
| --- | --- | ||||||
|  |  | ||||||
|  | [//]: # (START/v1.0.1) | ||||||
|  | # v1.0.1 | ||||||
|  |  | ||||||
|  | ## Features | ||||||
|  | * This release also contains an arm64 Docker image. {#20} | ||||||
|  | * Docker images are also pushed to the :latest and :<major>.<minor> tags. | ||||||
|  |  | ||||||
|  | --- | ||||||
|  |  | ||||||
| [//]: # (START/v1.0.0) | [//]: # (START/v1.0.0) | ||||||
| # v1.0.0 | # v1.0.0 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -14,11 +14,9 @@ COPY vendor/ vendor/ | |||||||
| # Build | # Build | ||||||
| ARG operator_version=dev | ARG operator_version=dev | ||||||
| RUN CGO_ENABLED=0 \ | RUN CGO_ENABLED=0 \ | ||||||
|     GOOS=linux \ |  | ||||||
|     GOARCH=amd64 \ |  | ||||||
|     GO111MODULE=on \ |     GO111MODULE=on \ | ||||||
|     go build \ |     go build \ | ||||||
|     -ldflags "-X version.Version=$operator_version" \ |     -ldflags "-X \"github.com/1Password/onepassword-operator/version.Version=$operator_version\"" \ | ||||||
|     -mod vendor \ |     -mod vendor \ | ||||||
|     -a -o manager main.go |     -a -o manager main.go | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,9 +0,0 @@ | |||||||
| # Use distroless as minimal base image to package the manager binary |  | ||||||
| # Refer to https://github.com/GoogleContainerTools/distroless for more details |  | ||||||
| FROM gcr.io/distroless/static:nonroot |  | ||||||
| WORKDIR / |  | ||||||
| COPY ./manager . |  | ||||||
| USER nonroot:nonroot |  | ||||||
| COPY deploy/connect/ deploy/connect/ |  | ||||||
|  |  | ||||||
| ENTRYPOINT ["/manager"] |  | ||||||
							
								
								
									
										19
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								README.md
									
									
									
									
									
								
							| @@ -13,8 +13,8 @@ Prerequisites: | |||||||
| - [1Password Command Line Tool Installed](https://1password.com/downloads/command-line/) | - [1Password Command Line Tool Installed](https://1password.com/downloads/command-line/) | ||||||
| - [kubectl installed](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | - [kubectl installed](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | ||||||
| - [docker installed](https://docs.docker.com/get-docker/) | - [docker installed](https://docs.docker.com/get-docker/) | ||||||
| - [Generated a 1password-credentials.json file and issued a 1Password Connect API Token for the K8s Operator integration](https://support.b5dev.com/cs/connect) | - [Generated a 1password-credentials.json file and issued a 1Password Connect API Token for the K8s Operator integration](https://support.1password.com/secrets-automation/) | ||||||
| - [1Password Connect deployed to Kubernetes](https://support.b5dev.com/cs/connect-deploy-kubernetes/#step-2-deploy-a-connect-server). **NOTE**: If customization of the 1Password Connect deployment is not required you can skip this prerequisite. | - [1Password Connect deployed to Kubernetes](https://support.1password.com/connect-deploy-kubernetes/#step-2-deploy-a-1password-connect-server). **NOTE**: If customization of the 1Password Connect deployment is not required you can skip this prerequisite. | ||||||
|  |  | ||||||
| ### Quickstart for Deploying 1Password Connect to Kubernetes | ### Quickstart for Deploying 1Password Connect to Kubernetes | ||||||
|  |  | ||||||
| @@ -53,15 +53,15 @@ Adding this environment variable will have the operator automatically deploy a d | |||||||
| "Create a Connect token for the operator and save it as a Kubernetes Secret:  | "Create a Connect token for the operator and save it as a Kubernetes Secret:  | ||||||
|  |  | ||||||
| ```bash | ```bash | ||||||
| $ kubectl create secret generic op-operator-connect-token --from-literal=token=<OP_CONNECT_TOKEN>" | $ kubectl create secret generic onepassword-token --from-literal=token=<OP_CONNECT_TOKEN>" | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| If you do not have a token for the operator, you can generate a token and save it to kubernetes with the following command: | If you do not have a token for the operator, you can generate a token and save it to kubernetes with the following command: | ||||||
| ```bash | ```bash | ||||||
| $ kubectl create secret generic op-operator-connect-token --from-literal=token=$(op create connect token <server> op-k8s-operator --vault <vault>) | $ kubectl create secret generic onepassword-token --from-literal=token=$(op create connect token <server> op-k8s-operator --vault <vault>) | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| [More information on generating a token can be found here](https://support.1password.com/cs/secrets-automation/#appendix-issue-additional-access-tokens) | [More information on generating a token can be found here](https://support.1password.com/secrets-automation/#appendix-issue-additional-access-tokens) | ||||||
|  |  | ||||||
| **Set Permissions For Operator** | **Set Permissions For Operator** | ||||||
|  |  | ||||||
| @@ -102,7 +102,7 @@ To create a Kubernetes Secret from a 1Password item, create a yaml file with the | |||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| apiVersion: onepassword.com/v1 | apiVersion: onepassword.com/v1 | ||||||
| kind: OnePasswordItem # {insert_new_name} | kind: OnePasswordItem | ||||||
| metadata: | metadata: | ||||||
|   name: <item_name> #this name will also be used for naming the generated kubernetes secret |   name: <item_name> #this name will also be used for naming the generated kubernetes secret | ||||||
| spec: | spec: | ||||||
| @@ -131,8 +131,8 @@ kind: Deployment | |||||||
| metadata: | metadata: | ||||||
|   name: deployment-example |   name: deployment-example | ||||||
|   annotations: |   annotations: | ||||||
|     operator.1password.io/item-path: "vaults/{vault_id_or_title}/items/{item_id_or_title}" |     operator.1password.io/item-path: "vaults/<vault_id_or_title>/items/<item_id_or_title>" | ||||||
|     operator.1password.io/item-name: "{secret_name}" |     operator.1password.io/item-name: "<secret_name>" | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| Applying this yaml file will create a Kubernetes Secret with the name `<secret_name>` and contents from the location specified at the specified Item Path. | Applying this yaml file will create a Kubernetes Secret with the name `<secret_name>` and contents from the location specified at the specified Item Path. | ||||||
| @@ -163,6 +163,7 @@ apiVersion: v1 | |||||||
| kind: Namespace | kind: Namespace | ||||||
| metadata: | metadata: | ||||||
|   name: "example-namespace" |   name: "example-namespace" | ||||||
|  |   annotations: | ||||||
|     operator.1password.io/auto-restart: "true" |     operator.1password.io/auto-restart: "true" | ||||||
| ``` | ``` | ||||||
| If the value is not set, the auto reset settings on the operator will be used. This value can be overwritten by deployment. | If the value is not set, the auto reset settings on the operator will be used. This value can be overwritten by deployment. | ||||||
| @@ -175,6 +176,7 @@ apiVersion: v1 | |||||||
| kind: Deployment | kind: Deployment | ||||||
| metadata: | metadata: | ||||||
|   name: "example-deployment" |   name: "example-deployment" | ||||||
|  |   annotations: | ||||||
|     operator.1password.io/auto-restart: "true" |     operator.1password.io/auto-restart: "true" | ||||||
| ``` | ``` | ||||||
| If the value is not set, the auto reset settings on the namespace will be used. | If the value is not set, the auto reset settings on the namespace will be used. | ||||||
| @@ -187,6 +189,7 @@ apiVersion: onepassword.com/v1 | |||||||
| kind: OnePasswordItem | kind: OnePasswordItem | ||||||
| metadata: | metadata: | ||||||
|   name: example |   name: example | ||||||
|  |   annotations: | ||||||
|     operator.1password.io/auto-restart: "true" |     operator.1password.io/auto-restart: "true" | ||||||
| ``` | ``` | ||||||
| If the value is not set, the auto reset settings on the deployment will be used. | If the value is not set, the auto reset settings on the deployment will be used. | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ spec: | |||||||
|     metadata: |     metadata: | ||||||
|       labels: |       labels: | ||||||
|         app: onepassword-connect |         app: onepassword-connect | ||||||
|         version: "1.0.0" |         version: "1.2.0" | ||||||
|     spec: |     spec: | ||||||
|       volumes: |       volumes: | ||||||
|         - name: shared-data |         - name: shared-data | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user