I am building an opinionated PaaS like service on top of Kubernetes ecosystem.
I have a desire to model an SSHService and SSHUser, I'll either extend Kubernetes api server by registering new types/schemas (looks pretty simple) or using custom resources via ThirdPartyResource http://kubernetes.io/v1.1/docs/design/extending-api.html
I previous built my own API server on non-kubernetes infrastructure. The way I modelled it was somewhat as below, so an admin would do via restful actions:
1) Create SSH Service 2) Create SSh User 3) Add User to SSH Service
The third action would run on the SSH Service resource, which would check the universe to ensure an SSH User with name ref existed within the universe before adding it to its allowed user array attribute.
In Kubernetes I don't think cross resource transaction are supported, or intentional looking at how other things are modeled ** (for example I can create a pod with secret volume referring a secret name that does not exist and this is accepted).
So in Kubernetes world I intend to 1) Create SSh Service with .Spec.AllowedGroups [str] 2) Create SSH User with .Spec.BelongToGroups [str] where groups is just an array of group names as strings
A kubernetes client will watch for changes to ssh service and ssh users where the sets change update back to the API a secret volume (later configmap volume) for passwd/shadow to be used in the SSH container
Is this a sane approach to model custom resources?