Skip to content

Secret Template applies secrets successfully but stage fails #154

@awesomohsin

Description

@awesomohsin

Hi Im using the secret_template option in the drone-gke plugin but running into a weird situation where the secrets are applied successfully on my kubernetes cluster but the stage returns an error saying.

Error (kubectl output redacted): Error: exit status 1

Here are screenshots after running once and twice
Screenshot 2022-03-09 at 6 30 53 PM

Screenshot 2022-03-09 at 6 17 58 PM

Heres the plugin configuration

  • name: deploy
    image: nytimes/drone-gke
    environment:
    TOKEN:
    from_secret: GOOGLE_CREDENTIALS
    SECRET_DOCKER_CFG:
    from_secret: KUBERNETES_PULL_SECRET
    ... all the other secrets stored in drone ..
    settings:
    cluster: clustername
    expand_env_vars: true
    namespace: ${DRONE_BRANCH}
    zone: us-west1-a
    template: kubernetes/deployment-template.yml
    secret_template: kubernetes/secret-template.yml

The secret template looks like this

apiVersion: v1
kind: Secret
metadata:
name: secret1
type: Opaque
data:
user_name: {{.SECRET_}}

apiVersion: v1
kind: Secret
metadata:
name: secret2
type: Opaque
data:
user_passt: {{.SECRET_}}

apiVersion: v1
kind: Secret
metadata:
name: secret3
type: Opaque
data:
user_id: {{.SECRET_}}

Any pointers as to what may be happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions