4

I have got a following yml file after doing kompose convert But, I want to add imagePullSecrets in the conversion output. Instead of everytime making a local change, I would like to put something in docker-compose.yml so that it gets converted automatically in kubernetes yml.

Similar usecase is needed for number of replicas as well.

How to achieve this?

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert -f monitor.yml
    kompose.deployment.spec.replicas: "2" 
  name: monitor
spec:
  replicas: 1
  template:
    spec:
      containers:
      - command:
        - python
        image: example.com/monitor

        name: monitor
        ports:
        - containerPort: 9990
        resources: {}
        stdin: true
        tty: true
        workingDir: /path/to/code
      restartPolicy: Always
status: {}
nizam.sp
  • 4,002
  • 5
  • 39
  • 63
  • You could use sed to append appropriate Keys. I specifically kompose convert the docker-compose to json and then use jq to add/delete/modify values. – hdhruna Mar 05 '18 at 12:37

1 Answers1

2

You can (now) use a kompose.image-pull-secret label https://github.com/kubernetes/kompose/blob/master/docs/user-guide.md#labels https://github.com/kubernetes/kompose/pull/1040

armb
  • 278
  • 2
  • 13