ipedrazas / drone-helm

Helm (Kubernetes) plugin for drone.io
MIT License
120 stars 90 forks source link

values section seems to be not working. #97

Closed mithucste30 closed 5 years ago

mithucste30 commented 5 years ago

Hi, I am stuck in a place for a while, i am using drone stable version, installed on kubernetes

here is my .drone.yaml

- name: release_staging
    image: quay.io/ipedrazas/drone-helm
    environment:
      STAGING_API_SERVER:
        from_secret: staging_api_server
      STAGING_KUBERNETES_TOKEN:
        from_secret: staging_kubernetes_token
    settings:
      skip_tls_verify: true
      chart: ./helm
      release: staging
      values: >-
        secret.APPLE_VERIFY_RECEIPT_PASSWORD=${APPLE_VERIFY_RECEIPT_PASSWORD},
        secret.AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID},
        secret.AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY},
        secret.OPBEAT_SECRET_TOKEN=${OPBEAT_SECRET_TOKEN},
        secret.FACEBOOK_KEY=${FACEBOOK_KEY},
        secret.FACEBOOK_SECRET=${FACEBOOK_SECRET},
        secret.GOOGLE_TAG_ID=${GOOGLE_TAG_ID},
        secret.OPBEAT_ORGANIZATION_ID=${OPBEAT_ORGANIZATION_ID},
        secret.AWS_BACKUP_ACCESS_KEY_ID=${AWS_BACKUP_ACCESS_KEY_ID},
        secret.AWS_BACKUP_SECRET_ACCESS_KEY=${AWS_BACKUP_SECRET_ACCESS_KEY},
        secret.DATABASE_URL=${DATABASE_URL},
        secret.DROPBOX_KEY=${DROPBOX_KEY},
        secret.DROPBOX_SECRET=${DROPBOX_SECRET},
        secret.MAILCHIMP_API_KEY=${MAILCHIMP_API_KEY},
        secret.MAILCHIMP_LIST_ID=${MAILCHIMP_LIST_ID},
        secret.NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY},
        secret.OPBEAT_APP_ID=${OPBEAT_APP_ID},
        secret.SECRET_KEY_BASE=${SECRET_KEY_BASE},
        secret.SENDGRID_USERNAME=${SENDGRID_USERNAME},
        secret.SENDGRID_PASSWORD=${SENDGRID_PASSWORD},
        secret.DOCKER_CONFIG_JSON=${DOCKER_CONFIG_JSON},
        SUBDOMAIN=staging,
        image.tag=13
      prefix: STAGING
      namespace: staging
      values_files: ["helm/values.staging.yaml"]

what i did it i intentionally created error and saw the debug log, it looks the helm command is not picking up these values.

Error running helm command: upgrade --install staging ./helm --set secret.APPLE_VERIFY_RECEIPT_PASSWORD=, secret.AWS_ACCESS_KEY_ID=, secret.AWS_SECRET_ACCESS_KEY=, secret.OPBEAT_SECRET_TOKEN=, secret.FACEBOOK_KEY=, secret.FACEBOOK_SECRET=, secret.GOOGLE_TAG_ID=, secret.OPBEAT_ORGANIZATION_ID=, secret.AWS_BACKUP_ACCESS_KEY_ID=, secret.AWS_BACKUP_SECRET_ACCESS_KEY=, secret.DATABASE_URL=, secret.DROPBOX_KEY=, secret.DROPBOX_SECRET=, secret.MAILCHIMP_API_KEY=, secret.MAILCHIMP_LIST_ID=, secret.NEW_RELIC_LICENSE_KEY=, secret.OPBEAT_APP_ID=, secret.SECRET_KEY_BASE=, secret.SENDGRID_USERNAME=, secret.SENDGRID_PASSWORD=, secret.DOCKER_CONFIG_JSON=, image.tag=13 --values helm/values.staging.yaml --namespace staging

and even if it successfully deploys i can see in deployment the image tag is latest which is written in values.yaml file,

image:
  tag: latest

its picking that one, but not my value 13.

I have no clue.

is ${SECRET_NAME} is the right way to write values in .drone.yaml? I have exactly copied the content of my yaml, so i am asking if dollarsign-bracket-value-bracket is that right format? why my image.tag not reaching to my deployment template?

FYI: i added secrets from drone UI under that project with prefixed with STAGING. I am using postgres as data storage, and i enabled encryption.

Screenshot 2019-07-16 at 5 53 46 PM
mithucste30 commented 5 years ago

@ipedrazas @one000mph can you please help me here? 🙏 🙏 🙏

mithucste30 commented 5 years ago

Sorry i found the the solution. I have to set them in environment variable and then use them as $VAR_NAME