Skip to content

Plugins for Kubernetes

Processed releases: xrally-kubernetes 1.0.0 - 1.1.1

Environment Component

Platform

existing [Platform]

Default plugin for Kubernetes.

Create a spec based on system environment.

The environment variables could be defined with two mutually exclusive mandatory ways: check kubeconfig file or kubeconfig envvar, defining certificates or defining auth token.

To search configuration in kubeconfig file, rally checks standard $HOME/.kube/config file or get KUBECONFIG envvar.

To define certificates to connect next environment variables used:

$KUBERNETES_HOST

The URL to the Kubernetes host.

$KUBERNETES_TLS_INSECURE

Not to verify the host against a CA certificate.

$KUBERNETES_CERT_AUTH

A path to a file containing TLS certificate to use when connecting to the Kubernetes host.

$KUBERNETES_CLIENT_CERT

A path to a file containing client certificate to use when connecting to the Kubernetes host.

$KUBERNETES_CLIENT_KEY

A path to a file containing client key to use when connecting to the Kubernetes host.

To define auth token to connect next variables used:

$KUBERNETES_HOST

The URL to the Kubernetes host.

$KUBERNETES_CERT_AUTH

A path to a file containing TLS certificate to use when connecting to the Kubernetes host.

$KUBERNETES_API_KEY

Client API key to use as token when connecting to the Kubernetes host.

$KUBERNETES_API_KEY_PREFIX

Client API key prefix to use in token when connecting to the Kubernetes host.

Platform: kubernetes

The input of this plugin should be valid to the following JSONSchema
{
    "type": "object", 
    "oneOf": [
        {
            "description": "The auth-token authentication", 
            "properties": {
                "api_key": {
                    "type": "string", 
                    "description": "API key for API key authorization"
                }, 
                "api_key_prefix": {
                    "type": "string", 
                    "description": "API key prefix. Defaults to 'Bearer'."
                }, 
                "certificate-authority": {
                    "type": "string", 
                    "description": "Path to certificate authority"
                }, 
                "server": {
                    "type": "string", 
                    "description": "An endpoint of Kubernetes API."
                }
            }, 
            "additionalProperties": false, 
            "required": [
                "server", 
                "certificate-authority", 
                "api_key"
            ]
        }, 
        {
            "description": "The authentication via client certificates.", 
            "properties": {
                "certificate-authority": {
                    "type": "string", 
                    "description": "Path to certificate authority"
                }, 
                "client-certificate": {
                    "type": "string", 
                    "description": "Path to client's certificate."
                }, 
                "client-key": {
                    "type": "string", 
                    "description": "Path to client's key."
                }, 
                "server": {
                    "type": "string", 
                    "description": "An endpoint of Kubernetes API."
                }, 
                "tls_insecure": {
                    "type": "boolean", 
                    "description": "Whether skip or not tls verification. Defaults to False."
                }
            }, 
            "additionalProperties": false, 
            "required": [
                "server", 
                "certificate-authority", 
                "client-certificate", 
                "client-key"
            ]
        }
    ]
}

Module: xrally_kubernetes.env.platforms.existing


Task Component

Scenario

This is base class for any scenario.

All Scenario Plugins should be subclass of this class.

Kubernetes.create_and_delete_namespace [Scenario]

Create namespace, wait until it won't be active and then delete it.

Platform: kubernetes

Parameters
Argument Description
name [ref] namespace custom name
status_wait [ref] wait namespace status after creation

Module: xrally_kubernetes.tasks.scenarios.namespaces


Kubernetes.list_namespaces [Scenario]

List cluster namespaces.

Platform: kubernetes

Module: xrally_kubernetes.tasks.scenarios.namespaces


Validator

A base class for all validators.

required_kubernetes_platform [Validator]

Check for kubernetes platform in selected environment.

Platform: kubernetes

Module: xrally_kubernetes.tasks.validators