Welcome to the Linux Foundation Forum!

Chapter 12: Deploying "db" App

As a follow-on to this post, for the "db" app to operate correctly in the Kubernetes environment variables need to be added to the "db" workload.

  1. spec:
  2. containers:
  3. - env:
  4. - name: POSTGRES_HOST_AUTH_METHOD
  5. value: trust
  6. image: postgres:9.4
  7. imagePullPolicy: IfNotPresent
  8. name: postgres-1

This can be added by editing the deployment details in YAML.

Comments

  • Posts: 10
    edited November 2020

    Another way to make the change is add the environment variable when creating the deployment. For me, this worked as the vote application recorded votes; my initial code above (based on this) did not have the expected result.

    The code generated by the dash board when establishing the environment instead looks like this:

    1. spec:
    2. containers:
    3. - env:
    4. - name: POSTGRES_HOST_AUTH_METHOD
    5. valueFrom:
    6. configMapKeyRef:
    7. key: POSTGRES_HOST_AUTH_METHOD
    8. name: db-config-dllr
    9. image: postgres:9.4
    10. imagePullPolicy: IfNotPresent
    11. name: postgres-1
  • @cjmills thank you for updating this. Yes, db needs the environment variable as you described to either disable the auth ( enable trust) or to actually provide the password. I am updating the instructions as well as videos accordingly.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training