Skip to content

Instantly share code, notes, and snippets.

@Oddly
Created October 2, 2024 17:32
Show Gist options
  • Save Oddly/5ac1375407b3fcc79782ad1b83664c10 to your computer and use it in GitHub Desktop.
Save Oddly/5ac1375407b3fcc79782ad1b83664c10 to your computer and use it in GitHub Desktop.
Connect a Pod Kubernetes on Docker desktop with a container on Docker desktop

This will create a Kubernetes Service of type ExternalName which will expose host.docker.internal, which will resolve to the host machine's IP address.

Create a file docker-connect.yml with below contents. Then do kubectl apply -f docker-connect.yml

apiVersion: v1
kind: Service
metadata:
  name: docker-container-service
spec:
  type: ExternalName
  externalName: host.docker.internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment