Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rancher-2-deploy

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rancher-2-deploy

Deploy to Rancher 2.0 via Rancher API v3

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Rancher 2.x Deploy Tool

Deployment tool for updating workloads on Rancher 2.x managed cluster with v3 API. It was developed for gitlab CD pipeline, but can be used for any other workflow. Influenced by the project rancher-gitlab-deploy.

It can be used as CLI tool, Node.js module or CI/CD pipeline tool as a docker image. It can be easily integrated into gitlab-ci.yml or .rancher-pipeline.yml using environment variables.

Right now it's only possible to redeploy a workload, so first you'll need to deploy your workload manually.

Usage

First you need to get an API key from your Rancher Cluster. In Rancher go to User Avatar > API & Keys > Add Key (more info).

Gitlab CI/CD Pipeline

Save the key as an environment variable in your GitLab project. On the GitLab project page go to Settings > CI / CD > Variables (more info).

RANCHER_ENDPOINT - https://rancher.example.com/v3

RANCHER_ACCESS_KEY - token-12345

RANCHER_SECRET_KEY - 0123456789abcdefghijklmnopqrstuvwxyz

Deploy your project on Rancher GUI under Default project to default namespace, then put a deploy stage to your gitlab-ci.yml:

deploy:
  stage: deploy
  image: registry.gitlab.com/heyj0e/rancher-2-deploy
  script:
    - deploy --workload <workload-name>

If you want to specify the project and/or the namespace:

deploy:
  stage: deploy
  image: registry.gitlab.com/heyj0e/rancher-2-deploy
  script:
    - deploy --project <project-name> --namespace <namespace-name> --workload <workload-name>

Node.js module

Install it using npm:

npm install rancher-2-deploy --save

Use:

const rancherRedeploy = require('rancher-2-deploy');

const options = {
  endpoint: 'https://myserver.com/v3',
  accessKey: 'token-12345',
  secretKey: '0123456789abcdefghijklmnopqrstuvwxyz',
  project: 'My Rancher Project', // if omitted, Default will be used
  namespace: 'My Namespace', // if omitted, default will be used
  workload: 'my-awesome-workload',
};

rancherRedeploy(options);
// returns Promise, then Rancher's answer

Authors

  • Joseph Ivan - Initial work - HeyJ0e

License

This project is licensed under the MIT License - see the LICENSE file for details

Keywords

FAQs

Package last updated on 03 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc