Configuring Kubernetes

Sync your Kubernetes account with Totalcloud with the following steps. Syncing your Kubernetes account can help you automate cluster management, pod scaling, and scheduling. Totalcloud workflows allow you to automate any actionable Kubernetes API.

EKS

To sync an EKS cluster, it is assumed that AWS is already synced using keys. Additionally, it is important that the IAM user details are entered into the kube configMap. To do this, go to the terminal and type

kubectl edit -n kube-system configmap/aws-auth

This opens up the configMap file. Look for mapUsers

If not found, add to the configMap. The configMap file shoud look like this

apiVersion: v1
data:
mapRoles: |
- rolearn: <arn:aws:iam::111122223333:role/eksctl-my-cluster-nodegroup-standard-wo-NodeInstanceRole-1WP3NUE3O6UCF>
username: <system:node:{{EC2PrivateDNSName}}>
groups:
- <system:bootstrappers>
- <system:nodes>
mapUsers: |
- userarn: <arn:aws:iam::111122223333:user/admin>
username: <admin>
groups:
- <system:masters>
- userarn: <arn:aws:iam::111122223333:user/ops-user>
username: <ops-user>
groups:
- <system:masters>`

Replace all (including <>) with your own values.

More info here: https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html

Save the configMap file

On Totalcloud:

1.Navigate to the accounts page in TotalCloud app - https://app.totalcloud.io/accounts/aws/user

2. Click on Kubernetes at the top.

3. Click on Sync Another Account.

4. Pick EKS.

If you pick the EKS channel, you have relatively few authentications to be done.

5. Select the account associated with your EKS.

6. Select the region where the cluster is deployed.

7. Select your EKS cluster.

Choose EKS option and choose the synced AWS account and region where the EKS cluster is present. Once this is done, the EKS clusters in that region should appear in the 'Select EKS Cluster' drop-down. If nothing shows up in this drop-down, refresh the list of EKS clusters by clicking on 'Refresh' under the 'Select EKS Cluster' drop-down and the drop-down should get populated.

8. Click Save.

Others

To sync an AKS cluster, we need to first run az aks get-credentials --resource-group <resource group name> --name <cluster name>

This will merge/create the context to the kube config file.

Once this is done, open TotalCloud app and head to the Accounts >> Kubernetes section, and click on Sync Account/Sync Another Account button

1.Navigate to the accounts page in TotalCloud app - https://app.totalcloud.io/accounts/aws/user

2. Click on Kubernetes at the top.

3. Click on Sync Another Account.

4. Pick others.

All the required information is available on your kubeconfig file

5. Enter the name of the Kubernetes account

6. Enter the Kubernetes API endpoint

7. Copy paste the certificate authority of the Kubernetes account

8. Enter the token.

Also add the User Certificate Authority and User Certificate Authority Key. This information is also available in the kube config file.

9. Click save.

Contents
EKS
Others