Adding Clusters to JovianX
JovianX supports management of multiple Kubernentes clusters, allowing to run and manage workloads on multiple cloud providers in multiple regions simultaneously.
Kubernetes Multi-Cluster Management

Kubeconfig Kubernetes Cluster Access File

Kubernetes uses a YAML file called kubeconfig to store cluster authentication information. JovianX uses kubeconfig files to access the Kubernetes clusters. The kubeconfig file contains a list of contexts to which JovianX can refer when running Kubernetes operations.

Step 1 - Prepare an administrative Kubeconfig file

Create a new kubeconfig file, which will be used for controlling the Kubernetes cluster.
The kubecofnig files should include configuration for context, which should define a cluster and auser . User is a Kubernetes service account that has the cluster-admin role.

Example Kubeconfig file

$ cat kubeconfig-example.yaml
1
apiVersion: v1
2
clusters:
3
- cluster:
4
certificate-authority-data: <CA-CERT>
5
server: https://<KUBERNETES-CLUSTER-IP>
6
name: <CLUSTER-NAME>
7
contexts:
8
- context:
9
cluster: <CLUSTER-NAME>
10
user: <SERVICE-ACCOUNT>
11
name: <CONTEXT-NAME>
12
kind: Config
13
preferences: {}
14
users:
15
- name: <SERVICE-ACCOUNT>
16
user:
17
token: <ACCESS-TOKEN>
18
​
Copied!
Read more about Kubeconfig in the official Kubernetes documentation.​
You can generate an administrative Kubeconfig file using the Generate-Kubeconfig script https://github.com/JovianX/Generate-Kubeconfig.
$ ./kubeconfig-create.sh Generate administrative Kubeconfig file for your cluster
This script generates a Kubeconfig file that allows full administrative access to your cluster Please note that this creates a Kubernetes service account 'jovianx-admin' with CLUSTER-ADMIN role in the 'jovianx-system' namespace.
Proceed?[Y/n] ...

Step 2 - Upload Kubeconfig files

JovianX uses Kubeconfig files to interact with a Kubernetes cluster. To upload a Kubeconfig file:
  1. 1.
    navigate to Settings > General > Application
  2. 2.
    Open Kubernetes configuratio
  3. 3.
    Click on Select Kubeconfig file
Once you upload a Kubeconfig file, all cluster details are visible in the main dashboard.
Note: The Kubeconfig file should specify a service account with cluster-admin role, and should include an authentication token, as show in example above.
JovianX allows uploading multiple Kubeconfig files, and supports one context per file.

​

Step 3 - Add Kubernetes Context to the blueprint

JovianX allows defining what context to use for each component, thus, to define where to deploy component's Helm Chart.
The definition can be set in the components section, making it a static definition. Or by setting the context by settings_descriptors, which allows the user to provide input(option selection) that results in setting context for a component.
You can add context in the component directly, or set it by settings_descriptors.

Set the context by component:

To set the context in the components section, making it a static setting, add the kube_context directive:
1
- name: node-component
2
version: 1.0.0
3
provider: helm_chart
4
helm_chart_name: node-chart
5
kube_context: <KUBERNETES-CONTEXT-NAME> # <---------------------
6
...
7
​
Copied!

Set the context by settings_descriptors:

To set context by a user input for a setting descriptor, add the kube_context directive in the components section:
1
- name: choose_cloud_region
2
display: 'Choose cloud provider region'
3
input_type: radio
4
default: 'us-west-1'
5
select_options:
6
- name: 'us-west-1'
7
display: 'US West (N. California)'
8
components:
9
- name: node-component
10
kube_context: <us-west-1 KUBERNETES-CONTEXT-NAME> # <-----------
11
...
12
- name: 'us-east-1'
13
display: 'US East (N. Virginia) '
14
components:
15
- name: node-component
16
kube_context: <us-east-1 KUBERNETES-CONTEXT-NAME> # <-----------
17
...
18
​
Copied!
kube_context is a supported directive for settings_descriptors of the following descriptor types: radio, select and checkbox
Last modified 1yr ago