Jenkins Cluster with Windows & Linux Worker
Start the Jenkins Master VM and access the the URL
Create a remote ssh session (Use PuTTY or Ubuntu Bash or Git Bash) And enter following command to get the initial password.
$ sudo cat /var/lib/jenkins/secret/initialAdminPassword
Copy the content of file displayed by
catcommand. And paste this password in jenkins web-page. Click continue button and then use
Install Suggested Plugins
After Plugin Installation, it should then ask for New User creation. Create a new user (Admin) for regular login into jenkins dashboard.
After User creation, continue to dashboard.
Now, SSH into Master node to generate new SSH-Key Pair and copy it to node-1
# Become ROOT user $ sudo -i # Become jenkins user $ su - jenkins ## No password prompt # Generate SSH Key Pair $ ssh-keygen # PRESS ENTER at ALL PROMPTS # Now, Copy SSH key $ ssh-copy-id email@example.com Enter Password: pass@12345 Add to Known Server: Yes ## Now, test it.. $ ssh -i .ssh/id_rsa firstname.lastname@example.org ## check if allowed to access node-1 ## Exit from node-1 $ exit # Print Private key on screen $ cat .ssh/id_rsa.pub # Copy the content of ## exit SSH Connection $ exit
Now, You need to register 'node-1' with private-ip
10.0.1.11as jenkins slave instance.
Manage Jenkins > Manage Nodes & Cloud > New Node
Name: Node-1 Usage: Use this node as much as possible # Of executors: 2 Remote Root directory: /home/jenkins Launch Method: Launch slave agent via SSH Host: 10.0.1.11 Credentials: <CHOOSE SSH KeyPair Credentials>
Tags: Microsoft.Storage/storageAccounts, Microsoft.Network/publicIPAddresses, Microsoft.Network/networkSecurityGroups, Microsoft.Network/virtualNetworks, Microsoft.Network/networkInterfaces, Microsoft.Compute/virtualMachines, Microsoft.Compute/virtualMachines/extensions, CustomScript, CustomScriptExtension