Error: `selector` does not match template `labels` after adding selector
Your labels and selectors are misplaced.
First, you need to specify which pods the deployment will control:
spec: replicas: 1 selector: matchLabels: app: elasticsearchconnector
Then you need to label the pod properly:
template: metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath kompose.version: 1.19.0 (f63a961c) creationTimestamp: null labels: io.kompose.service: elasticsearchconnector app: elasticsearchconnector spec: containers: