Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs #189

Merged
merged 13 commits into from
Sep 9, 2024
4 changes: 2 additions & 2 deletions docs/how-to/backup-and-restore-jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A backup is a snapshot of the Jenkins data (jobs, configurations, secrets, plugi
From [Backing-up/Restoring Jenkins](https://www.jenkins.io/doc/book/system-administration/backing-up/), This script backs up the most essential files as mentioned in the article:
* The `master.key` file.
* Job-related files in the `./jobs`, `./builds` and `./workspace` folders.
* Plugins (`.hpi` and `.jpi` files) in the `./plugins` folder
* Plugin-related files (`.hpi` and `.jpi`) in the `./plugins` folder.

```bash
cat <<EOF > backup.sh
Expand Down Expand Up @@ -55,7 +55,7 @@ juju ssh --container jenkins $JENKINS_UNIT chown -R jenkins:jenkins /backup
juju ssh --container jenkins $JENKINS_UNIT cp -avR /backup/* /var/lib/jenkins
juju ssh --container jenkins $JENKINS_UNIT rm -rf /backup /jenkins_backup.tar.gz
```
2. Restart pebble for the changes to take effect
2. Restart Pebble for the changes to take effect.
```bash
juju ssh --container jenkins $JENKINS_UNIT pebble restart jenkins
```
21 changes: 11 additions & 10 deletions docs/how-to/configure-installable-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@

### Configure `plugins`

Use the `plugins` configuration to allow a list of plugins to be installed on Jenkins.
Comma-separated list of allowed plugin short names. If empty, any plugin can be installed.
Plugins installed by the user and their dependencies will be removed automatically if not on
Use the `plugins` configuration to allow plugins to be installed on Jenkins.
The configuration is a comma-separated list of allowed plugin short names. If empty, any plugin can be installed.
Plugins installed by the user and the plugins' dependencies will be removed automatically if they are not on
the list. Included plugins are not automatically installed.
The plugins are cleaned up at `update-status` hook trigger. If the `restart-time-range`
configuration option is provided, the plugins are cleaned up during the defined time range.

On trigger it will:

1. Delete any installed plugins not defined on the list and their dependencies.
2. Set a system message on Jenkins indicating which user installed plugins have been deleted.

```
juju config jenkins-k8s plugins=<allowed-plugins-csv>
# plugins example: `git, azure-cli, aws-credentials` will allow git, azure and aws-credentials
plugins to be installed.
```

The plugins are cleaned up at `update-status` hook trigger. If the `restart-time-range`
configuration option is provided, the plugins are cleaned up during the defined time range.

On trigger it will:

1. Delete any installed plugins not defined on the list and their dependencies.
2. Set a system message on Jenkins indicating which user installed plugins have been deleted.
6 changes: 3 additions & 3 deletions docs/how-to/configure-jenkins-memory-usage.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# How to control heap memory of the jenkins-k8s-operator charm
The [jenkins-k8s-operator](https://github.com/canonical/jenkins-k8s-operator) charm uses [juju constraints](https://juju.is/docs/juju/constraint) to limit the amount of memory a charm can use. To deploy the charm with constraints, use the `--constraints "<key>=<value>"` option when running `juju deploy`:
The [jenkins-k8s-operator](https://github.com/canonical/jenkins-k8s-operator) charm uses [Juju constraints](https://juju.is/docs/juju/constraint) to limit the amount of memory a charm can use. To deploy the charm with constraints, use the `--constraints "<key>=<value>"` option when running `juju deploy`:
```bash
juju deploy jenkins-k8s --channel=latest/edge --constraints "mem=2048M"
```
Expand All @@ -9,5 +9,5 @@ juju set-constraints jenkins-k8s "mem=4096M"
```
Other types of constraints (like cores, disk, etc.) can also be applied. Note that this value affects the shared maximum memory between the `charm` container and `jenkins` container.

# Considerations when applying memory constraints
Constraints set this way directly influence the amount of heap memory available to the JVM, with a ratio `JVM heap / Container Memory limit` of 0.5. For example, a `jenkins-k8s-operator` charm deployed with `--constraints "mem=1024M"` would set a maximum heap memory size of 512Mb. Too little heap memory can result in the controller getting restarted due to Out-of-memory(OOM) error. Make sure to adapt the memory constraints based on your workload.
## Considerations when applying memory constraints
Constraints set this way directly influence the amount of heap memory available to the JVM, with a ratio `JVM heap / Container Memory limit` of 0.5. For example, a `jenkins-k8s-operator` charm deployed with `--constraints "mem=1024M"` would set a maximum heap memory size of 512Mb. Too little heap memory can result in the controller getting restarted due to Out-of-memory (OOM) error. Make sure to adapt the memory constraints based on your workload.
2 changes: 1 addition & 1 deletion docs/how-to/configure-restart-time-range.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Use the `restart-time-range` configuration to set the time interval when `jenkin
2. automatically remove plugins that are installed on the system but are not part of the `plugins`
configuration option.

The minimum time interval is 1 hour. Time range is applied each day of the week.
The minimum time interval is 1 hour. The time range is applied each day of the week.

```
juju config jenkins-k8s restart-time-range=<desired-time-range>
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/get-admin-password.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
To retrieve the password for the admin account, you can run the `get-admin-password` action.

```
juju run-action jenkins-k8s/0 get-admin-password --wait
juju run jenkins-k8s/0 get-admin-password
```

The output should look something similar to the contents below:
Expand Down
4 changes: 2 additions & 2 deletions docs/how-to/integrate-with-external-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ juju integrate jenkins-k8s:agent-discovery-ingress traefik-k8s:ingress
juju integrate jenkins-k8s:agent <offer-endpoint>
```

# Networking considerations
## Networking considerations
The charm assumes that:
1. There are connectivity between the juju controller of the `jenkins-k8s` charm and the juju controller of the agent charm trying to connect with the `jenkins-k8s` charm.
2. The agent can resolve the ingress hostname provided by the `jenkins-k8s` charm and the resulting IP address is reachable, and there are firewall rules in place to allow HTTP traffic.
3. In case a reverse proxy is present, it is also expected that the HTTP connection coming from the agent charm is allowed to be upgraded into a Websocket connection. The reverse proxy should also be configured with a suitable idle timeout for websocket connections to avoid intermittent agent disconnection.
3. In case a reverse proxy is present, it is also expected that the HTTP connection coming from the agent charm is allowed to be upgraded into a Websocket connection. The reverse proxy should also be configured with a suitable idle timeout for websocket connections to avoid intermittent agent disconnection.
10 changes: 3 additions & 7 deletions docs/how-to/redeploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

Redeployment is a process where the old charm instance is removed and data is migrated to a new charm instance. Redeploying the Jenkins charm consists of 3 steps:

1. Create the new Jenkins charm instance
1. Create the new Jenkins charm instance:
```bash
juju deploy jenkins-k8s jenkins-k8s-new
```
2. Migrate Jenkins data
See the `Migrate Jenkins data` section below.
3. Remove the old Jenkins charm instance
2. Migrate Jenkins data: Follow the instructions in [the charm's documentation for backup and restore](https://charmhub.io/jenkins-k8s/docs/how-to-backup-and-restore-jenkins).
3. Remove the old Jenkins charm instance:
```bash
juju remove-application jenkins-k8s
```

### Migrate Jenkins data
Follow the instructions in [the charm's documentation for backup and restore](https://charmhub.io/jenkins-k8s/docs/backup-and-restore-jenkins) to migrate the data to the new Jenkins charm instance.
6 changes: 3 additions & 3 deletions docs/how-to/resize-jenkins-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ The default size of the jenkins-home storage volume for a fresh installation is
A low disk-space on the built-in node will cause the node to go offline, blocking Jenkins from running jobs.

### Create a backup of the current Jenkins charm instance
Follow the `Create a backup` section of [the charm's backup and restore documentation](https://charmhub.io/jenkins-k8s/docs/backup-and-restore-jenkins) to create an archive of the Jenkins data on your host system
Follow the "Create a backup" section of [the charm's backup and restore documentation](https://charmhub.io/jenkins-k8s/docs/how-to-backup-and-restore-jenkins) to create an archive of the Jenkins data on your host system

### Deploy the new Jenkins charm instance, specifying the size of the storage volume
Create a new application with the `--storage` flag. In this example we'll deploy the charm with a storage of 10GB
Create a new application with the `--storage` flag. In this example we'll deploy the charm with a storage of 10GB:
```bash
juju deploy jenkins-k8s-new --storage jenkins-home=10GB
```

### Restore the created backup onto the newly created Jenkins charm instance
Follow the `Restore the backup on a new (or existing) charm instance` section of [the charm's backup and restore documentation](https://charmhub.io/jenkins-k8s/docs/backup-and-restore-jenkins) to create an archive of the Jenkins data on your host system. Remember to update the `JENKINS_UNIT` environment variable. For our example we have `JENKINS_UNIT=jenkins-k8s-new/0`
Follow the "Restore the backup on a new (or existing) charm instance" section of [the charm's backup and restore documentation](https://charmhub.io/jenkins-k8s/docs/how-to-backup-and-restore-jenkins) to create an archive of the Jenkins data on your host system. Remember to update the `JENKINS_UNIT` environment variable. For our example we have `JENKINS_UNIT=jenkins-k8s-new/0`.

4 changes: 2 additions & 2 deletions docs/how-to/rotate-credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To rotate credentials for the admin account and invalidate all logged in user se
`rotate-credentials` action.

```
juju run-action jenkins-k8s/0 rotate-credentials --wait
juju run jenkins-k8s/0 rotate-credentials
```

The output should look similar to the contents below:
Expand All @@ -16,7 +16,7 @@ unit-jenkins-k8s-0:
UnitId: jenkins-k8s/0
id: "1"
results:
password: <password>
password: <new password>
status: completed
timing:
completed: <timestamp>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ The Jenkins-k8s Operator is a member of the Ubuntu family. It's an open source p

- [Code of conduct](https://ubuntu.com/community/code-of-conduct)
- [Get support](https://discourse.charmhub.io/)
- [Join our online chat](https://chat.charmhub.io/charmhub/channels/charm-dev)
- [Join our online chat](https://matrix.to/#/#charmhub-charmdev:ubuntu.com)
- [Contribute](Contribute)

Thinking about using the Jenkins-k8s Operator for your next project? [Get in touch](https://chat.charmhub.io/charmhub/channels/charm-dev)!
Thinking about using the Jenkins-k8s Operator for your next project? [Get in touch](https://matrix.to/#/#charmhub-charmdev:ubuntu.com)!

# Contents

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/external-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ The Jenkins charm requires access to the following domains to install Jenkins an

Depending on the localisation, some region-specific external mirrors might also be used. You can find more information on the [list of mirrors for Jenkins](https://get.jenkins.io/war/2.456/jenkins.war?mirrorstats).

Some plugins can also require external access, such as `github.com` for the [Github branch source plugin](https://plugins.jenkins.io/github-branch-source/). Or an external Kubernetes cluster if you are using the [Kubernetes plugin](https://plugins.jenkins.io/kubernetes/). Refer to the documentation of the plugin for more details.
Some plugins can also require external access, such as `github.com` for the [Github branch source plugin](https://plugins.jenkins.io/github-branch-source/) or an external Kubernetes cluster if you are using the [Kubernetes plugin](https://plugins.jenkins.io/kubernetes/). Refer to the plugin's documentation for more details.
18 changes: 9 additions & 9 deletions docs/tutorial/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
## What you'll do

- Deploy the [jenkins-k8s charm](https://charmhub.io/jenkins-k8s)
- [Deploy and integrate agents](#deploy-and-relate-agents)
- [Get admin password](#get-admin-password)
- Deploy and integrate agents
- Get admin password

The jenkins-k8s charm helps deploy a Jenkins automation server application with ease and
also helps operate the charm. This
tutorial will walk you through each step of deployment to get a basic Jenkins server deployment.

### Prerequisites

To deploy jenkins-k8s charm, you will need a juju bootstrapped with any kubernetes controller.
To see how to bootstrap your juju installation with microk8s, please refer to the documentation
on microk8s [installation](https://juju.is/docs/olm/microk8s).
To deploy jenkins-k8s charm, you will need a Juju bootstrapped with any Kubernetes controller.
To see how to bootstrap your Juju installation with MicroK8s, please refer to the documentation
on MicroK8s [installation](https://juju.is/docs/olm/microk8s).

### Setting up the tutorial model
### Set up the tutorial model

To easily clean up the resources and to separate your workload from the contents of this tutorial,
it is recommended to set up a new model with the following command.
set up a new Juju model with the following command.

```
juju add-model jenkins-tutorial
Expand Down Expand Up @@ -64,7 +64,7 @@ By running the `get-admin-password` action on a jenkins-k8s unit, juju will read
admin credentials setup for you. You can use the following command below.

```
juju run-action jenkins-k8s/0 get-admin-password --wait
juju run jenkins-k8s/0 get-admin-password
```

The output should look something similar to the contents below:
Expand All @@ -91,5 +91,5 @@ Congratulations! You have successfully finished the jennkins-k8s tutorial. You c
model environment that you’ve created using the following command.

```
juju destroy model jenkins-tutorial -y --release-storage
juju destroy-model jenkins-tutorial --destroy-storage
```
Loading