yeah, I know I'm necro-posting.
You can also use kubectl -k / kustomize to create secrets from files, which means it can be done declaratively.
See https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-kustomize/ for an example.