# openshift/aws-vpce-operator architecture

> Architecture diagram of the GitHub repository openshift/aws-vpce-operator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openshift/aws-vpce-operator
- Repository: https://github.com/openshift/aws-vpce-operator

## Overview

##### Main Components

a. Operator Core Components:
- Custom Resource Definitions (CRDs)
- VpcEndpoint (v1alpha1, v1alpha2)
- VpcEndpointAcceptance (v1alpha1)
- VpcEndpointTemplate (v1alpha2)
- AvoConfig (v1alpha1)

b. Controller Components:
- VPC Endpoint Controller
- VPC Endpoint Acceptance Controller
- VPC Endpoint Template Controller

c. External Systems:
- AWS Services
- VPC Endpoint Services
- Route53
- Security Groups
- IAM
- OpenShift Cluster Components
- DNS Operator
- Infrastructure Operator

- OpenShift Cluster                                      |

- AVO Operator   |  | OpenShift Core    |  |        Customer Workloads     |        |

- [Controllers]    |  | - DNS Operator    |  | - ExternalName Services       |        |
- VPCEndpoint    |  | - Infrastructure  |  | - Applications                |        |
- Acceptance     |  |   Operator        |  |                                |        |
- Template       |  |                   |  |                                |        |

- v   v

- AWS Account                                          |

- VPC Endpoints    |  |  Route53          |  |     Security Groups           |        |

- IAM Roles        |  | VPC Endpoint      |                                          |
- Services          |                                          |

##### Key Relationships

- Control flow (blue)
- Data flow (green)
- Authentication/Authorization (red)

##### Important Details

a. Controller Workflows:
- VpcEndpoint controller managing VPC endpoints and security groups
- VpcEndpointAcceptance controller handling cross-account acceptance
- VpcEndpointTemplate controller for template-based endpoint creation

b. AWS Integration Points:
- IAM permissions and roles
- VPC endpoint service connections
- Route53 private hosted zones
- Security group management

##### Technical Details to Highlight

- AWS IAM permission requirements
- Kubernetes RBAC configurations
- Custom resource relationships
- Monitoring and metrics endpoints
- Security group rule management

Remember to include the auto-discovery capabilities and the relationship between the operator and OpenShift's infrastructure components, as these are core features of the system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph OpenShiftCluster["OpenShift Cluster"]
        subgraph AVOOperator["AVO Operator"]
            CRDs["Custom Resource Definitions"]:::crd
            Controllers["Controllers"]:::controller
            AWSInt["AWS Integration"]:::integration
            DNSMgmt["DNS Management"]:::management
            InfraMgmt["Infrastructure Management"]:::management
            SecretsMgmt["Secrets Management"]:::management
            Metrics["Metrics"]:::monitoring
        end

        subgraph OpenShiftCore["OpenShift Core"]
            DNSOp["DNS Operator"]:::operator
            InfraOp["Infrastructure Operator"]:::operator
        end

        subgraph CustomerWorkloads["Customer Workloads"]
            ExtServices["ExternalName Services"]:::service
            Apps["Applications"]:::app
        end
    end

    subgraph AWSAccount["AWS Account"]
        VPCEndpoints["VPC Endpoints"]:::aws
        Route53["Route53"]:::aws
        SecurityGroups["Security Groups"]:::aws
        IAMRoles["IAM Roles"]:::aws
        VPCEndpointServices["VPC Endpoint Services"]:::aws
    end

    %% CRD Components
    CRDs --> |contains| VPCEndpointCRD["VpcEndpoint v1alpha1/2"]:::crd
    CRDs --> |contains| AcceptanceCRD["VpcEndpointAcceptance"]:::crd
    CRDs --> |contains| TemplateCRD["VpcEndpointTemplate"]:::crd
    CRDs --> |contains| ConfigCRD["AvoConfig"]:::crd

    %% Controller Components
    Controllers --> |contains| VPCController["VPC Endpoint Controller"]:::controller
    Controllers --> |contains| AcceptanceController["Acceptance Controller"]:::controller
    Controllers --> |contains| TemplateController["Template Controller"]:::controller

    %% Relationships
    VPCController --> VPCEndpoints
    VPCController --> SecurityGroups
    AcceptanceController --> VPCEndpointServices
    TemplateController --> VPCEndpoints
    AWSInt --> IAMRoles
    DNSMgmt --> Route53
    DNSMgmt --> DNSOp
    InfraMgmt --> InfraOp
    ExtServices --> VPCEndpoints

    %% Click Events
    click VPCEndpointCRD "https://github.com/openshift/aws-vpce-operator/blob/main/api/v1alpha1/vpcendpoint_types.go"
    click AcceptanceCRD "https://github.com/openshift/aws-vpce-operator/blob/main/api/v1alpha1/vpcendpointacceptance_types.go"
    click TemplateCRD "https://github.com/openshift/aws-vpce-operator/blob/main/api/v1alpha2/vpcendpointtemplate_types.go"
    click ConfigCRD "https://github.com/openshift/aws-vpce-operator/blob/main/api/v1alpha1/avoconfig_types.go"
    click VPCController "https://github.com/openshift/aws-vpce-operator/blob/main/controllers/vpcendpoint/vpcendpoint_controller.go"
    click AcceptanceController "https://github.com/openshift/aws-vpce-operator/blob/main/controllers/vpcendpointacceptance/vpcendpointacceptance_controller.go"
    click TemplateController "https://github.com/openshift/aws-vpce-operator/blob/main/controllers/vpcendpointtemplate/vpcendpointtemplate_controller.go"
    click AWSInt "https://github.com/openshift/aws-vpce-operator/tree/main/pkg/aws_client"
    click DNSMgmt "https://github.com/openshift/aws-vpce-operator/blob/main/pkg/dnses/dnses.go"
    click InfraMgmt "https://github.com/openshift/aws-vpce-operator/blob/main/pkg/infrastructures/infrastructures.go"
    click SecretsMgmt "https://github.com/openshift/aws-vpce-operator/blob/main/pkg/secrets/secrets.go"
    click Metrics "https://github.com/openshift/aws-vpce-operator/blob/main/controllers/vpcendpoint/metrics.go"

    %% Styles
    classDef crd fill:#f9f,stroke:#333,stroke-width:2px
    classDef controller fill:#bbf,stroke:#333,stroke-width:2px
    classDef integration fill:#bfb,stroke:#333,stroke-width:2px
    classDef management fill:#fbf,stroke:#333,stroke-width:2px
    classDef monitoring fill:#ff9,stroke:#333,stroke-width:2px
    classDef operator fill:#f96,stroke:#333,stroke-width:2px
    classDef service fill:#9cf,stroke:#333,stroke-width:2px
    classDef app fill:#ccc,stroke:#333,stroke-width:2px
    classDef aws fill:#ff9900,stroke:#333,stroke-width:2px
```
