zotregistry.io/zot@v1.4.4-0.20231124084042-02a8ed785457/examples/metrics/kubernetes/zot-extended/deployment.yaml (about)

     1  apiVersion: apps/v1
     2  kind: Deployment
     3  metadata:
     4    name: zot-extended
     5    labels:
     6      app: zot-extended
     7  spec:
     8    replicas: 1
     9    selector:
    10      matchLabels:
    11        app: zot-extended
    12    template:
    13      metadata:
    14        labels:
    15          app: zot-extended
    16      spec:
    17        containers:
    18        - name: zot-extended
    19          image: zot-build:latest
    20          imagePullPolicy: IfNotPresent
    21          command: ["/usr/bin/zot"]
    22          args: ["serve", "/zot-config/config.json"]
    23          ports:
    24          - name: zot-extended
    25            containerPort: 5000
    26            protocol: TCP
    27          volumeMounts:
    28            - name: zot-config
    29              mountPath: /zot-config
    30              readOnly: false
    31        volumes:
    32          - name: zot-config
    33            configMap:
    34              name: zot-config
    35              items:
    36              - key: zot_config.json
    37                path: config.json
    38              - key: htpasswd
    39                path: htpasswd
    40  ---
    41  apiVersion: v1
    42  kind: ConfigMap
    43  metadata:
    44    name: zot-config
    45  data:
    46    zot_config.json: |
    47      {
    48        "distSpecVersion":"1.0.1",
    49        "storage": {
    50            "rootDirectory": "/var/lib/registry"
    51        },
    52        "http": {
    53            "address": "0.0.0.0",
    54            "port": "5000",
    55            "auth": {
    56                "htpasswd": {
    57                  "path": "/zot-config/htpasswd"
    58                }
    59            },
    60            "accessControl": {
    61                "metrics":{
    62                    "users": ["metrics"]
    63                },
    64                "repositories": {
    65                    "**": {
    66                        "anonymousPolicy": [
    67                            "read"
    68                        ],
    69                        "defaultPolicy": ["read","create"]
    70                    }
    71                }
    72            }
    73        },
    74        "log": {
    75            "level": "debug"
    76        },
    77        "extensions": {
    78            "metrics": {
    79                "enable": true,
    80                "prometheus": {
    81                    "path": "/metrics"
    82                }
    83            }
    84        }
    85      }
    86    zot_minimal.json: |
    87      {
    88        "distSpecVersion":"1.0.1",
    89        "storage": {
    90            "rootDirectory": "/var/lib/registry"
    91        },
    92        "http": {
    93            "address": "0.0.0.0",
    94            "port": "5050"
    95        },
    96        "log": {
    97            "level": "debug"
    98        }
    99      }
   100    zxp.json: |
   101      {
   102        "Server": {
   103          "protocol": "http",
   104          "host": "127.0.0.1",
   105          "port": "5050"
   106        },
   107        "Exporter": {
   108          "port": "5051",
   109          "log": {
   110              "level": "debug"
   111          }
   112        }
   113      }
   114    # Example htpasswd with 'test:test' & 'metrics:metrics' user:pass pairs
   115    htpasswd: |-
   116      test:$2y$05$.jSWenVyzEK3em/Gfr0AG.WRSAIdi4nxqW9h27xK7WCw24wmQH/1m
   117      metrics:$2y$05$4yBka/ZTKgXhvCMb48BnyOZqj/DrKT1sGPZLAg5RbobQ0CQCJHmTO