Project: Operator Framework (App Definition and Development / Application Definition & Image Build)
File: project-layout.md

title: "Project Layout" linkTitle: "Project Layout" weight: 2 description: A description of the layout of projects built with Operator SDK All projects initialized with `operator-sdk init` have a common base structure which builds on . Each project type is customized further with code of that type's language. The common structure contains the following items: | File/Directory | Description | | | -- | | `Dockerfile` | The Dockerfile of your operator project, used to build the image with `make docker-build`. | | `Makefile` | Build file with helper targets to help you work with your project. | | `PROJECT` | This file represents the project's configuration and is used to track useful information for the CLI and plugins. | | `bin/` | This directory contains useful binaries such as the `manager` which is used to run your project locally and the `kustomize` utility used for the project configuration. For other language types, it might have other binaries useful for developing your operator. | | `bundle/` | This directory contains all the files used to with with the format. It is built from the Makefile target `make bundle`. | | `bundle/manifests/` | This directory has the of your . | | `bundle/metadata/` | This directory has the of your e.g the index image annotations. | | `bundle/tests/` | This directory has the tests shipped with your operator bundle. | | `config/` | Contains configuration files to launch your project on a cluster. Plugins might use it to provide functionality. For example, for the CLI to help create your operator bundle it will look for the CRD's and CR's which are scaffolded in this directory. You will also find all YAML definitions as well. | | `config/crd/` | Contains the . | | `config/default/` | Contains a for launching the controller in a standard configuration. | | `config/manager/` | Contains the manifests to launch your operator project as pods on the cluster. | | `config/manifests/` | Contains the base to generate your OLM manifests in the bundle

| | `config/prometheus/` | Contains the manifests required to enable project to serve metrics to such as the `ServiceMonitor` resource. | | `config/scorecard/` | Contains the manifests required to allow you test your project with . | | `config/rbac/` | Contains the permissions required to run your project. | | `config/samples/` | Contains the . | | `bundle.Dockerfile` | The Dockerfile to build the image. Used to build the operator bundle image with `make bundle-build. | Now, let's look at the files and directories specific to Ansible-based operators. | File/Directory | Description | | | -- | |`config/testing/` | Manifest files to help you test your project. For example, to change the image policy for your or to enable debug level in the Ansible logs. | |`molecule/` | Contain the manifests for your tests. | |`molecule/default` | Contains the default task. | |`molecule/kind` | Contains the task to be executed on the cluster. | |`playbooks/` | Contains the Ansible playbooks.| |`roles/` | Contains the Ansible role files for each Kind scaffold. | |`requirements.yml` | This file specifies Ansible dependencies that need to be installed for your operator to function. | |`watches.yaml` | Contains Group, Version, Kind, and the playbooks and rules location. Used to configure the . | Now, let's look at the files and directories specific to Go-based operators. | File/Directory | Description | | | -- | |`api/` | Contains the api definition | |`config/certmanager` | Contains the Kustomize manifests which configure the by the Webhooks. | |`config/webhook` | Contains the Kustomize manifests to configure the Webhook. | |`controllers` | Contains the controllers. | |`main.go` | Implements the project initialization. | | `hack/` | Contains utility files, e.g. the file used to scaffold the license header for your project files. | Now, let's look at the files and directories specific to Helm-based operators. | File/Directory | Description | | | -- | |`helm-charts` | Contains the Helm charts for each Kind scaffold which can be initialized with `operator-sdk init --plugins=helm [options]` or `operator-sdk create api [options]` . | |`watches.yaml` | Contains Group, Version, Kind, and Helm chart location. Used to configure the . |