k8s operators as deployed as statefulsets and use storage correctly #9120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
This PR fixes a number of aspects of k8s operator deployments.
k8s application operators now are deployed using either a deployment controller or statefulset (depending on if storage is used).
The operator provisioning api has been extended to provide the necessary storage information. juju will look for a storage-pool called "operator-storage" and use that if defined.
storage classes are now prefixed with the model name when created since they are global entities. juju will look first for the model class, and then for a global class.
QA steps
Create a k8s model on aws.
Create a juju operator storage class:
$ juju create-storage-pool operator-storage kubernetes storage-class=juju-operator-storage storage-provisioner=kubernetes.io/aws-ebs parameters.type=gp2
Deploy a charm and see that the operator is deployed as a statefulset and that an ebs volume has been provisioned and used for operator storage.