Hi guys, I need some help with provisioning cluste...
# general
b
Hi guys, I need some help with provisioning cluster nodes with rancher2. I have created cluster definition with one node (for know). I can connect to the cluster form pulumi and cluster is created but there are no nodes. Here is one defintion for the node:
var node1 = <ClusterRkeConfigNode>{};
node1.roles = ['worker'];
node1.user = '??'; // registry user
node1.labels = { 'frontend': 'ui' };
node1.address = '192.168.5.31';
node1.sshKeyPath = './keys/node1.id_rsa';
After running pulumi up command (with verbose node) I can see in the log following error: I0330 140453.793631 4620 host.go:451] Error closing 'nodejs' language plugin during shutdown; ignoring: 1 error occurred: * TerminateProcess: Access is denied. I don't know where is the problem. Who is registry user?
b
Hey Denis, can you post your full definition for the cluster?
b
Sure:
import * as k8s from "@pulumi/kubernetes";
import * as rancher2 from "@pulumi/rancher2"
import { ClusterRkeConfigPrivateRegistry, ClusterRkeConfigNode } from "@pulumi/rancher2/types/input";
var repo = <ClusterRkeConfigPrivateRegistry>{};
repo.isDefault = true;
repo.url = 'private_repo';
repo.user = 'dilijevic';
repo.password = 'password';
// node configuration
// const master = <ClusterRkeConfigNode>{};
// master.roles = ['controlplane', 'etcd'];
// master.address = '192.168.5.30';
// master.user = 'dilijevic';
var node1 = <ClusterRkeConfigNode>{};
node1.roles = ['worker', 'controlplane', 'etcd'];
node1.user = 'dilijevic'; // registry user
node1.labels = { 'frontend': 'ui' };
node1.address = '192.168.5.32';
node1.sshKeyPath = '/root/.ssh/id_rsa';
node1.sshAgentAuth = true;
// var node2 = <ClusterRkeConfigNode>{};
// node2.roles = ['controlplane', 'etcd'];
// node2.address = '192.168.5.32'
// node2.user = 'admin';
// node2.sshKeyPath = './keys/node2.id_rsa';
const cluster = new rancher2.Cluster('lab-01', {
    
description: 'Pulumi playground',
    
driver: 'rancherKubernetesEngine',
    
rkeConfig: {
        
privateRegistries: [
            
repo
        
],
        
nodes: [
            
node1
         
],
    
},
    
labels: [
        
{ 'env': 'playground' }
    
]
});
b
you said the cluster is created, but there are no nodes - how did you verify that?
b
from rancher console
And stays there. I suspect there is a problem with SSH authentication. Problem is I don't know anymore where tu put ssh keys. My workstation can login to nodes and server without password and server can access nodes without password (over SSH).
b
you need to add your SSH key to the rancher server. When you provision a cluster with rancher2, it creates a configuration file using
rke
which is its internal tool. This process will execute from rancher2 itself.
I believe that's the issue anyway
you should check your rancher2 logs
b
I have checked and redoplyed the ssh keys again. Everytinh is working and I still get the error:
I0331 11:54:27.688928    7776 plan_executor.go:219] planExecutor.Execute(...): incoming event (nil? true, <nil>)
I0331 11:54:27.689929    7776 step_executor.go:321] StepExecutor worker(-1): StepExecutor.waitForCompletion(): waiting for worker threads to exit
I0331 11:54:27.689929    7776 step_executor.go:321] StepExecutor worker(-2): worker received nil chain, exiting
I0331 11:54:27.689929    7776 step_executor.go:321] StepExecutor worker(-1): StepExecutor.waitForCompletion(): worker threads all exited
I0331 11:54:27.689929    7776 plan_executor.go:254] planExecutor.Execute(...): step executor has completed
I0331 11:54:27.689929    7776 plan_executor.go:131] planExecutor.Execute(...): exiting provider canceller
I0331 11:54:27.694930    7776 ignore.go:44] Explicitly ignoring and discarding error: rpc error: code = Canceled desc = grpc: the client connection is closing
I0331 11:54:27.698932    7776 host.go:451] Error closing 'nodejs' language plugin during shutdown; ignoring: 1 error occurred:
* TerminateProcess: Access is denied.
b
Can you post your rancher2 logs?
b
sure