windows jenkins slave agent setup

main
Yik Teng Hie 3 years ago
parent 78b7ec53f4
commit 4009b10d22

@ -0,0 +1,28 @@
# Setup Windows Slave node
## Use case
- Windows Application build pipeline (Visual Studio C++ / C#)
## Tools
- for installing jenkins agent as a windows service
- [Windows Service Wrapper](https://github.com/winsw/winsw)
- Alternative tool
- [nssm - Non-Sucking Service Manager](https://nssm.cc/)
- [Package Manager - Chocolatey](https://chocolatey.org/)
## Windows
- Create a user 'jenkins'
## Steps
- Create a jenkins slave node setup on jenkins server
- Install JDK 11 (Preferable the same version as Jenkins Master Version)
- Create a folder `C:\jenkins`
- Download `agent.jar` from jenkins server
- Run the agent using the `Windows Service Wrapper` as a Windows Service and log on as `jenkins` user profile
- Create a ssh key and update `rsa_id.pub` to git server to allow agent to clone from git repo
# Setup Jenkins build to target windows slave node for build
- Create a build
- Set label to target the slave node
- Git clone to the node
- Run the windows build script on the node

@ -1,20 +1,74 @@
# Kubernetes # Kubernetes
- minikube - Terms
- pod : running container / instance. Normal a pod run a single container. However, a pod can also run more than one container
- node : virtual machine node
- cluster : private network cluster
- deployment : pod with auto scaling feature
- service : To use LoadBalancer feature. Thus, to allow pod accessible from localhost (before this all pod is only accessible within minikube)
- ClusterIP : IP adrress accessible within cluster only. NOT accessible from localhost
- ExternalIP : For actual cloud
- LoadBalancerIP :
- minikube : single master-slave Kubernetes cluster setup
```shell ```shell
$ minikube start drivers=kvm2 $ minikube start drivers=kvm2
$ minikube status $ minikube status
# IP address of minikube
$ minikube ip
# ssh into minikube
# ssh docker@<minikubeIP>
# password : tcuser
$ minikube ssh
# inside minikube
$ docker ps
$ docker exec -it <container_id> sh
``` ```
- kubectl - kubectl : Kubernetes CLI
```shell ```shell
# create jenkins namespace # create jenkins namespace
$ kubectl create namespace jenkins $ kubectl create namespace jenkins
# list existing namespaces # list existing namespaces
$ kubectl get namespaces $ kubectl get namespaces
$ kubectl cluster-info
$ kubectl get node
$ kubectl get pods
# run nginx docker image
$ kubectl run nginx --image=nginx
$ kubectl get pods
$ kubectl describe pod nginx
# get pods container IP address
$ kubectl get pods -o wide
$ kubectl delete pod nginx
# deployment in order to do scaling
$ kubectl create deployment nginx-deployment --image=nginx
$ kubectl get deployments
$ kubectl get pods
$ kubectl describe deployment nginx-deployment
# show all running replicas
$ kubectl get pods -o wide
# create a service, expose internal port 80 to external 8080
$ kubectl expose deployment nginx-deployment --port=8080 --target-port=80
# get svc
$ kubectl get services
``` ```
- Port forwarding - Port forwarding

Loading…
Cancel
Save