{"id":19368467,"url":"https://github.com/anchore/engine-operator","last_synced_at":"2025-02-24T13:42:56.025Z","repository":{"id":46533249,"uuid":"184508772","full_name":"anchore/engine-operator","owner":"anchore","description":"Helm based anchore engine operator","archived":false,"fork":false,"pushed_at":"2021-10-08T08:30:29.000Z","size":723,"stargazers_count":4,"open_issues_count":2,"forks_count":6,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-01-06T22:35:34.794Z","etag":null,"topics":["kubernetes-operator","operator","operator-hub","security"],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anchore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"licenses/Apache.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-02T02:14:08.000Z","updated_at":"2021-10-08T08:27:29.000Z","dependencies_parsed_at":"2022-09-23T03:00:18.199Z","dependency_job_id":null,"html_url":"https://github.com/anchore/engine-operator","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fengine-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fengine-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fengine-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fengine-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anchore","download_url":"https://codeload.github.com/anchore/engine-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240491823,"owners_count":19809977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubernetes-operator","operator","operator-hub","security"],"created_at":"2024-11-10T08:06:41.609Z","updated_at":"2025-02-24T13:42:55.483Z","avatar_url":"https://github.com/anchore.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anchore Engine Helm Operator\n\nThe Anchore Engine Operator provides an easy way to deploy the Anchore Engine Helm chart to Kubernetes clusters.\n\nThis Operator is based on the official [Helm Chart](https://github.com/anchore/anchore-charts/tree/master/stable/anchore-engine).\n\n## Quickstart\n\n### Prerequisites\n\nThe Makefile will install the [Operator SDK](https://sdk.operatorframework.io/docs/overview/) and [kustomize](https://kustomize.io/) for you.\n\nInstall [kubectl](https://kubernetes.io/docs/reference/kubectl/kubectl/).\n\nYou will need a running Kubernetes cluster to install Anchore Engine using this Operator.\n\n### Install Anchore Engine\n\nTo stand up an Anchore Engine deployment on your cluster using the engine-operator, issue the follow command:\n\n```bash\nmake install\nmake deploy\n```\n\nTo delete the Anchore Engine deployment and the engine-operator from your cluster, issue the follow command:\n\n```bash\nmake uninstall\nmake undeploy\n```\n\n## Updating the Anchore Engine Operator with the newest Helm chart version\n\n* Install or update the [Operator SDK](https://sdk.operatorframework.io/docs/installation/) CLI tool\n* Copy the latest anchore-engine Helm chart to `helm-charts/anchore-engine`\n* Update `config/manager/manager.yaml` ENV variables with images used by the current anchore-engine helm chart\n\n    ```yaml\n    ...\n\n    env:\n    - name: RELATED_IMAGE_ANCHORE_ENGINE\n      value: docker.io/anchore/anchore-engine:v0.10.0\n    - name: RELATED_IMAGE_ANCHORE_POSTGRESQL\n      value: docker.io/postgres:9.6.18\n    ```\n\n* Update `config/manager/manager_redhat_patch.yaml` ENV variables with the current images pushed up to the RedHat image repository\n\n    ```yaml\n    ...\n\n    env:\n    - name: RELATED_IMAGE_ANCHORE_ENGINE\n      value: registry.connect.redhat.com/anchore/engine0:v0.10.0-r0\n    - name: RELATED_IMAGE_ANCHORE_POSTGRESQL\n      value: registry.redhat.io/rhel8/postgresql-96:latest\n    ```\n\n* Update all resource with the latest operator-sdk version\n  * Update `Dockerfile` with latest helm-operator image (matching the version of the operator-sdk used to update the Operator)\n\n    ```bash\n    FROM quay.io/operator-framework/helm-operator:\u003cLATEST_VERSION\u003e\n    ```\n\n  * Update `scorecard/patches/[basic.config.yaml][olm.config.yaml]` with latest scorecard-test image (matching the version of the operator-sdk used to update the Operator)\n\n    ```bash\n    image: quay.io/operator-framework/scorecard-test:\u003cLATEST_VERSION\u003e\n    ```\n\n  * Implement all required changes for the sdk version upgrade (as well as previous versions if upgrading multiple versions) - [Upgrade SDK Version](https://sdk.operatorframework.io/docs/upgrading-sdk-version/)\n\n* Update `Makefile` with current Operator version\n\n  ```make\n  VERSION ?= 1.0.0\n  ```\n\n* Update `Dockerfile` with the current Operator version\n\n  ```bash\n  LABEL name=\"Anchore Engine Operator\" \\\n    vendor=\"Anchore Inc.\" \\\n    maintainer=\"dev@anchore.com\" \\\n    version=\"v1.0.0\" \\\n  ```\n\n* [Test the Operator](#testing-the-operator-for-installation-with-olm)\n* [Clean up testing artifacts](#clean-up-olm-install)\n* Create a new Operator bundle and image, then push them to DockerHub \u0026 RedHat OperatorHub\n\n  ```bash\n  make docker-build\n  make docker-push\n  make docker-push-redhat\n  make docker-bundle-build\n  make docker-bundle-push\n  ```\n\n* Commit all changes \u0026 push to remote branch for PR\n\n## Testing the Operator for installation with OLM\n\nInstall the following:\n\n* [crc](https://code-ready.github.io/crc/)\n* [oc](https://docs.openshift.com/container-platform/4.6/cli_reference/openshift_cli/getting-started-cli.html#installing-openshift-cli)\n* [operator-sdk](https://sdk.operatorframework.io/docs/installation/)\n\n### Setup local OpenShift cluster and install the Operator\n\n```bash\nmake test\n```\n\n### From the crc console, install an instance of anchore-engine using the Operator\n\n* Login using `kubeadmin` and the password from `crc start` stdout\n* Navigate to Operators -\u003e Install Operators -\u003e Anchore Engine Operator\n* Deploy an instance of anchore-engine from the Anchore Engine OperatorG\n  * Under `Provided APIs` click the `Create Instance` button\n  * Add labels or update the name as needed\n  * If you want to customize the anchore-engine deployment, use a YAML spec and add custom values\n  * click the `Create` button\n* Ensure that anchore-engine deployed correctly by checking the status of all pods under the `Resources` tab\n* Port forward anchore-engine API pod \u0026 check anchore-engine status\n\n  ```bash\n  kubectl port-forward svc/anchoreengine-sample-anchore-engine-api 8228:8228\n  ANCHORE_CLI_PASS=$(kubectl get secret anchoreengine-sample-anchore-engine-admin-pass -o 'go-template={{index .data \"ANCHORE_ADMIN_PASSWORD\"}}' | base64 -D -)\n  anchore-cli system status\n  ```\n\n### Clean up OLM install\n\n```bash\nunset OPERATOR_TEST_MODE\nmake clean\ncrc stop\ncrc delete\n```\n\n# Troubleshooting\n\n* Sometimes the helm deployment can fail, this creates a situation where the anchoreengine.charts.anchore.io CR is stuck and cannot be deleted. To delete a stuck `anchoreengine-sample` CR run the following command:\n\n```bash\nkubectl patch anchoreengines.charts.anchore.io anchoreengine-sample -p '{\"metadata\":{\"finalizers\":[]}}' --type=merge\n```\n\n# Resources\n\n[golang](https://golang.org/)\n[Operator Lifecycle Manager](link)\n[Operator SDK](https://sdk.operatorframework.io/docs/overview/)\n[crc](https://crc.dev/crc/)\n[OpenShift CLI (oc)](https://docs.openshift.com/container-platform/4.6/cli_reference/openshift_cli/getting-started-cli.html#installing-openshift-cli)\n[kustomize]()\n[kubectl]()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanchore%2Fengine-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanchore%2Fengine-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanchore%2Fengine-operator/lists"}