Secrets, ConfigMaps, Connections
connections
inside a kdcluster
Using When a resource is connected, its data gets appended to configmeta.json
.
configmeta.json
is a file that stores metadata related to the cluster. It is in /etc/guestconfig/
directory.
Example: Lets assume we create a cluster with the following YAML, connecting a configmap
resource with the label cmType
as source-control
:
The configmeta.json
in the cluster looks like:
connections
are a part of the object with same name in the JSON. The three possible resources types form the sub-objects and every sub-object contains another child object with the key same as the type
that it had been labelled with. The type
is applicable only to configmap
and secret
.
Since configmeta.json
is a JSON, we can use any json parser to parse and use metadata to our use. A sample python script is:
connections
in Cluster YAML
Using connections
is useful in scenarios where there is a need to attach addditonal information to the cluster. There are three types of Kubernetes resources that can be used with connections
- configmap
, secret
, and kdcluster
(syntactically called cluster
in the YAML).
Note: The resources that are to be used with connections should be created before using them in the YAMLs
Following are examples that illustrate the use of each resource
configmap
1. One of the most frequent use-cases of using a configmap
is when we attach a model from the model registry to a deployment engine. The connected configmap needs to have the following label: 'kubedirector.hpe.com/cmType': '<some-type>'
A sample configuration looks like:
In this example, convolutional-nn-model
and fullyconnected-nn-model
are the configmap
resources created by HPECP with relevant model information after the models are registered.
secret
2. An example that uses secret
as a connection resource is while configuring a notebook cluster with source control. The connected secret needs to have the following label: 'kubedirector.hpe.com/secretType': '<some-type>'
. The information populated in the cluster using secret
resource would be encoded in base64
format. This includes all the resource attributes (metadata
, annotations
, data
, labels
)
The YAML snippet below illustrates the syntax:
source-control-secret
is a Kubernetes secret created by the platform with information required to configure the notebook with source control.
cluster
3. cluster
is typically used as a connection resource in a scenario that requires accessing the connected cluster resource(s) via API(s). As an example, let's consider the YAML below:
In the example, we have connected two clusters - training-engine-tf
and training-engine-pytorch
to the notebook cluster.
4. A combination of resources
It is possible to connect more than one type of resources to a cluster YAML. Here is an example:
In the above snippet, we have connected cluster
s and a secret
.