apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: the-platform
  name: echo
  labels:
    app: echo
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: echo
  template:
    metadata:
      labels:
        app: echo
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: app
                      operator: In
                      values:
                        - echo
                topologyKey: kubernetes.io/hostname
      containers:
        - name: echo
          image: apk8s/echo:v0.0.2
          imagePullPolicy: IfNotPresent
          env:
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            - name: NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
          ports:
            - name: tcp-echo
              containerPort: 1025
            - name: http-metrics
              containerPort: 2112