# splunk/docker-splunk architecture

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

- Interactive diagram: https://gitdiagram.com/splunk/docker-splunk
- Repository: https://github.com/splunk/docker-splunk

## Overview

##### Main Components

a. Container Images Layer:
- Base Images (CentOS, Debian, RedHat)
- Python Images (py23-image)
- Splunk Enterprise Images
- Universal Forwarder Images

b. Configuration Layer:
- Common Files and Apps
- Ansible Provisioning (via splunk-ansible)
- Environment Variables
- Volume Mounts

c. Deployment Scenarios:
- Standalone Deployment
- Distributed Deployment
- Kubernetes Deployment

**┌─ Deployment Layer ─────────────────────────┐**
- Kubernetes Orchestration                 │
- Docker Compose                          │
- Standalone Containers                    │
- Container Runtime Layer ──────────────────┤
- ┌─ Splunk Components ──────────────────┐  │
- Indexers                          │  │
- Search Heads                      │  │
- Cluster Master                    │  │
- Universal Forwarder              │  │
- ┘  │
- Configuration Management Layer ───────────┤
- Ansible Provisioning                    │
- Environment Variables                   │
- Volume Mounts                          │
- Base Image Layer ────────────────────────┤
- CentOS/RedHat/Debian Base Images       │
- Python Runtime Images                   │
- ┘

##### Key Relationships to Highlight

- How the base images are used to build the Splunk images
- Configuration flow from environment variables to container runtime
- Demonstrate how different deployment scenarios can be achieved
- Data flow between Splunk components in distributed setups

##### Additional Elements

- Annotations for important configuration points
- Integration points with external systems
- Version compatibility information

##### Deployment Scenarios

- Single instance (1so1cm.yaml)
- Clustered deployment (3idx3sh1cm.yaml)
- Kubernetes deployments (kubernetes folder scenarios)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef base fill:#1a73e8,color:white
    classDef python fill:#4285f4,color:white
    classDef splunk fill:#34a853,color:white
    classDef config fill:#fbbc04,color:white
    classDef deployment fill:#ea4335,color:white
    classDef container fill:#673ab7,color:white
    classDef docs fill:#9e9e9e,color:white

    %% Base Image Layer
    subgraph BaseLayer["Base Images"]
        CentOS["CentOS 7/8"]
        Debian["Debian 9/10"]
        RedHat["RedHat 8"]
    end
    click CentOS "https://github.com/splunk/docker-splunk/tree/develop/base/centos-7"
    click Debian "https://github.com/splunk/docker-splunk/tree/develop/base/debian-9"
    click RedHat "https://github.com/splunk/docker-splunk/tree/develop/base/redhat-8"

    %% Python Runtime Layer
    subgraph PythonLayer["Python Runtime"]
        PyCentOS["CentOS Python"]
        PyDebian["Debian Python"]
        PyRedHat["RedHat Python"]
    end
    click PyCentOS "https://github.com/splunk/docker-splunk/tree/develop/py23-image/centos-7"
    click PyDebian "https://github.com/splunk/docker-splunk/tree/develop/py23-image/debian-9"
    click PyRedHat "https://github.com/splunk/docker-splunk/tree/develop/py23-image/redhat-8"

    %% Configuration Layer
    subgraph ConfigLayer["Configuration Management"]
        CommonFiles["Common Files"]
        AnsibleProvisioning["Ansible Provisioning"]
        EnvVars["Environment Variables"]
        VolumeMounts["Volume Mounts"]
    end
    click CommonFiles "https://github.com/splunk/docker-splunk/tree/develop/splunk/common-files"
    click EnvVars "https://github.com/splunk/docker-splunk/blob/develop/splunk/common-files/createdefaults.py"

    %% Splunk Components Layer
    subgraph SplunkLayer["Splunk Components"]
        Enterprise["Splunk Enterprise"]
        UF["Universal Forwarder"]
        Apps["Enterprise Apps"]
        UFApps["Forwarder Apps"]
    end
    click Enterprise "https://github.com/splunk/docker-splunk/tree/develop/splunk"
    click UF "https://github.com/splunk/docker-splunk/tree/develop/uf"
    click Apps "https://github.com/splunk/docker-splunk/tree/develop/splunk/common-files/apps/splunk_enterprise_on_docker"
    click UFApps "https://github.com/splunk/docker-splunk/tree/develop/uf/common-files/apps/splunk_forwarder_on_docker"

    %% Deployment Layer
    subgraph DeployLayer["Deployment Scenarios"]
        K8s["Kubernetes Deployment"]
        Standalone["Standalone Deployment"]
        Distributed["Distributed Deployment"]
    end
    click K8s "https://github.com/splunk/docker-splunk/tree/develop/test_scenarios/kubernetes"
    click Standalone "https://github.com/splunk/docker-splunk/blob/develop/test_scenarios/1so1cm.yaml"
    click Distributed "https://github.com/splunk/docker-splunk/blob/develop/test_scenarios/3idx3sh1cm.yaml"

    %% Documentation
    subgraph DocsLayer["Documentation"]
        Architecture["Architecture Guide"]
        DeployGuide["Deployment Guide"]
    end
    click Architecture "https://github.com/splunk/docker-splunk/blob/develop/docs/ARCHITECTURE.md"
    click DeployGuide "https://github.com/splunk/docker-splunk/blob/develop/docs/advanced/DISTRIBUTED_TOPOLOGY.md"

    %% Relationships
    BaseLayer --> PythonLayer
    PythonLayer --> ConfigLayer
    ConfigLayer --> SplunkLayer
    SplunkLayer --> DeployLayer
    ConfigLayer --> DeployLayer
    DocsLayer -.-> DeployLayer

    %% Style Applications
    class CentOS,Debian,RedHat base
    class PyCentOS,PyDebian,PyRedHat python
    class Enterprise,UF,Apps,UFApps splunk
    class CommonFiles,AnsibleProvisioning,EnvVars,VolumeMounts config
    class K8s,Standalone,Distributed deployment
    class Architecture,DeployGuide docs
```
