Skip to content

Commit

Permalink
Merge branch 'master' into JENKINS-56347
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossg committed May 1, 2019
2 parents 6ea2eda + b9ea4ff commit 6196118
Show file tree
Hide file tree
Showing 48 changed files with 1,431 additions and 398 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,34 @@ Known issues

See the full list of issues at [JIRA](https://issues.jenkins-ci.org/issues/?filter=15575)

1.15.2
------
* Merge pod templates definitions from yaml, fix issue with missing yaml in UI [#456](https://github.com/jenkinsci/kubernetes-plugin/pull/456) [JENKINS-57112](https://issues.jenkins-ci.org/browse/JENKINS-57112)

1.15.1
------
* Merge pod templates definitions from yaml [#449](https://github.com/jenkinsci/kubernetes-plugin/pull/449) [JENKINS-56082](https://issues.jenkins-ci.org/browse/JENKINS-56082)

1.15.0
------
* Allow Setting Default Mode In Secret Volumes [#452](https://github.com/jenkinsci/kubernetes-plugin/pull/452)
* Prevent a wait forever if websocket is not connected [#436](https://github.com/jenkinsci/kubernetes-plugin/pull/436)
* Don't set build result in Declarative agent blocks [#445](https://github.com/jenkinsci/kubernetes-plugin/pull/445) [JENKINS-56544](https://issues.jenkins-ci.org/browse/JENKINS-56544)

1.14.9
------
* Fix `connectTimeout` and `readTimeout` not being persisted [#439](https://github.com/jenkinsci/kubernetes-plugin/pull/439) [#442](https://github.com/jenkinsci/kubernetes-plugin/pull/442) [JENKINS-53532](https://issues.jenkins-ci.org/browse/JENKINS-53532)

1.14.8
------
* Do not close Kubernetes client after `containerLog` step [#435](https://github.com/jenkinsci/kubernetes-plugin/pull/435) [JENKINS-55392](https://issues.jenkins-ci.org/browse/JENKINS-55392)
* Upgrade kubernetes-client to 4.1.3. Pass `exec` buffer size using new method [#431](https://github.com/jenkinsci/kubernetes-plugin/pull/431) [JENKINS-50429](https://issues.jenkins-ci.org/browse/JENKINS-50429)

1.14.7
------
* Use a bigger buffer for stdin on kubernetes exec [#427](https://github.com/jenkinsci/kubernetes-plugin/pull/427) [JENKINS-50429](https://issues.jenkins-ci.org/browse/JENKINS-50429)
* Improve labels and help text for cloud and pod templates cap [#422](https://github.com/jenkinsci/kubernetes-plugin/pull/422)

1.14.6
------
* Add a system property to override default Slave Connect Timeout in seconds [#432](https://github.com/jenkinsci/kubernetes-plugin/pull/432)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM jenkins/jenkins:lts-alpine

ARG VERSION=1.14.6
ARG VERSION=1.15.2
RUN /usr/local/bin/install-plugins.sh kubernetes:${VERSION}

# COPY target/kubernetes.hpi /usr/share/jenkins/ref/plugins/kubernetes.hpi
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
buildPlugin(platforms: ['linux'])
buildPlugin(configurations: buildPlugin.recommendedConfigurations().findAll { it.platform == 'linux' })
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ For that some environment variables are automatically injected:
Tested with [`jenkins/jnlp-slave`](https://hub.docker.com/r/jenkins/jnlp-slave),
see the [Docker image source code](https://github.com/jenkinsci/docker-jnlp-slave).

It is not required to run the Jenkins master inside Kubernetes.

# Kubernetes Cloud Configuration

Expand All @@ -28,6 +29,8 @@ _Name_, _Kubernetes URL_, _Kubernetes server certificate key_, ...

If _Kubernetes URL_ is not set, the connection options will be autoconfigured from service account or kube config file.

When running the Jenkins master outside of Kubernetes you will need to set the credential to secret text. The value of the credential will be the token of the service account you created for Jenkins in the cluster the agents will run on.

### Restricting what jobs can use your configured cloud

Clouds can be configured to only allow certain jobs to use them.
Expand Down Expand Up @@ -72,7 +75,7 @@ Find more examples in the [examples dir](examples).
The default jnlp agent image used can be customized by adding it to the template

```groovy
containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:3.10-1-alpine', args: '${computer.jnlpmac} ${computer.name}'),
containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:3.27-1-alpine', args: '${computer.jnlpmac} ${computer.name}'),
```

or with the yaml syntax
Expand All @@ -83,7 +86,7 @@ kind: Pod
spec:
containers:
- name: jnlp
image: 'jenkins/jnlp-slave:3.10-1-alpine'
image: 'jenkins/jnlp-slave:3.27-1-alpine'
args: ['\$(JENKINS_SECRET)', '\$(JENKINS_NAME)']
```

Expand Down Expand Up @@ -146,7 +149,7 @@ Either way it provides access to the following fields:
* **envVars** Environment variables that are applied to **ALL** containers.
* **envVar** An environment variable whose value is defined inline.
* **secretEnvVar** An environment variable whose value is derived from a Kubernetes secret.
* **imagePullSecrets** List of pull secret names
* **imagePullSecrets** List of pull secret names, to [pull images from a private Docker registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/).
* **annotations** Annotations to apply to the pod.
* **inheritFrom** List of one or more pod templates to inherit from *(more details below)*.
* **slaveConnectTimeout** Timeout in seconds for an agent to be online *(more details below)*.
Expand All @@ -164,7 +167,7 @@ The `containerTemplate` is a template of container that will be added to the pod
* **command** The command the container will execute.
* **args** The arguments passed to the command.
* **ttyEnabled** Flag to mark that tty should be enabled.
* **livenessProbe** Parameters to be added to a exec liveness probe in the container (does not suppot httpGet liveness probes)
* **livenessProbe** Parameters to be added to a exec liveness probe in the container (does not support httpGet liveness probes)
* **ports** Expose ports on the container.

#### Specifying a different default agent connection timeout
Expand Down Expand Up @@ -530,7 +533,6 @@ you can use these flags during Jenkins startup:
-Dhudson.slaves.NodeProvisioner.MARGIN=50
-Dhudson.slaves.NodeProvisioner.MARGIN0=0.85


# Configuration on minikube

Create and start [minikube](https://github.com/kubernetes/minikube)
Expand Down Expand Up @@ -630,6 +632,13 @@ system property to the (host-only or NAT) IP of your host:

mvn clean install -Djenkins.host.address=192.168.99.1

### Integration Tests with Microk8s

If [Microk8s](https://microk8s.io/) is running and is the default context in your `~/.kube/config`,
just run as

mvn clean install -Pmicrok8s

### Integration Tests in a Different Cluster

Ensure you create the namespaces and roles with the following commands, then run the tests
Expand Down
Loading

0 comments on commit 6196118

Please sign in to comment.