Code Monkey home page Code Monkey logo

ansible-kubernetes-modules's Introduction

ansible-kubernetes-modules

Provides access to the latest release of the K8s modules.

Include this role in a playbook, and any other plays, roles, and includes will have access to the modules.

The modules are found in the library folder. Each has full documentation for parameters and the returned data structure. However, not all modules will include examples, only those where test data has been created.

If you find an issue with a particular module, or have suggestions, please file an issue at the OpenShift Rest Client repo.

Requirements

  • Ansible installed from source
  • OpenShift Rest Client installed on the host where the modules will execute.

Installation and use

Use the Galaxy client to install the role:

$ ansible-galaxy install ansible.kubernetes-modules

Once installed, add it to a playbook:

---
- hosts: localhost
  remote_user: root
  roles:
    - role: ansible.kubernetes-modules
      install_python_requirements: no
    - role: hello-world

Because the role is referenced, the hello-world role is able to deploy an applicatoin using the K8s modules. To see contents of the actual role, check in the tests/roles folder.

Authenticating with the API

The modules interact directly with the Kubernetes or OpenShift API. It is not required that you have the kubectl or oc CLI tool installed.

Module parameters

The OpenShift rest client requires a Kubernetes config file. Use the following options to control where it looks for the file, and the context it uses to authenticate with the API:

kubeonfig

The default path to the config file is ~/.kube/config. Use to pass an alternate file path.

context

Name of the configuration context to use for authentication. If not specified, the current, active contexts is used.

Use the following parameters to ovrride the settings found in the config file:

host

Provide the URL to the API server.

ssl_ca_cert

Path to the Certificate Authority certificate file.

cert_file

Path to the server certificate file.

key_file

Path to the private key file.

api_key

API token.

verify_ssl

Set to true or false. If false, SSL verification will not be enforced.

Environment Variables

Rather than pass the authentication settings as parameters to individual modules, you can pass the information using environment variables. The name of the environment variables is K8S_AUTH_ followed by the variable name in uppercase. For example, key_file would be K8S_AUTH_KEY_FILE

Role Variables

install_python_requirements

Set to true, if you want the OpenShift Rest Client installed. Defaults to false. Will install via pip.

virtualenv

Provide the name of a virtualenv to use when installing pip packages.

License

Apache V2

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.