sigs.k8s.io/cluster-api@v1.7.1/docs/book/src/developer/repository-layout.md (about)

     1  # Repository Layout
     2  
     3  This page covers the repository structure and details about the directories in Cluster API.
     4  
     5  ```
     6  cluster-api
     7  └───.github
     8  └───api
     9  └───bootstrap
    10  └───cmd
    11  │   │   clusterctl
    12  └───config
    13  └───controllers
    14  └───controlplane
    15  └───dev
    16  └───docs
    17  └───errors
    18  └───exp
    19  └───feature
    20  └───hack
    21  └───internal
    22  └───logos
    23  └───scripts
    24  └───test
    25  └───util
    26  └───version
    27  └───webhooks
    28  └───main.go
    29  └───Makefile
    30  ```
    31  
    32  ### GitHub
    33  
    34  [~/.github](https://github.com/kubernetes-sigs/cluster-api/tree/main/.github)
    35  
    36  Contains GitHub workflow configuration and templates for Pull requests, bug reports etc.
    37  
    38  ### API
    39  
    40  [~/api](https://github.com/kubernetes-sigs/cluster-api/tree/main/api)
    41  
    42  This folder is used to store types and their related resources present in CAPI core. It includes things like API types, spec/status definitions, condition types, simple webhook implementation, autogenerated, deepcopy and conversion files. Some examples of Cluster API types defined in this package include Cluster, ClusterClass, Machine, MachineSet, MachineDeployment and MachineHealthCheck.
    43  
    44  API folder has subfolders for each supported API version.
    45  
    46  ### Bootstrap
    47  
    48  [~/bootstrap](https://github.com/kubernetes-sigs/cluster-api/tree/main/bootstrap)
    49  
    50  This folder contains  Cluster API bootstrap provider Kubeadm (CABPK) which is a reference implementation of a Cluster API bootstrap provider. This folder contains the types and controllers responsible for generating a cloud-init or ignition configuration to turn a Machine into a Kubernetes Node. It is built and deployed as an independent provider alongside the Cluster API controller manager.
    51  
    52  ### ControlPlane
    53  
    54  [~/controlplane](https://github.com/kubernetes-sigs/cluster-api/tree/main/controlplane)
    55  
    56  This folder contains a reference implementation of a Cluster API Control Plane provider - KubeadmControlPlane. This package contains the API types and controllers required to instantiate and manage a Kubernetes control plane. It is built and deployed as an independent provider alongside the Cluster API controller manager. 
    57  
    58  ### Cluster API Provider Docker 
    59  
    60  [~/test/infrastructure/docker](https://github.com/kubernetes-sigs/cluster-api/tree/main/test/infrastructure/docker)
    61  
    62  This folder contains a reference implementation of an infrastructure provider for the Cluster API project using Docker. This provider is intended for development purposes only. 
    63  
    64  ### Clusterctl CLI
    65  
    66  [~/cmd/clusterctl](https://github.com/kubernetes-sigs/cluster-api/tree/main/cmd/clusterctl)
    67  
    68  This folder contains Clusterctl, a CLI that can be used to deploy Cluster API and providers, generate cluster manifests, read the status of a cluster, and much more.
    69  
    70  ### Manifest Generation
    71  
    72  [~/config](https://github.com/kubernetes-sigs/cluster-api/tree/main/config)
    73  
    74  This is a Kubernetes manifest folder containing application resource configuration as kustomize YAML definitions. These are generated from other folders in the repo using `make generate-manifests`
    75  
    76  Some of the subfolders are:
    77  * [~/config/certmanager](https://github.com/kubernetes-sigs/cluster-api/tree/main/config/certmanager) - It contains manifests like self-signed issuer CR and certificate CR useful for cert manager.
    78  
    79  * [~/config/crd](https://github.com/kubernetes-sigs/cluster-api/tree/main/config/crd) - It contains CRDs generated from types defined in [api](#api) folder
    80  	
    81  * [~/config/manager](https://github.com/kubernetes-sigs/cluster-api/tree/main/config/manager) - It contains manifest for the deployment of core Cluster API manager.
    82  	
    83  * [~/config/rbac](https://github.com/kubernetes-sigs/cluster-api/tree/main/config/rbac) - Manifests for RBAC resources generated from kubebuilder markers defined in controllers.
    84  	
    85  * [~/config/webhook](https://github.com/kubernetes-sigs/cluster-api/tree/main/config/webhook) - Manifest for webhooks generated from the markers defined in the web hook implementations present in [api](#api) folder.
    86  
    87  Note: Additional `config` containing manifests can be found in the packages for [KubeadmControlPlane](#controlplane), [KubeadmBoostrap](#bootstrap) and [Cluster API Provider Docker](#cluster-api-provider-docker).
    88  
    89  ### Controllers
    90  
    91  [~/internal](https://github.com/kubernetes-sigs/cluster-api/tree/main/internal)
    92  
    93  This folder contains resources which are not meant to be used directly by users of Cluster API e.g. the implementation of controllers is present in [~/internal/controllers](https://github.com/kubernetes-sigs/cluster-api/tree/main/internal/controllers) directory so that we can make changes in controller implementation without breaking users. This allows us to keep our api surface smaller and move faster.
    94  
    95  [~/controllers](https://github.com/kubernetes-sigs/cluster-api/tree/main/controllers)
    96  
    97  This folder contains reconciler types which provide access to CAPI controllers present in [~/internal/controllers](https://github.com/kubernetes-sigs/cluster-api/tree/main/internal/controllers) directory to our users. These types can be used by users to run any of the Cluster API controllers in an external program.
    98  
    99  ### Documentation
   100  
   101  [~/docs](https://github.com/kubernetes-sigs/cluster-api/tree/main/docs)
   102  
   103  This folder is a place for proposals, developer release guidelines and the Cluster API book.
   104  
   105  [~/logos](https://github.com/kubernetes-sigs/cluster-api/tree/main/logos)
   106  
   107  Cluster API related logos and artwork
   108  
   109  ### Tools
   110  
   111  [~/hack](https://github.com/kubernetes-sigs/cluster-api/tree/main/hack)
   112  
   113  This folder has scripts used for building, testing and developer workflow.
   114  
   115  [~/scripts](https://github.com/kubernetes-sigs/cluster-api/tree/main/scripts)
   116  
   117  This folder consists of CI scripts related to setup, build and e2e tests. These are mostly called by CI jobs.
   118  
   119  [~/dev](https://github.com/kubernetes-sigs/cluster-api/tree/main/dev)
   120  
   121  This folder has example configuration for integrating Cluster API development with tools like IDEs.
   122  
   123  ### Util, Feature and Errors
   124  
   125  [~/util](https://github.com/kubernetes-sigs/cluster-api/tree/main/util)
   126  
   127  This folder contains utilities which are used across multiple CAPI package. These utils are also widely imported in provider implementations and by other users of CAPI.
   128  
   129  [~/feature](https://github.com/kubernetes-sigs/cluster-api/tree/main/feature)
   130  
   131  This package provides feature gate management used in Cluster API as well as providers. This implementation of feature gates is shared across all providers.
   132  
   133  [~/errors](https://github.com/kubernetes-sigs/cluster-api/tree/main/errors)
   134  
   135  This is a place for defining errors returned by CAPI. Error types defined here can be used by users of CAPI and the providers.
   136  
   137  ### Experimental features
   138  
   139  [~/exp](https://github.com/kubernetes-sigs/cluster-api/tree/main/exp)
   140  
   141  This folder contains experimental features of CAPI. Experimental features are unreliable until they are promoted to the main repository. Each experimental feature is supposed to be present in a subfolder of [~/exp](https://github.com/kubernetes-sigs/cluster-api/tree/main/exp) folder e.g. ClusterResourceSet is present inside [~/exp/addons](https://github.com/kubernetes-sigs/cluster-api/tree/main/exp/addons) folder. Historically, machine pool resources are not present in a sub-directory. Migrating them to a subfolder like `~/exp/machinepools` is still pending as it can potentially break existing users who are relying on existing folder structure.
   142  
   143  CRDs for experimental features are present outside [~/exp](https://github.com/kubernetes-sigs/cluster-api/tree/main/exp) directory in [~/config](https://github.com/kubernetes-sigs/cluster-api/tree/main/config) folder. Also, these CRDs are deployed in the cluster irrespective of the feature gate value. These features can be enabled and disabled using feature gates supplied to the core Cluster API controller.
   144  
   145  ### Webhooks
   146  
   147  The [api](#api) folder contains webhooks consisting of validators and defaults for many of the types in Cluster API.
   148  
   149  [~/internal/webhooks](https://github.com/kubernetes-sigs/cluster-api/tree/main/internal/webhooks)
   150  
   151  This directory contains the implementation of some of the Cluster API webhooks. The internal implementation means that the methods supplied by this package cannot be imported by external code bases. 
   152  
   153  [~/webhooks](https://github.com/kubernetes-sigs/cluster-api/tree/main/webhooks)
   154  
   155  This folder exposes the custom webhooks present in [~internal/webhooks](#webhooks) to the users of CAPI.
   156  
   157  Note: Additional webhook implementations can be found in the API packages for [KubeadmControlPlane](#controlplane), [KubeadmBoostrap](#bootstrap) and [Cluster API Provider Docker](#cluster-api-provider-docker).