Skip to content

sekassel-research/actions-rancher-update

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

rancher-update

This action helps by updating a service in the Rancher 2 environment with kubernetes. It does so by patching the container image field of one or more deployments, cronjobs, statefulsets, etc. In addition, it can set a timestamp annotation to ensure redeployment.

Examples

Update service

on:
push:
  branches:
  - master

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
    - uses: sekassel-research/[email protected]
      with:
        rancher_url: ${{ secrets.RANCHER_URL }} # e.g. https://rancher.test.de
        rancher_token: ${{ secrets.RANCHER_TOKEN }} # e.g. token-xxxxx:xxxxxxxxxxxxxxx
        cluster_id: ${{ secrets.CLUSTER_ID }} # e.g. c-xxxxx
        namespace: ${{ secrets.NAMESPACE }}
        # Update one or more workloads. Optionally supports container ID and image:tag.
        workloads: |- # note "|-": chop trailing newline
          deployment/${{ secrets.DEPLOYMENT }}
          cronjob/${{ secrets.CRONJOB }}
          deployment/${{ secrets.DEPLOYMENT }}/2
          deployment/${{ secrets.DEPLOYMENT }}:registry.example.com/image:tag
          deployment/${{ secrets.DEPLOYMENT }}/3:registry.example.com/image:tag
        docker_image: sekassel-research/example:latest # used as default when the workload config does not override it
        redeploy: false # optional, sets a timestamp annotation to ensure redeployment
        timeout: 15 # optional, seconds before HTTP requests time out

Backwards compatibility

If you want to use this extension for Rancher 1.6.x, please read the instructions on the v1 branch.

About

A Github action to upgrade a service in Rancher 2.X.X or Rancher 1.6.X

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors