0

I am trying to add environment variable to my wordpress helm chart. My values.yml file looks like :

#pvc wordpress
persistence:
  enabled: false

#pvc mariadb
mariadb:
  enabled: false 

externalDatabase:
  host: mysql
  port: 3306
  user: benighil@benighil 
  password: "SomePassword"
  database: bitnami_wordpress

extraEnv:
  - name: "WORDPRESS_DATABASE_SSL_CA_FILE" # <== THIS ONE
    value: /tmp/ca-cert

## Additional volume mounts
## Example: Mount CA file
extraVolumeMounts:
  - name: ca-cert
    mountPath: /tmp

## Additional volumes
## Example: Add secret volume
extraVolumes:
 - name: ca-cert
   secret:
     secretName: ca-cert

But i generate a template using the following cmd :

helm template wp azure-marketplace/wordpress -n app --create-namespace -f values.yml > template.yml

and when i search the word : WORDPRESS_DATABASE_SSL_CA_FILE in the file template.yml :

terminal: grep WORDPRESS_DATABASE_SSL_CA_FILE template.yml there is nothing returned !

I would like to know why ?

Thank you in advance!

Mohamed
  • 239
  • 1
  • 4
  • 17

1 Answers1

2

The correct param is extraEnvVars not extraEnv

## @param extraEnvVars Array with extra environment variables to add to the WordPress container
## e.g:
## extraEnvVars:
##   - name: FOO
##     value: "bar"

so the values should be

extraEnvVars:
  - name: "WORDPRESS_DATABASE_SSL_CA_FILE" # <== THIS ONE
    value: /tmp/ca-cert

https://github.com/bitnami/azure-marketplace-charts/blob/master/bitnami/wordpress/values.yaml#L225

helm template wp azure-marketplace/wordpress -f values.yaml | grep "WORDPRESS_DATABASE_SSL_CA_FILE"
Adiii
  • 54,482
  • 7
  • 145
  • 148
  • 1
    Hello @Adiii Thank you for your helpful reponse. I have another question (https://stackoverflow.com/questions/73263642/why-wordpress-helm-chart-not-able-to-connect-azure-mariadb-having-ssl-enabled?noredirect=1#comment129388768_73263642 ) related to this one. Any idea please ? – Mohamed Aug 07 '22 at 10:04
  • 1
    @Mohamed check my recent comment on the question – Adiii Aug 07 '22 at 10:17