title: Kubernetes Django Disallowed Hosts
body: <p>I'm trying to deploy a Django app via Kubernetes. After creating my pod definition, LoadBalancer service, and routing DNS traffic to my LoadBalancer, I'm getting a <code>Disallowed Hosts error</code>. </p>
  
  <p>I think I need to add the name of the LoadBalancer to my allowed hosts, but how do I do that when the LoadBalancer is created when I run <code>kubectl create -f service.yaml</code>?</p>
  
  <p>pod.yaml:</p>
  
  <pre><code>apiVersion: v1
  kind: Pod
  metadata:
    name: test.example.com
    labels:
      app: my-pod
  spec:
    containers:
    - name: my-container
      image: my-image:1.0
      ports:
      - name: my-port
        containerPort: 8000 
  </code></pre>
  
  <p>service.yaml</p>
  
  <pre><code>apiVersion: v1
  kind: Service
  metadata:
    name: mgmt-service
  spec:
    ports:
    - port: 80
      targetPort: mgmt-port
      protocol: TCP
    selector:
      app: mgmt_reporting
    type: LoadBalancer
  </code></pre>