I have been poking around trying to see what it would take to get the elastic-operator deployed via Juju. I think I’m hitting a few limitations of k8s charms. Hoping I can shed some light on what I’m seeing and get some feedback.
The elastic-operator charm I’m working on can be found here. The purpose of this charm is to be able to juju deploy
the elastic-operator here. Outside of having to kubectl apply
the juju-unsupported objects by hand prior to deploying the charm, things are coming along pretty smooth. I am currently stuck trying to get the /tmp/cert secret mount configured and populated in the operator, see traceback pastebin. Not really sure how this would be accomplished via Juju, so I started digging. My primary goal is to understand how I might create a secret and mount it as a volume in a pod via configuration via Juju.
I thought it would be helpful to see what a pod storage configuration of a juju deployed k8s charm looked like from k8s side, so I deployed mariadb-k8s with juju deploy cs:~juju/mariadb-k8s-2
.
Running microk8s.kubectl edit statefulset.apps -n mymodel mariadb-k8s
to view the deployment configuration shows this.
The first thing that stuck out to me was that the name of the volume mount is comprised of the charm storage name concatenated with a uuid, ex database-45300d63
.
This makes me believe that this is the portion of the elastic-operator yaml that I will need to figure out how to fit into the way juju creates a k8s deployment. I’m not sure how to go about referencing the volume name in the pod spec because it seems generated with a uuid that I don’t when creating the pod spec.
For reference, this is the elastic-operator deployment created from the command kubectl apply -f https://download.elastic.co/downloads/eck/0.9.0/all-in-one.yaml
.
From my user perspective, I feel that juju/k8s-charms need some bindings to facilitate secrets and secret volume mapping. Thoughts? Ideas?
The other pitfalls I’m experiencing seem to fit into the same category; k8s objects that I don’t know how to model with a charm.
An example of this is a serviceAccount
. How can I create a serviceAccount
from a k8s charm?
This same issue persists for me with all other objects that I am trying to create; secrets, serviceAccounts, clusterRoles, clusterRoleBindings.
What is our approach to handling the creation and mapping of these objects from Juju’s perspective?
Thanks