Safer Jenkins pipelines on kubernetes

Jenkins and kubernetes are a great combination. I love the concept of leveraing container technology to provide any build tools that you might require. However in many cases the examples provided are not always the best or most secure. In Section 10.2.2 Building your image of Mannings Microservices in Action the following Jenkins Pipeline script is suggested: def withPod(body) { podTemplate(label: 'pod', serviceAccount: 'jenkins', containers: [ containerTemplate(name: 'docker', image: 'docker', command: 'cat', ttyEnabled: true), containerTemplate(name: 'kubectl', image: 'morga…

Read more »

Automated Kubernetes installation on Hyper-V

This artice describes how you can create a kubernetes custer using Vagrant, Hyper-V and Packer. Update (11-05-2020)I have updated the scripts to use contianerd in favor of docker. Don't worry using docker is still possible. In /packer/ubuntu-18.04-amd64.json replace woth Why? I found myself in the need of having a kubernetes test cluster. Instead of using minikube or enabling Kubernetes on Docker Desktop. I thought I could learn from setting up a cluster from scratch. This also allows me to easiliy simulate network failures or have nodes go down. Prerequisites Hyper-V…

Read more »

Static IPs with NAT on Hyper-V

Posted on

The goal is to have networking with static ip addresses for virtual machines on Hyper-V. The machine must also be able to access the internet. The easiest way is to start a Powershell session with elevated rights. Then use the follwing three commands. Feel free to change any names and ip address ranges. Create a new switch New-VMSwitch -SwitchName "NAT Switch 192.168.40.x" -SwitchType Internal Assign and IP address New-NetIPAddress -IPAddress -PrefixLength 24 -InterfaceAlias "vEthernet (NAT Switch 192.168.40.x)" Enable NAT New-NetNAT -Name "NATNetwork&qu…

Read more »