Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-1841

DO288-269: RHT1789984: ch06s04: The app container needs the QUOTES_HOSTNAME variable for connec to the database service but the service name is wrong.

XMLWordPrintable

    • ROLE
    • en-US (English)

      URL: https://role.rhu.redhat.com/rol-rhu/app/courses/do288-4.6/pages/ch06s04
      Reporter RHNID: ctiwary@redhat.com
      Section: 4 - Guided Exercise: Creating a Helm Chart
      Language: en-US (English)|||||||||
      Workaround:

      Description: The app container needs the QUOTES_HOSTNAME variable for connec to the database service but the service name is wrong. the value of the key QUOTES_HOSTNAME at the file values.yaml needs to be famouschart-mariadb and not famousapp-mariadb as indicated on the env.yaml file. the content from the env.yaml file: ... env: - name: "QUOTES_HOSTNAME" value: "famousapp-mariadb" ... bellow the logs from the app pod trying yo connect to the famousapp-mariadb:3306...

      [student@workstation multicontainer-helm]$ oc logs famouschart-7cf76d469-9kj9q

      2022/08/14 19:11:33 Connecting to the database: quotes:quotespwd@tcp(famousapp-mariadb:3306)/quotesdb 2022/08/14 19:11:33 Database connection error: dial tcp: lookup famousapp-mariadb on 172.30.0.10:53: no such host the service famousapp-mariadb doesnt exist, the correct name according the service.yaml template is: metadata: name: {{ include "famouschart.fullname" . }}

              rht-somishra Sourabh Mishra
              chetan-rhls Chetan Tiwary
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: