I had the reply below typed out and then on reading your post again, I realise you are probably asking about adding storage to a Charmed Kubernetes deployment? If so, @tvansteenburgh or one of the CK people can help there.
But I’ll leave my reply as well in case it’s useful to someone. I guess you could avoid creating the storage class YAML if you are using Juju to deploy k8s workloads to your CK.
You can create a storage pool in the Juju model with the relevant k8s storage provisioning parameters and Juju will set that up when you deploy a charm and specify storage. There some information here.
You’re doing it the right way. If you use one of the default pools that are created by the master charm when it’s related to Ceph, the k8s StorageClass is created for you. But if you create your own pool, you must also create the StorageClass.
Also note that you can use the apply-manifest action on kubernetes-worker to apply the yaml, rather than using kubectl directly. Not required but can be useful is some situations.