-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into discourse-gatekeeper/migrate
- Loading branch information
Showing
78 changed files
with
5,206 additions
and
1,533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Bug Report | ||
description: File a bug report | ||
labels: ["Type: Bug", "Status: Triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: > | ||
Thanks for taking the time to fill out this bug report! Before submitting your issue, please make | ||
sure you are using the latest version of the charm. If not, please switch to this image prior to | ||
posting your report to make sure it's not already solved. | ||
- type: textarea | ||
id: bug-description | ||
attributes: | ||
label: Bug Description | ||
description: > | ||
If applicable, add screenshots to help explain the problem you are facing. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: reproduction | ||
attributes: | ||
label: To Reproduce | ||
description: > | ||
Please provide a step-by-step instruction of how to reproduce the behavior. | ||
placeholder: | | ||
1. `juju deploy ...` | ||
2. `juju relate ...` | ||
3. `juju status --relations` | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: environment | ||
attributes: | ||
label: Environment | ||
description: > | ||
We need to know a bit more about the context in which you run the charm. | ||
- Are you running Juju locally, on lxd, in multipass or on some other platform? | ||
- What track and channel you deployed the charm from (i.e. `latest/edge` or similar). | ||
- Version of any applicable components, like the juju snap, the model controller, lxd, microk8s, and/or multipass. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: Relevant log output | ||
description: > | ||
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. | ||
Fetch the logs using `juju debug-log --replay` and `kubectl logs ...`. Additional details available in the juju docs | ||
at https://juju.is/docs/olm/juju-logs | ||
render: shell | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: additional-context | ||
attributes: | ||
label: Additional context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Enhancement Proposal | ||
description: File an enhancement proposal | ||
labels: ["Type: Enhancement", "Status: Triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: > | ||
Thanks for taking the time to fill out this enhancement proposal! Before submitting your issue, please make | ||
sure there isn't already a prior issue concerning this. If there is, please join that discussion instead. | ||
- type: textarea | ||
id: enhancement-proposal | ||
attributes: | ||
label: Enhancement Proposal | ||
description: > | ||
Describe the enhancement you would like to see in as much detail as needed. | ||
validations: | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Provide approval for bot PRs | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
bot_pr_approval: | ||
uses: canonical/operator-workflows/.github/workflows/bot_pr_approval.yaml@main | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
# Jenkins CVEs | ||
CVE-2016-1000027 | ||
CVE-2023-20863 | ||
CVE-2023-24998 | ||
CVE-2023-27898 | ||
CVE-2023-27899 | ||
CVE-2023-27900 | ||
CVE-2023-27901 | ||
CVE-2023-35141 | ||
CVE-2023-2976 | ||
CVE-2023-39151 | ||
CVE-2023-34034 | ||
CVE-2023-43495 | ||
CVE-2023-43496 | ||
CVE-2023-36478 | ||
CVE-2024-22259 | ||
CVE-2024-22257 | ||
# Jenkins Plugin Manager CVEs | ||
CVE-2023-5072 | ||
# Jenkins plugin manager CVEs | ||
CVE-2022-45688 | ||
CVE-2023-20862 | ||
CVE-2022-1471 | ||
GHSA-4jq9-2xhw-jpx7 | ||
CVE-2024-23898 | ||
CVE-2024-25710 | ||
CVE-2024-26308 | ||
CVE-2024-22201 | ||
CVE-2024-22243 | ||
# Fixed in 5.3.33 | ||
CVE-2024-22259 | ||
# Fixed in 5.7.12 | ||
CVE-2024-22257 | ||
CVE-2024-22262 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 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`: | ||
```bash | ||
juju deploy jenkins-k8s --channel=latest/edge --constraints "mem=2048M" | ||
``` | ||
To change this value after deployment, use the `set-constraints` command. | ||
```bash | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# How to integrate with external agent charms | ||
|
||
We consider any agent charm to be `external` when they don't have layer 3 connectivity with the `jenkins-k8s` charm. To integrate with those agent charms, we'll leverage the `jenkins-k8s` charm's `agent-discovery-ingress` integration. | ||
|
||
The `agent-discovery-ingress` integration can be used with any charm that supports the `:ingress` interface. One example is the [traefik-k8s](https://charmhub.io/traefik-k8s) charm. | ||
```bash | ||
juju integrate jenkins-k8s:agent-discovery-ingress traefik-k8s:ingress | ||
``` | ||
|
||
Agents considered `external` have to be integrated using a cross-model integration. To integrate with such agent, simply integrate with the ingress provider charm as mentioned above and then integrate with the agent charm's offer endpoint. | ||
```bash | ||
juju integrate jenkins-k8s:agent-discovery-ingress traefik-k8s:ingress | ||
juju integrate jenkins-k8s:agent <offer-endpoint> | ||
``` | ||
|
||
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# How to resize the jenkins-home storage volume | ||
The default size of the jenkins-home storage volume for a fresh installation is 1GB. While this works for most scenarios, operators might need to have more storage for installing plugins, storing artifacts, and runninng builds/checking out SCMs on the built-in node. | ||
|
||
A low disk-space on the built-in node will cause the node to go offline, blocking jenkins from running jobs. | ||
|
||
## Create a backup | ||
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 | ||
|
||
```bash | ||
#!/bin/bash | ||
export JENKINS_HOME=/var/lib/jenkins | ||
export JENKINS_BACKUP=/mnt/backup | ||
|
||
echo "running backup as $(whoami) in $(pwd)" | ||
mkdir -p $JENKINS_BACKUP | ||
cp $JENKINS_HOME/secrets/master.key $JENKINS_BACKUP | ||
cp -r $JENKINS_HOME/*.xml $JENKINS_BACKUP | ||
cp -r $JENKINS_HOME/jobs $JENKINS_BACKUP | ||
cp -r $JENKINS_HOME/builds $JENKINS_BACKUP | ||
cp -r $JENKINS_HOME/workspace $JENKINS_BACKUP | ||
mkdir -p $JENKINS_BACKUP/plugins | ||
cp -r $JENKINS_HOME/plugins/*.hpi $JENKINS_BACKUP/plugins | ||
cp -r $JENKINS_HOME/plugins/*.jpi $JENKINS_BACKUP/plugins | ||
|
||
chown -R 2000:2000 $JENKINS_BACKUP | ||
tar zcvf jenkins_backup.tar.gz --directory=/mnt backup | ||
``` | ||
1. Transfer the backup script above to the running unit of the Jenkins-k8s charm and run it | ||
```bash | ||
juju scp --container jenkins ./backup.sh jenkins-k8s/0:/backup.sh | ||
juju ssh --container jenkins jenkins-k8s/0 /bin/bash | ||
bash /backup.sh | ||
``` | ||
2. Retrieve the compressed backup file | ||
```bash | ||
juju scp --container jenkins jenkins-k8s/0:/backup/jenkins_backup.tar.gz jenkins_backup.tar.gz | ||
``` | ||
3. With the data backed-up, we can remove the jenkins-k8s application. | ||
```bash | ||
juju remove-application jenkins-k8s | ||
``` | ||
|
||
## Restore the backup on a new charm instance | ||
1. When the application has been deleted, 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 --storage jenkins-home=10GB | ||
``` | ||
2. Wait for the charm to be ready, then restore the backup on the new unit. | ||
```bash | ||
juju scp --container jenkins ./jenkins_backup.tar.gz jenkins-k8s/0:/jenkins_backup.tar.gz | ||
tar zxvf jenkins_backup.tar.gz | ||
chown -R 2000:2000 /backup | ||
cp -R /backup/* /var/lib/jenkins | ||
rm -rf /backup /jenkins_backup.tar.gz | ||
``` | ||
3. Finally restart pebble | ||
```bash | ||
pebble restart jenkins | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2023 Canonical Ltd. | ||
# Copyright 2024 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
|
||
lazydocs --no-watermark --output-path src-docs src/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.