<p>I'm currently trying to autoscale my tcp services with kubernetes.
I'm not using cloud infrastructure(amazon, aws..etc) so i use haproxy for load balancing.
my tcp service isn't http protocol so i added my services with --configmap-tcp-services argument.</p>
<pre><code>    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: prokittest
    spec:
      replicas: 1
      selector:
        matchLabels:
            app: prokit-server-label
      template:
        metadata:
          labels:
            app: prokit-server-label
        spec:
          volumes:
          - name: host-volume
            hostPath: 
              path: /cosmo/
              type: DirectoryOrCreate
          containers:
          - name: flask-web-server
            image: jakgon/app:2.2
            securityContext:
              privileged: true
            volumeMounts:
            - name: host-volume
              mountPath: /node/plugins
            env:
            - name: POD_HOSTNAME
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
            - name: SERVER_GROUP
              value: &quot;lobby&quot;
            - name: MAX_PLAYER
              value: &quot;100&quot;
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            ports:
            - name: server-port
              containerPort: 25565
            - name: healthz-checker
              containerPort: 8088
    ---
    kind: Service
    apiVersion: v1
    metadata:
      name: prokittest
      annotations:
        haproxy.org/send-proxy-protocol: proxy-v2
        haproxy.org/load-balance: &quot;leastconn&quot;
        haproxy.org/check: &quot;true&quot;
        haproxy.org/check-interval: &quot;10s&quot;
      labels:
        run: prokittest
        app: service-monitor-label
    spec:
      selector:
        app: prokit-server-label
      ports:
      - name: server-port
        port: 25565
      - name: healthz-checker
        port: 8088
        targetPort: 8088
    ---
    apiVersion: monitoring.coreos.com/v1
    kind: ServiceMonitor
    metadata:
      name: blog-service-monitor
      labels:
        release: prometheus-operator
    spec:
      selector:
        matchLabels:
            app: service-monitor-label
      endpoints:
      - port: healthz-checker

</code></pre>
<p>and following is my configmap for configmap-tcp-services</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: tcp-services
  namespace: default
data:
  9000: &quot;cosmoage/prokittest:25565&quot;
</code></pre>
<p>After this applies, haproxy.cfg automatically changed when service pod resizing.
But, I can't access to haproxy server without port-forwarding manually like this:</p>
<pre><code>kubectl port-forward [[ingress pod name]] 9000:9000 --address 0.0.0.0
</code></pre>
<p>Am i misunderstanding about haproxy ConfigMap?
ingress pod name is not fixed so port forward is not a good idea for using.</p>

ChuYong
<p>Have you checked the ingress logs ?
I can see that your service is in the default namespace, not in the cosmoage</p>
<p>Try using this configmap instead:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: tcp-services
  namespace: default
data:
  &quot;9000&quot;: default/prokittest:25565
</code></pre>
