# Installing on Kubernetes

**URL:** <https://meta.discourse.org/t/installing-on-kubernetes/49329>\
**Category:** Self-hosting\
**Tags:** unsupported-install\
**Created:** [2016 年 8 月 27 日午後 10:59 UTC](https://meta.discourse.org/t/installing-on-kubernetes/49329 "2016-08-27T22:59:09Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![felicity](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/felicity/32/121572_2.png) [@felicity](https://meta.discourse.org/u/felicity)\
**Post date:** [2016 年 8 月 28 日午後 2:51 UTC](https://meta.discourse.org/t/installing-on-kubernetes/49329/5 "2016-08-28T14:51:29Z")

</div>

Okay, I think I’m missing something about how the launcher script (or pups) works here.

I have one YAML file for each instance, which looks like this:

```plaintext
discourse@hawthorn:~/discourse$ cat containers/clicsargent.yml 
templates:
  - "templates/torchbox-web.template.yml"
  - "private/clicsargent.template.yml"

env:
  DISCOURSE_HOSTNAME: 'clicsargent-stage-discourse.torchboxapps.com'
  DISCOURSE_DB_USERNAME: clicsargent_discourse
  DISCOURSE_DB_NAME: clicsargent_discourse

```

`torchbox-web.template.yml` sets the global database configuration:

```plaintext
discourse@hawthorn:~/discourse$ cat templates/torchbox-web.template.yml 
# This is a Discourse build for Torchbox servers on Kubernetes.

templates:
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"

env:
  LANG: en_US.UTF-8
  UNICORN_WORKERS: 1
  DISCOURSE_DEVELOPER_EMAILS: 'sysadmin@torchbox.com'
  DISCOURSE_DB_SOCKET: ''
  DISCOURSE_DB_HOST: postgres-2.itl.rslon.torchbox.net
  DISCOURSE_REDIS_HOST: redis-1-cache.itl.rslon.torchbox.net
  DISCOURSE_REDIS_DB: '9'
  DISCOURSE_REDIS_PORT: '6381'
  DISCOURSE_SMTP_ADDRESS: mailer.itl.svc.torchbox.net

```

Then I set a database password in a separate file, so it doesn’t need to go in the Git repository:

```plaintext
discourse@hawthorn:~/discourse$ cat private/clicsargent.template.yml 
env:
  DISCOURSE_DB_PASSWORD: <password>

```

However, running the build doesn’t seem to pick up the correct database settings from the template

```plaintext
discourse@hawthorn:~/discourse$ ./launcher bootstrap clicsargent
[...]
 Failed to initialize site default
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

```

If I move all the database settings except password to `containers/<instance>.yml`, then it does work, and it correctly picks up the password from `private/<instance>.yml`.

What am I missing here? My understanding was that all the `env` settings would be merged from templates.

---

_[View the full topic](https://meta.discourse.org/t/installing-on-kubernetes/49329)._
