spring-cloud / spring-cloud-deployer

The Spring Cloud Deployer project defines an SPI for deploying long lived applications and short lived tasks
162 stars 87 forks source link

Anyone who get trouble using property additional container & volumeMounts #454

Closed Kim-menu closed 1 week ago

Kim-menu commented 5 months ago

Description: I just want sidecar container(additional container) with my task container. I put property like below

deployer.{myapp}.kubernetes.volumes=[{name: 'promtail-config', configMap: {name: promtail-config, items: [{key: promtail.yaml, path: promtail.yaml}]}}]
deployer.{myapp}.kubernetes.additional-containers=[{name: 'promtail',image: image-path-of-promtail, ports:[{protocol: TCP,containerPort: 8080}],args: ["-config.file=/home/conf/promtail.yaml"],volumeMounts: [{name: 'promtail-config', mountPath: '/home/conf'}]}]

of course, in my k8s cluster there is definitely promtail-config yaml object.

first, I put property for volumes second, I put property for additional container. Then, I describe info about volumeMounts

but I cannot launch task with this error log.

Message: Pod "test-task-9rq9ojo3k0" is invalid: spec.containers[1].volumeMounts[0].name: Not found: "promtail-config".

Did I understand k8s system badly?....

I searched about this property or example for it, Unfortunately, there is no information about additional container's volume in SCDF

Release versions: SCDF 2.10.2

Custom apps: Task

Is there anyone who had problem like my situation..?

corneil commented 1 month ago

@Kim-menu Thank you for reporting. While we investigate I would suggest consider using promtail service discovery then you won't need a sidecar for each pod.

corneil commented 1 month ago

@Kim-menu Did you create a ConfigMap resource named promtail-config?