K8S Charms - LoadBalancer vs Cluster in Metadata.yaml


#1

Wondering if others feel that defining the service type in the metadata for k8s charms is a little bit brittle?

Example:
Let’s say I have a charm that I want to use in multiple scenarios, one in the datacenter using ‘cluster’ service type and another deploy in the cloud as a loadbalancer type. I feel that defining the service type in the metadata makes it difficult to facilitate different deployment use cases with one charm. I feel that if we put the service type config somewhere where it can be modified on a per deployment basis it would increase the reusability of k8s charms.

Thoughts?


#2

You can override the charm default at deploy time:

$ juju deploy myk8charm --config kubernetes-service-type=LoadBalancer

There’s other k8s specific configuration knobs as well


#3

Exactly what I was looking for, not sure how I missed this. Thank you!