Home > Back-end >  Where in the yaml do I set "HostNetwork: true"?
Where in the yaml do I set "HostNetwork: true"?

Time:01-09

I found one post that suggested I use

HostNetwork: true

in the spec: section on my bind9-deployment.yaml file but I'm not sure whether it goes in the spec: under

kind: Service

or

kind: Deployment 

section of my file.

I am hoping eventually to make my on-prem bind9 service available to my local network.

CodePudding user response:

See here for more info about DNS policy when using hostNetwork.

version: v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      container:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
  • Related