github.com/grafana/synthetic-monitoring-agent@v0.64.2/examples/kubernetes/deployment.yaml (about)

     1  apiVersion: apps/v1
     2  kind: Deployment
     3  metadata:
     4    name: sm-agent-1
     5    namespace: synthetic-monitoring
     6  spec:
     7    minReadySeconds: 10
     8    replicas: 1
     9    revisionHistoryLimit: 10
    10    selector:
    11      matchLabels:
    12        name: sm-agent-1
    13    strategy:
    14      rollingUpdate:
    15        maxSurge: 0
    16        maxUnavailable: 1
    17    template:
    18      metadata:
    19        labels:
    20          name: sm-agent-1
    21      spec:
    22        containers:
    23          - args:
    24              - --api-server-address=$(API_SERVER)
    25              - --api-token=$(API_TOKEN)
    26              - --verbose=true
    27              # Uncomment to listen on all interfaces. This exposes metrics and debugging endpoints to the cluster, so it
    28              # should only be done on trusted clusters or with network policies set in place.
    29              # - --listen-address=0.0.0.0:4050
    30            env:
    31              - name: API_TOKEN
    32                valueFrom:
    33                  secretKeyRef:
    34                    key: api-token
    35                    name: sm-agent-1
    36              - name: API_SERVER
    37                valueFrom:
    38                  secretKeyRef:
    39                    key: api-server
    40                    name: sm-agent-1
    41            image: grafana/synthetic-monitoring-agent:latest
    42            name: agent
    43            ports:
    44              - containerPort: 4050
    45                name: http-metrics
    46            securityContext:
    47              capabilities:
    48                add:
    49                  - NET_RAW # Needed for ICMP (ping and traceroute) checks.
    50                drop:
    51                  - all
    52              readOnlyRootFilesystem: true
    53              runAsNonRoot: true
    54              runAsUser: 12345 # https://github.com/grafana/synthetic-monitoring-agent/blob/main/Dockerfile#L24
    55            # Readiness/liveness probes can be enabled to show the agent as not ready if it cannot successfully connect
    56            # to the Grafana Synthetic Monitoring API. Enabling this probes requires configuring the agent to listen on
    57            # all interfaces, so they are commented out by default.
    58            # readinessProbe:
    59            #   httpGet:
    60            #     path: /ready
    61            #     port: 4050
    62            # livenessProbe:
    63            #   httpGet:
    64            #     path: /
    65            #     port: 4050
    66            resources:
    67              requests:
    68                cpu: 200m
    69                memory: 500Mi
    70            volumeMounts:
    71              - name: tmp
    72                subPath: tmp
    73                mountPath: /tmp
    74              # Uncomment the following volumeMount if you are using the -browser image, as Chromium needs to be able to
    75              # write temporary files.
    76              # - name: tmp
    77              #   subPath: home-sm
    78              #   mountPath: /home/sm
    79        volumes:
    80          - name: tmp
    81            emptyDir: {}