apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: consul-esm
  name: consul-esm
  namespace: consul
spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: consul-esm
  template:
    metadata:
      labels:
        app.kubernetes.io/name: consul-esm
    spec:
      containers:
      - command:
        - /bin/consul-esm
        - -config-dir=/config
        image: rascal/consul-esm:v0.3.3
        imagePullPolicy: Always
        name: consul-esm
        resources:
          limits:
            cpu: 100m
            memory: 32Mi
          requests:
            cpu: 20m
            memory: 32Mi
        env:
        - name: HOST_IP
          valueFrom:
            fieldRef:
              fieldPath: status.hostIP
        - name: CONSUL_HTTP_ADDR
          value: $(HOST_IP):8500
        volumeMounts:
        - name: config-volume
          mountPath: /config
        securityContext:
          capabilities:
            add:
            - NET_RAW
      volumes:
      - name: config-volume
        configMap:
          name: consul-esm-config

