apiVersion: apps/v1
kind: Deployment
metadata:
  name: sc4-snmp-traps
  labels:
    app: sc4-snmp-traps
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sc4-snmp-traps
  template:
    metadata:
      labels:
        app: sc4-snmp-traps
    spec:
      containers:
        - name: traps
          image: ghcr.io/splunk/splunk-connect-for-snmp-traps:1
          imagePullPolicy: Always
          args: ["--loglevel=WARN", "--config=/work/config/config.yaml"]
          ports:
            - containerPort: 2162
          env:
            - name: MIBS_SERVER_URL
              value: http://$(MIB_SERVER_SERVICE_SERVICE_HOST):$(MIB_SERVER_SERVICE_SERVICE_PORT)
            - name: OTEL_SERVER_URL
              value: http://$(OTEL_SERVICE_SERVICE_HOST):$(OTEL_SERVICE_SERVICE_PORT_LOGS)
            - name: SPLUNK_HEC_URL
              valueFrom:
                secretKeyRef:
                  name: remote-splunk
                  key: SPLUNK_HEC_URL
            - name: SPLUNK_HEC_TOKEN
              valueFrom:
                secretKeyRef:
                  name: remote-splunk
                  key: SPLUNK_HEC_TOKEN
            - name: SPLUNK_HEC_TLS_SKIP_VERIFY
              valueFrom:
                secretKeyRef:
                  name: remote-splunk
                  key: SPLUNK_HEC_TLS_SKIP_VERIFY
          volumeMounts:
            - name: config
              mountPath: "/work/config"
              readOnly: true
      volumes:
         - name: config
           configMap:
             name: sc4snmp-trap
             items:
               - key: "config.yaml"
                 path: "config.yaml"


