Coder Social home page Coder Social logo

cla-kubernetes-plugin's Introduction

Kubernetes Task Plugin

Kubernetes Plugin

Kubernetes plugin will allow you to create new pods remotely from a Clarive instance.

What is Kubernetes

Kubernetes is an open-source system for automating deployment, scaling and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery.

Requirements

This plugin requires Kubernetes to be installed in the destination server to work properly.

To install Kubernetes you need to click here and follow the instructions.

Installation

To install the plugin, place the cla-kubernetes-plugin folder inside the $CLARIVE_BASE/plugins directory in a Clarive instance.

KubernetesPod Resource

To configurate the Kubernetes Pod Resource open:

In Clarive SE: Resources -> ClariveSE.

In Clarive EE: Resources -> Kubernetes.

You will be able to save your configuration code in this Resource. The main fields are:

  • Pod configuration - Write the appropiate code for the pod creation.

Configuration example:

Pod configuration: 
                 apiVersion: v1
                 kind: ReplicationController
                 metadata:
                   name: nginx
                 spec:
                   replicas: 2
                   selector:
                     app: nginx
                   template:
                     metadata:
                       name: nginx
                       labels:
                         app: nginx
                     spec:
                       containers:
                       - name: nginx
                         image: nginx
                         ports:
                         - containerPort: 80

Kubernetes task

The various parameters are:

  • Server (variable name: server) - This option lets you choose the server where you wish to execute the command.
  • User (user) - User which will be used to connect to the server.
  • Command (command) - Via this parameter you can to build ("build") a pod in the remote server or delete it ("delete").
  • Remote path (remote_path) - Full path where the configuration will be shipped.
  • Creation mode (create_mode) - You can choose between creating the pod from an already existing file in the server ("File"), from a Resource ("Resource"), or create it in the rule ("Create").
  • File path (config_file_path) - For create from file option, write the full path to the pod file in the server.
  • Pod Resource (pod_resource) - For create option, select the Kubernetes Resource.
  • Pod configuration (pod_config) - For create option, write the full pod configuration in this variable.
  • Pod config path (delete_pod) - For delete option, write the full path to the pod file in the server.

Only Clarive EE

  • Errors and Output - These two fields deal with managing control errors. The options are:
    • Fail and Output Error - Search for the configured error pattern in the script output. If found, an error message is displayed in the monitor showing the match.
    • Warning and Output warning - Search for the configured warning pattern in the script output. If found, an error message is displayed in the monitor showing the match.
    • Custom - If combo box errors is set to custom, a new form is displayed to define the behavior with these fields:
    • OK - Range of return code values for the script to have succeeded. No message will be displayed in the monitor.
    • Warn - Range of return code values to warn the user. A warning will be displayed in the monitor.
    • Error - Range of return code values for the script to have failed. An error message will be displayed in the monitor.

How to use

In Clarive EE

Once the plugin is placed in its folder, you can find this service in the palette in the section of generic service and can be used like any other palette op.

Op Name: Kubernetes task

Example:

    Server: Remote_server
    Command: Build
    Creation mode: File
    File path: /dir/seconfdir/podConfig.yaml

In Clarive SE

Rulebook

If you want to use the plugin through the Rulebook, in any do block, use this ops as examples to configure the different parameters:

do:
   - kubernetes_task:
       server: 'kubernetes_server'  # Required. Use the mid set to the resource you created
       command: 'build'             # Required
       remote_path: '/tmp/'
       create_mode: 'Create'
       pod_config: |
            apiVersion: v1
            kind: ReplicationController
            metadata:
              name: nginx
            spec:
              replicas: 2
              selector:
                app: nginx
              template:
                metadata:
                  name: nginx
                  labels:
                    app: nginx
                spec:
                  containers:
                  - name: nginx
                    image: nginx
                    ports:
                    - containerPort: 80
Outputs
Success

The plugin will return all the console output.

Possible configuration failures

Task failed

The plugin will return the error from the console output.

Variable required

Error in rulebook (compile): Required argument(s) missing for op "kubernetes_task": "server"

Make sure you have all required variables defined.

Not allowed variable

Error in rulebook (compile): Argument `Code` not available for op "kubernetes_task"

Make sure you are using the correct paramaters (make sure you are writing the variable names correctly).

More questions?

Feel free to join Clarive Community to resolve any of your doubts.

cla-kubernetes-plugin's People

Contributors

gabriel-alv avatar jsdelivrbot avatar yisuscla avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.