Skaffold: Multiple profiles - How to

Created on 24 Jul 2019  路  7Comments  路  Source: GoogleContainerTools/skaffold

Hi all,

Skaffold documentation give option -p, --profile=[], but I'm not able to use multiple profiles.
I've tried command like this :

skaffold deploy -p p1,p2
skaffold deploy -p p1 p2
skaffold deploy -p p1 -p p2
skaffold deploy --profile p1,p2

but nothing is working. Can you give the way to use mutliple profile and update documentation ?

Idea is to use a first profile de setup some config and the second one to override some config for a specific use case.

Thanks

areprofiles kindocumentation

Most helpful comment

I experience the same behaviour with skaffold 1.0.1 on macOs 10.15.1.

All 7 comments

@lduparc your third option here should work: skaffold deploy -p p1 -p p2

can you try again and see if this works? and if not, what error you see? (along with your skaffold.yaml and OS/skaffold version info if possible)

I am also noticing that passing multiple profiles is not working as the documentation suggests.
https://skaffold.dev/docs/environment/profiles/
I am on version 1.0.1
Here is an example of a skaffold.yaml that can be used to verify:

apiVersion: skaffold/v1
kind: Config

profiles:
  - name: kafka
    deploy:
      helm:
        releases:
        - name: kafka
          namespace: kafka
          chartPath: bitnami/kafka
          remote: true
          version: 7.0.2        
  - name: zookeeper
    deploy:
      helm:
        releases:
        - name: zookeeper
          namespace: zookeeper
          chartPath: bitnami/zookeeper
          remote: true
          version: 5.1.1

Running any of the below does not work.

skaffold deploy -p kafka,zookeeper
skaffold deploy -p kafka -p zookeeper
skaffold delete -p kafka,zookeeper
skaffold delete -p kafka -p zookeeper

There are no errors (except a very lengthy WARN message that times out on deployment), but it just seems to ignore anything other than the last item in the comma separated list or the last argument passed to -p.

It also appears that setting the SKAFFOLD_PROFILE env var to kafka,zookeeper and running skaffold deploy is only grabbing the last item in the list as well.

I experience the same behaviour with skaffold 1.0.1 on macOs 10.15.1.

I couldn't get profiles to work right either. I think it should just be removed from the docs at this point unless someone can demonstrate that they work.

Any updates on this? I have also taken to slack, but am getting little to no feedback.

hey y'all, sorry for the super delayed response here.

when you activate multiple profiles, and your profiles are not using JSON patches (i.e. they're just normal skaffold configuration stanzas), skaffold will overlay the last specified profile field, not combine them. we do document that the profile fields replace the stanzas in the main section of the skaffold.yaml, but I see how this would be confusing for the section on multiple profiles: these will only be combined when using JSON patches.

so for the example @jl-ward provided, you won't be able to combine both helm releases in separate profiles - the first profile specified in your skaffold command will be activated, but the second profile will then also be activated, and take precedence.

it does look like there is an issue with the yaml patch library we're using (see https://github.com/GoogleContainerTools/skaffold/issues/2741 for more info), so we'll need to dig further into that.

Closing because an answer was provided. Thank you @nkubala

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stanislav-zaprudskiy picture stanislav-zaprudskiy  路  4Comments

heroic picture heroic  路  4Comments

nathkn picture nathkn  路  3Comments

emichaf picture emichaf  路  4Comments

garvincasimir picture garvincasimir  路  4Comments