|  | 
| 4 | 4 | 
 | 
| 5 | 5 | ## About this project | 
| 6 | 6 | 
 | 
| 7 |  | -openMCP Operator manages the lifecycle of an openMCP landscape | 
|  | 7 | +The `openmcp-operator` is the central and mandatory component of an openMCP landscape. | 
|  | 8 | +The `openmcp-operator` is a Kubernetes operator that contains resource controllers for the following use cases: | 
|  | 9 | + | 
|  | 10 | +* Deployment Controller: The Deployment Controller is responsible to create Kubernetes deployments and manage the lifecycle for `ClusterProviders`, `ServiceProviders` and `PlatformServices` Kubernetes resources on the platform cluster. | 
|  | 11 | +* Cluster Scheduler: The cluster scheduler reads `ClusterRequests` and creates either new `Clusters` or reuses existing `Clusters` on the platform cluster. The `Cluster` resources are managed by a `ClusterProvider`, which is not part of the `openmcp-operator`. The scheduling behavior can be configured by a scheduler configuration. | 
|  | 12 | +* MCP Controller: The MCP controller is responsible for reconciling `ManagedControlPlanes` on the onboarding cluster and to create a `ClusterRequest` for a `ManagedControlPlane` on the platform cluster. The MCP controller is also handling user authentication and authorization for the `ManagedControlPlane`. | 
|  | 13 | + | 
|  | 14 | +### Deployment Controller | 
|  | 15 | + | 
|  | 16 | +For each type of deployable, `ClusterProvider`, `ServiceProvider` and `PlatformService`, several Kubernetes resources are being created/updated. | 
|  | 17 | +The following resources are created/updated: | 
|  | 18 | + | 
|  | 19 | +* `Deployment`: The deployment is created/updated with the image of the deployable and the pull secrets provider. The image is called with the following arguments: | 
|  | 20 | +  * `run`: Tells the deployable to start the main operator process. | 
|  | 21 | +  * `--environment`: The logical environment the deployable is running in. This is used to filter for resources it is responsible for. | 
|  | 22 | +   | 
|  | 23 | +* `Job`: The job is created/updated with the image of the deployable and the pull secrets provider. The image is called with the following arguments: | 
|  | 24 | +  * `init`: Tells the deployable to start the initialization routine. This can be used to deploy Custom Resource Definitions (CRDs) or webhook configurations. | 
|  | 25 | +  * `--environment`: The logical environment the deployable is running in. This is used to filter for resources it is responsible for. | 
|  | 26 | + | 
|  | 27 | +* `ServiceAccount`: The service account is used to access the platform cluster the deployable is running in. | 
|  | 28 | +* `ClusterRole`: The cluster role is used to access the resources the deployable is responsible for. | 
|  | 29 | +* `ClusterRoleBinding`: The cluster role binding is used to bind the service account to the cluster role. | 
|  | 30 | + | 
|  | 31 | +#### ClusterProvider | 
|  | 32 | + | 
|  | 33 | +To deploy a Cluster Provider, the following API is used: | 
|  | 34 | + | 
|  | 35 | +```yaml | 
|  | 36 | +apiVersion: openmcp.cloud/v1alpha1 | 
|  | 37 | +kind: ClusterProvider | 
|  | 38 | +metadata: | 
|  | 39 | +  name: my-cluster-provider | 
|  | 40 | +spec: | 
|  | 41 | +  image: ghcr.io/openmcp-project/images/my-cluster-provider:v0.1.0 | 
|  | 42 | +  imagePullSecrets: | 
|  | 43 | +    - name: my-image-pull-secret | 
|  | 44 | +``` | 
|  | 45 | +
 | 
|  | 46 | +#### ServiceProvider | 
|  | 47 | +
 | 
|  | 48 | +To deploy a Service Provider, the following API is used: | 
|  | 49 | +
 | 
|  | 50 | +```yaml | 
|  | 51 | +apiVersion: openmcp.cloud/v1alpha1 | 
|  | 52 | +kind: ServiceProvider | 
|  | 53 | +metadata: | 
|  | 54 | +  name: my-service-provider | 
|  | 55 | +spec: | 
|  | 56 | +  image: ghcr.io/openmcp-project/images/my-service-provider:v0.1.0 | 
|  | 57 | +  imagePullSecrets: | 
|  | 58 | +    - name: my-image-pull-secret | 
|  | 59 | +``` | 
|  | 60 | +
 | 
|  | 61 | +#### PlatformService | 
|  | 62 | +
 | 
|  | 63 | +To deploy a Platform Service, the following API is used: | 
|  | 64 | +
 | 
