# palomar88/gestion_de_usuarios_y_reglas_de_acceso_en_kubernetes architecture

> Architecture diagram of the GitHub repository palomar88/gestion_de_usuarios_y_reglas_de_acceso_en_kubernetes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/palomar88/gestion_de_usuarios_y_reglas_de_acceso_en_kubernetes
- Repository: https://github.com/palomar88/gestion_de_usuarios_y_reglas_de_acceso_en_kubernetes

## Overview

##### File Structure Analysis
- Top-level:
- Proyecto.md – full project spec and step-by-step scenarios
- README.md – table of contents pointing to sections in Proyecto.md
- No source directories; focus is purely on infrastructure/components.

##### README Insights
- Sections 1–2: introduction and cluster scenario setup
- Section 3: access control broken into Authentication (client X.509 certs), Authorization (policy enforcement), RBAC & Quotas (Roles, RoleBindings, resource quotas)
- Section 4: auxiliary CLI/tools (elastickube, klum, rakkess, kubectl-who-can, rbac-lookup)

a. Main Components to include
- End Users / Clients (kubectl, CI/CD pipelines)
- Kubernetes API Server (the single entrypoint)
- Authentication subsystem (X.509 certificate issuer or external IdP)
- Authorization subsystem:
– Static/admission plugins (Node authorizer, NamespaceLifecycle)
– RBAC engine (Roles, ClusterRoles, RoleBindings, ClusterRoleBindings)
– ResourceQuota controller
- etcd datastore
- Kubelet & Controller Manager (optional detail)
- Auxiliary tools (elastickube, klum, rakkess, kubectl-who-can, rbac-lookup)

b. Relationships & Interactions
1. Client presents X.509 cert ➔ API Server
2. API Server calls Authentication plugins ➔ validate cert against CA
3. If authenticated, API Server passes request to Authorization chain:
– Static rules ➔ RBAC rules lookup ➔ Quota evaluation
4. Upon authorization, API Server writes to etcd or returns response
5. Controller Manager / Kubelet react to changes in etcd
6. Auxiliary tools query API Server to inspect RBAC/quotas

c. Architectural Patterns & Principles
- API-centric design: single control-plane entry
- Pluggable authentication & authorization modules
- Declarative configuration stored in etcd
- Separation of concerns: authentication vs. authorization vs. resource management

d. Key Technologies & Frameworks
- Kubernetes Control Plane (API Server, etcd, Admission Controllers)
- X.509 PKI for client cert auth
- Kubernetes RBAC API objects (Role, ClusterRole, RoleBinding, ClusterRoleBinding)
- ResourceQuota API
- Third-party CLI tools for introspection

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Clients & CI/CD"
        User["End Users / CI/CD"]:::frontend
    end

    subgraph "Auxiliary Tools"
        Elastic["elastickube"]:::tools
        Klum["klum"]:::tools
        Rakkess["rakkess"]:::tools
        WhoCan["kubectl-who-can"]:::tools
        Lookup["rbac-lookup"]:::tools
    end

    subgraph "API-Centric Control Plane"
        APIServer["Kubernetes API Server"]:::core
        AuthN["Authentication Plugins"]:::core
        AuthZStatic["Static Admission Plugins"]:::core
        RBAC["RBAC Engine"]:::core
        Quota["ResourceQuota Controller"]:::core
    end

    subgraph "Data & Controllers"
        etcd["etcd Datastore"]:::storage
        CM["Controller Manager & Kubelet"]:::core
    end

    subgraph "Documentation"
        Doc1["Proyecto.md"]:::doc
        Doc2["README.md"]:::doc
        Diagrams["image/"]:::doc
    end

    %% Core flows
    User -->|"TLS handshake"| APIServer
    APIServer -->|"Validate client cert"| AuthN
    AuthN -->|"Authenticated"| APIServer
    APIServer -->|"Staticpolicy"| AuthZStatic
    AuthZStatic -->|"Enforcerules"| APIServer
    APIServer -->|"EvaluateRBAC"| RBAC
    RBAC -->|"RBAC decision"| APIServer
    APIServer -->|"EvaluateQuota"| Quota
    Quota -->|"Quota decision"| APIServer
    APIServer -->|"etcd read/write"| etcd
    etcd -->|"Watch events"| CM
    CM -->|"Update status"| etcd

    %% Tool interactions
    Elastic -.->|"query API"| APIServer
    Klum -.->|"query API"| APIServer
    Rakkess -.->|"query API"| APIServer
    WhoCan -.->|"kubectl auth can-i"| APIServer
    Lookup -.->|"list bindings"| APIServer

    %% Documentation links
    Doc1 --- Doc2
    Doc2 --- Diagrams

    %% Click Events
    click Doc1 "https://github.com/palomar88/gestion_de_usuarios_y_reglas_de_acceso_en_kubernetes/blob/master/Proyecto.md"
    click Doc2 "https://github.com/palomar88/gestion_de_usuarios_y_reglas_de_acceso_en_kubernetes/blob/master/README.md"
    click Diagrams "https://github.com/palomar88/gestion_de_usuarios_y_reglas_de_acceso_en_kubernetes/tree/master/image/"

    %% Styles
    classDef frontend fill:#9f6,stroke:#333,stroke-width:1px
    classDef core fill:#6bf,stroke:#333,stroke-width:1px
    classDef storage fill:#bbb,stroke:#333,stroke-width:1px
    classDef tools fill:#f90,stroke:#333,stroke-width:1px
    classDef doc fill:#eee,stroke:#333,stroke-width:1px
```
