changes.
| | {note} Kubernetes plugin required Java 1.8 or higher to run{note} |
| | h2. Configure server to access Kubernetes cluster |
| |
| | h2. Kubernetes cloud profile |
| Cloud profiles rely on cloud providers to do its job. QuickBuild 8.0 ships with the Kubernetes cloud provider. To use it, one has to enable the Kubernetes plugin by providing a configuration file in _Administration/Plugin Management_ page as demonstrated below: |
| | On the machine running QuickBuild server, make sure that the OS account [running QuickBuild service|Install As System Service] is set up appropriately so that it can run below command to connect to desired Kubernetes cluster: |
| {code}kubectl cluster-info{code} |
| |
| | !kubernetes-setting.png! |
| | h2. Set up firewall rule to allow node ports |
| |
| | Then one can follow the [cloud profiles|Working with Cloud Profiles] guide to create cloud profiles using Kubernetes launchers like below: |
| !kubernetes-launcher.png! |
| | Build agents are running as pods in Kubernetes cluster, and these pods are exposed via services with type "NodePort". QuickBuild server has to access these node ports, so appropriate firewall rule may need to be set up to allow this. For Google Kubernetes Engine, an example firewall rule can be as following: |
| |
| | !gke-firewall.png! |
| |
| {anchor:create build agent image} |
| | |
| h2. Create build agent image |
| | You should use your own docker image when define the Kubernetes profile. The image should be pre-configured with your build environment as well as QuickBuild build agent. Below is an example to create a Debian Linux image only with OpenJDK and build agent installed. |
| |
| | Build agent docker image needs to be configured with your build environment as well as QuickBuild build agent. Below is an example to create a Debian Linux image only with OpenJDK and build agent installed. |
| |
| # Assume we have build agent installed at _/path/to/buildagent_. First run the build agent to make sure it can connect with the build server. |
| # Create file _/path/to/buildagent/Dockerfile_ with below content: |
| {code} |
| FROM openjdk:8-jdk |
| ADD . /app |
| EXPOSE 8811 |
| CMD ["/app/bin/wrapper-linux-x86-64", "/app/conf/wrapper.conf"] |
| {code} |
| # Change to directory _/path/to/buildagent_, and run below command |
| {code} |
| | docker build -t youraccount/qbagent:latest . |
| | sudo docker build -t youraccount/qbagent:latest . |
| {code} |
| # Then publish the built image: |
| {code} |
| | docker push youraccount/qbagent:latest |
| | sudo docker push youraccount/qbagent:latest |
| {code} |
| |
| | With this example, you should use docker image _youraccount/qbagent:latest_ when define the Kubernetes profile above |
| | h2. Enable Kubernetes plugin in QuickBuild |
| Login to QuickBuild server, and enable the Kubernetes plugin in _Administration/Plugin Management_ page as demonstrated below: |
| |
| | !kubernetes-setting.png! |
| |
| !k8s_plugin_setting.png! |
| |
| h2. Add Kubernetes cloud profile in QuickBuild |
| |
| Then one can follow the [cloud profiles|Working with Cloud Profiles] guide to create cloud profiles using Kubernetes launchers like below: |
| !kubernetes-launcher.png! |
| |
| |