Skip to content

Commit

Permalink
chore: update README file
Browse files Browse the repository at this point in the history
  • Loading branch information
tuusberg committed Dec 28, 2023
1 parent 8e04b96 commit aea0cdf
Showing 1 changed file with 19 additions and 34 deletions.
53 changes: 19 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# velero-plugin-suspend-cronjobs

Automatically suspend Kubernetes CronJobs prior to restoring them into a cluster
Automatically suspend Kubernetes CronJobs prior to restoring them into a cluster.

![Build Status][1]

Expand All @@ -12,52 +12,37 @@ To build the plugin, run
$ make
```

To build the image, run
To build the Docker image, run

```bash
$ make container
```

This builds an image tagged as `velero/velero-plugin-example:main`. If you want to specify a different name or version/tag, run:
This builds an image tagged as `github.com/tuusberg/velero-plugin-suspend-cronjobs:latest`. If you want to specify a different name or version/tag, run:

```bash
$ IMAGE=your-repo/your-name VERSION=your-version-tag make container
```

## Deploying the plugins
## Deploying the plugin

To deploy your plugin image to an Velero server:

### Using Velero CLI
1. Make sure your image is pushed to a registry that is accessible to your cluster's nodes.
2. Run `velero plugin add <registry/image:version>`. Example with a dockerhub image: `velero plugin add velero/velero-plugin-example`.


## Creating your own plugin project

1. Create a new directory in your `$GOPATH`, e.g. `$GOPATH/src/github.com/someuser/velero-plugins`
2. Copy everything from this project into your new project

```bash
$ cp -a $GOPATH/src/github.com/vmware-tanzu/velero-plugin-example/* $GOPATH/src/github.com/someuser/velero-plugins/.
```

3. Remove the git history

```bash
$ cd $GOPATH/src/github.com/someuser/velero-plugins
$ rm -rf .git
```

4. Adjust the existing plugin directories and source code as needed.

The `Makefile` is configured to automatically build all directories starting with the prefix `velero-`.
You most likely won't need to edit this file, as long as you follow this convention.

If you need to pull in additional dependencies to your vendor directory, just run

```bash
$ make modules
```

[1]: https://github.com/vmware-tanzu/velero-plugin-example/workflows/Continuous%20Integration/badge.svg

### Using Helm
1. Make sure your image is pushed to a registry that is accessible to your cluster's nodes.
2. Add the plugin to your Velero Helm chart's `values.yaml`:

```yaml
velero:
initContainers:
- name: velero-plugin-suspend-cronjobs
image: tuusberg/velero-plugin-suspend-cronjobs:latest
imagePullPolicy: Always
volumeMounts:
- name: plugins
mountPath: /target
```

0 comments on commit aea0cdf

Please sign in to comment.