atomist / sdm-pack-k8s

Extension Pack for an Atomist SDM to integrate Kubernetes deployments
Apache License 2.0
3 stars 2 forks source link

K8s pack and SDM should converge a KubernetesClusterProvider #40

Closed cdupuis closed 5 years ago

cdupuis commented 5 years ago

The core graphql model contains a generic KubernetesClusterProvider that we should make sure exists for each cluster k8s-sdm or a k8s pack runs in.

The name of the KubernetesClusterProvider should be the fulfilment name of a goal gets deployed into that cluster.

On start of the pack, we should query if such a provider exists in the model and if not, create it for the workspace.

ddgenome commented 5 years ago

It seems the context provided to a StartupListener does not have a graphClient. Is there some other place in the startup sequence that does have access to a graphClient?

cdupuis commented 5 years ago

Yes, the context provided to a StartupListener is not scoped to a workspace. But you can always create a GraphClient by using the GraphClientFactory. See https://github.com/atomist/sdm-pack-rcca-github/blob/master/lib/converge/converge.ts#L55-L56 for an example.

ddgenome commented 5 years ago

Do we typically create the graph client using the first element of the configuration.workspaceIds array?

cdupuis commented 5 years ago

If you have more than one workspace in config, you should converge the KubernetesClusterProvider for each workspace.

ddgenome commented 5 years ago

Do you have any thoughts on the lifecycle of these providers? It seems we should not register them when running in local mode. What about when ephemeral registrations? Should there be some reaper of providers similar to how durable registrations are eventually removed?