<p>I'm having some trouble with my AWS Kubernetes instance.</p>

<p>I'm trying to get my django instances to connect to the RDS service via the DB endpoint.</p>

<pre><code>DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'NAME': os.environ['NAME'],
        'USER': os.environ['USER'],
        'PASSWORD': os.environ['PASSWORD'],
        'HOST': os.environ['HOST'],
        'PORT': os.environ['PORT']
    }
}
</code></pre>

<p>The host string would resemble this service.key.region.rds.amazonaws.com and is being passed to the container via env in the deploy.yml</p>

<pre><code>containers:
  - name: service
    env:
      - name: HOST
        value: service.key.region.rds.amazonaws.com
</code></pre>

<p>This set up works locally in kubernetes but not when I put it in the cluster I have on AWS. It returns the following error instead:</p>

<pre><code>django.db.utils.OperationalError: could not translate host name
</code></pre>

<p>Any suggestions or am I missing something in how AWS likes handling things?</p>

<p>Assuming your AWS deployment is now in the same VPC as your RDS, then you will need to change your host to use the private IP.</p>
