Closed thesoundofsilent closed 2 years ago
@thesoundofsilent: Ah, interesting! Also, any reasoning to back the ask would be helpful. Feel free to submit a PR to kickstart the conversation, too.
@thesoundofsilent
The volumes are specified in yaml format as per DeploymentPropertiesResolver#getVolumes().
Try this:
spring.cloud.deployer.kubernetes.volumes=[{ name: cache-volume, emptyDir: { } }]
@thesoundofsilent
My above suggestion works for a "deployment" property because the DeploymentPropertiesResolver converts from yaml to the expected list of volumes correctly. However, as a "deployer" property (as listed in your example), it fails to convert w/ the following:
Failed to bind properties under 'spring.cloud.skipper.server.platform.kubernetes.accounts.default.volumes[0].empty-dir' to io.fabric8.kubernetes.api.model.EmptyDirVolumeSource:
Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.util.LinkedHashMap<?, ?>] to type [@com.fasterxml.jackson.annotation.JsonProperty io.fabric8.kubernetes.api.model.EmptyDirVolumeSource]
I was able to workaround this by setting the "emptyDir.medium" property to null
which creates the EmptyVolumeSource but does not actually set any fields on it.
This should work for you:
spring.cloud.deployer.kubernetes.volumes[0].emptyDir.medium=null
ℹ️ This would be a workaround and not a fix.
Hi @thesoundofsilent ,
Were you able to try the above workaround?
closing as the issue has gone stale. If you feel we closed this issue in error, please add a comment.
Will create an issue around better documentation for these properties.
I need to create empty volume for my worker pod
The deployer properties I used is as below:
spring.cloud.deployer.kubernetes.volumes[0].name=cache-volume spring.cloud.deployer.kubernetes.volumes[0].emptyDir={}
But I got json parse error, it seems the {} can't be parse and I can't find any document about how to set properties for emptyDir