|  | 65 | +```yaml | 
|  | 66 | +apiVersion: openmcp.cloud/v1alpha1 | 
|  | 67 | +kind: PlatformService | 
|  | 68 | +metadata: | 
|  | 69 | +  name: my-platform-service | 
|  | 70 | +spec: | 
|  | 71 | +  image: ghcr.io/openmcp-project/images/my-platform-service:v0.1.0 | 
|  | 72 | +  imagePullSecrets: | 
|  | 73 | +    - name: my-image-pull-secret | 
|  | 74 | +``` | 
|  | 75 | +
 | 
|  | 76 | +### Cluster Scheduler | 
|  | 77 | +
 | 
|  | 78 | +A `Cluster` can be created by the following API: | 
|  | 79 | + | 
|  | 80 | +```yaml | 
|  | 81 | +apiVersion: clusters.openmcp.cloud | 
|  | 82 | +kind: Cluster | 
|  | 83 | +metadata: | 
|  | 84 | +  name: my-cluster | 
|  | 85 | +  namespace: default | 
|  | 86 | +spec: | 
|  | 87 | +  profile: my-cluster-profile | 
|  | 88 | +  clusterConfigRef: | 
|  | 89 | +    apiGroup: clusters.openmcp.cloud | 
|  | 90 | +    Kind: MyClusterConfig | 
|  | 91 | +    name: my-cluster-config | 
|  | 92 | +  kubernetes: | 
|  | 93 | +    version: v1.32.0 | 
|  | 94 | +  purposes: | 
|  | 95 | +    - testing | 
|  | 96 | +    - workload | 
|  | 97 | +  tenancy: Shared | 
|  | 98 | +``` | 
|  | 99 | + | 
|  | 100 | +A `ClusterRequest` can be created by the following API: | 
|  | 101 | + | 
|  | 102 | +```yaml | 
|  | 103 | +apiVersion: clusters.openmcp.cloud | 
|  | 104 | +kind: ClusterRequest | 
|  | 105 | +metadata: | 
|  | 106 | +  name: my-cluster-request | 
|  | 107 | +  namespace: default | 
|  | 108 | +spec: | 
|  | 109 | +  purpose: workload | 
|  | 110 | +``` | 
|  | 111 | + | 
|  | 112 | +The cluster scheduler will create or re-use an already existing `Cluster` resource for the `ClusterRequest` and assign it to the `ClusterRequest`. | 
|  | 113 | + | 
|  | 114 | +An `AccessRequest` can be created by the following API: | 
|  | 115 | + | 
|  | 116 | +```yaml | 
|  | 117 | +apiVersion: clusters.openmcp.cloud | 
|  | 118 | +kind: AccessRequest | 
|  | 119 | +metadata: | 
|  | 120 | +  name: my-access-request | 
|  | 121 | +  namespace: default | 
|  | 122 | +spec: | 
|  | 123 | +  clusterRef: | 
|  | 124 | +    name: my-cluster | 
|  | 125 | +    namespace: default | 
|  | 126 | +
 | 
|  | 127 | +  permissions: | 
|  | 128 | +    # Role | 
|  | 129 | +    - namespace: default | 
|  | 130 | +      rules: | 
|  | 131 | +        - apiGroups: | 
|  | 132 | +            - "" | 
|  | 133 | +          resources: | 
|  | 134 | +            - "secrets" | 
|  | 135 | +          verbs: | 
|  | 136 | +            - "*" | 
|  | 137 | +    # ClusterRole | 
|  | 138 | +    - rules: | 
|  | 139 | +        - apiGroups: | 
|  | 140 | +            - "" | 
|  | 141 | +          resources: | 
|  | 142 | +            - "configmaps" | 
|  | 143 | +          verbs: | 
|  | 144 | +            - "*" | 
|  | 145 | +       | 
|  | 146 | +``` | 
|  | 147 | + | 
|  | 148 | +This will result in a `ServiceAccount` on the referenced `Cluster` with the specified permissions applied. | 
| 8 | 149 | 
 | 
| 9 | 150 | ## Requirements and Setup | 
| 10 | 151 | 
 | 
| 11 |  | -*Insert a short description what is required to get your project running...* | 
|  | 152 | +### Running in cluster | 
|  | 153 | + | 
|  | 154 | +The `openmcp-operator` is designed to run in a Kubernetes cluster. Run the following command to deploy the operator in a Kubernetes cluster: | 
|  | 155 | + | 
|  | 156 | +```bash | 
|  | 157 | +kubectl create deployment openmcp-operator --image ghcr.io/openmcp-project/openmcp-operator:latest | 
|  | 158 | +``` | 
| 12 | 159 | 
 | 
| 13 | 160 | ## Support, Feedback, Contributing | 
| 14 | 161 | 
 | 
|  | 
0 commit comments