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

[discourse-gatekeeper] Migrate charm docs #76

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/explanation/agent-deprecated-relation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
The agent-deprecated relation is a remains of the jenkins-k8s charm to provide backwards
compatibility with the existing [jenkins charm](https://charmhub.io/jenkins). The deprecated
relation should not be used as it provides an unstable relation implementation that could result in
some agents not registering successfully.
some agents not registering successfully.
2 changes: 1 addition & 1 deletion docs/how-to/configure-installable-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ 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.
```
```
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# How to configure restart-time-range
# How to configure update-time-range

### Configure restart-time-range

Use the `restart-time-range` configuration to set the time interval when `jenkins-k8s`

1. automatically applies the latest patches for the current
[LTS](https://www.jenkins.io/download/lts/) version.
2. automatically remove plugins that are installed on the system but are not part of the `plugins`
configuration option.
### Configure update-time-range

Use the `update-time-range` configuration to set the time interval when `jenkins-k8s` automatically
applies the latest patches for the current [LTS](https://www.jenkins.io/download/lts/) version.
The minimum time interval is 1 hour. Time range is applied each day of the week.

```
juju config jenkins-k8s restart-time-range=<desired-time-range>
juju config jenkins-k8s update-time-range=<desired-time-range>

# desired-time-range example: 22-03 to allow patching from 10PM-03AM UTC.
```
Expand Down Expand Up @@ -47,4 +42,4 @@ jenkins-k8s/0* active idle <ip-address>
Note the difference in patch version under the `Version` column of the application status.

You can verify that the patch has been applied by signing into the Jenkins UI and checking the
version number at the bottom right corner of the footer.
version number at the bottom right corner of the footer.
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 @@ -24,4 +24,4 @@ unit-jenkins-k8s-0:
```

You can use the password retrieved above to access your Jenkins server UI at
`http://<UNIT_IP>:8080` as the "admin" user.
`http://<UNIT_IP>:8080` as the "admin" user.
2 changes: 1 addition & 1 deletion docs/how-to/integrate-with-iam.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ juju integrate jenkins-k8s:ingress traefik-public
juju integrate oathkeeper jenkins-k8s:auth-proxy
```

Now Jenkins will be reachable at https://[public_ip]/[model_name]-jenkins-k8s, where `public_ip` is the load balancer IP assigned to the traefik charm and `model_name`, the model where Jenkins is deployed.
Now Jenkins will be reachable at https://[public_ip]/[model_name]-jenkins-k8s, where `public_ip` is the load balancer IP assigned to the traefik charm and `model_name`, the model where Jenkins is deployed.
2 changes: 1 addition & 1 deletion docs/how-to/integrate-with-machine-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ The syntax of the offer is as follows: `<controller>:<user>/<model>.<charm>`.

```
juju relate jenkins-k8s:agent localhost:admin/tutorial.jenkins-agent
```
```
49 changes: 28 additions & 21 deletions docs/how-to/resize-jenkins-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,43 @@ From [Backing-up/Restoring Jenkins](https://www.jenkins.io/doc/book/system-admin
* Plugins (`.hpi` and `.jpi` files) in the `./plugins` folder

```bash
echo cat <<EOF > backup.sh
#!/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
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
EOF

chmod +x backup.sh
```
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
JENKINS_UNIT=jenkins-k8s/0
juju scp --container jenkins ./backup.sh $JENKINS_UNIT:/backup.sh
juju ssh --container jenkins $JENKINS_UNIT /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
JENKINS_UNIT=jenkins-k8s/0
juju scp --container jenkins $JENKINS_UNIT:/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
JENKINS_APP=jenkins-k8s
juju remove-application $JENKINS_APP
```

## Restore the backup on a new charm instance
Expand All @@ -50,13 +56,14 @@ 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
JENKINS_UNIT=jenkins-k8s/0
juju scp --container jenkins ./jenkins_backup.tar.gz $JENKINS_UNIT:/jenkins_backup.tar.gz
juju ssh --container jenkins $JENKINS_UNIT tar zxvf jenkins_backup.tar.gz
juju ssh --container jenkins $JENKINS_UNIT chown -R 2000:2000 /backup
juju ssh --container jenkins $JENKINS_UNIT cp -R /backup/* /var/lib/jenkins
juju ssh --container jenkins $JENKINS_UNIT rm -rf /backup /jenkins_backup.tar.gz
```
3. Finally restart pebble
```bash
pebble restart jenkins
juju ssh --container jenkins $JENKINS_UNIT pebble restart jenkins
```
2 changes: 1 addition & 1 deletion docs/how-to/rotate-credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ unit-jenkins-k8s-0:
```

You can use the newly generated password above to access your Jenkins server UI at
`http://<UNIT_IP>:8080` as the "admin" user.
`http://<UNIT_IP>:8080` as the "admin" user.
22 changes: 14 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,20 @@ Thinking about using the Jenkins-k8s Operator for your next project? [Get in tou
# Contents

1. [Tutorial](tutorial)
1. [Getting Started](tutorial/getting-started.md)
1. [Getting Started](tutorial/getting-started.md)
1. [How to](how-to)
1. [Configure restart-time-range](how-to/configure-restart-time-range.md)
1. [Get admin password](how-to/get-admin-password.md)
1. [Rotate credentials](how-to/rotate-credentials.md)
1. [Configure restart-time-range](how-to/configure-restart-time-range.md)
1. [How to configure installable plugins](how-to/configure-installable-plugins.md)
1. [How to control heap memory of the jenkins-k8s-operator charm](how-to/configure-jenkins-memory-usage.md)
1. [Get admin password](how-to/get-admin-password.md)
1. [How to integrate with external agent charms](how-to/integrate-with-external-agents.md)
1. [How to integrate with IAM](how-to/integrate-with-iam.md)
1. [How to integrate with machine agents](how-to/integrate-with-machine-agents.md)
1. [How to resize the jenkins-home storage volume](how-to/resize-jenkins-storage.md)
1. [Rotate credentials](how-to/rotate-credentials.md)
1. [Reference](reference)
1. [Actions](reference/actions.md)
1. [Configurations](reference/configurations.md)
1. [Integrations](reference/integrations.md)
1. [Actions](reference/actions.md)
1. [Configurations](reference/configurations.md)
1. [Integrations](reference/integrations.md)
1. [Explanation](explanation)
1. [Agent-deprecated relation](explanation/agent-deprecated-relation.md)
1. [Agent-deprecated relation](explanation/agent-deprecated-relation.md)
2 changes: 1 addition & 1 deletion docs/reference/actions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Actions

See [Actions](https://charmhub.io/jenkins-k8s/actions).
See [Actions](https://charmhub.io/jenkins-k8s/actions).
2 changes: 1 addition & 1 deletion docs/reference/configurations.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Configurations

See [Configure](https://charmhub.io/jenkins-k8s/configure).
See [Configure](https://charmhub.io/jenkins-k8s/configure).
2 changes: 1 addition & 1 deletion docs/reference/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ Performance and Health Overview” under the General section of the dashboard br
restart/redeployment of the charm.

Grafana-Prometheus relate command: `juju relate grafana-k8s:grafana-source prometheus-k8s:grafana-source`
Grafana-dashboard relate command: `juju relate jenkins-k8s:grafana-dashboard grafana-k8s:grafana-dashboard`
Grafana-dashboard relate command: `juju relate jenkins-k8s:grafana-dashboard grafana-k8s:grafana-dashboard`
2 changes: 1 addition & 1 deletion docs/tutorial/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ model environment that you’ve created using the following command.

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