kubernetes.core.k8s – Kubernetes (K8s) inventory source¶
Note
This plugin is part of the kubernetes.core collection (version 1.2.1).
To install it use: ansible-galaxy collection install kubernetes.core
.
To use it in a playbook, specify: kubernetes.core.k8s
.
Synopsis¶
Fetch containers and services for one or more clusters.
Groups by cluster name, namespace, namespace_services, namespace_pods, and labels.
Uses the kubectl connection plugin to access the Kubernetes cluster.
Uses k8s.(yml|yaml) YAML configuration file to set parameter values.
Requirements¶
The below requirements are needed on the local controller node that executes this inventory.
python >= 2.7
openshift >= 0.6
PyYAML >= 3.11
Parameters¶
Examples¶
# File must be named k8s.yaml or k8s.yml
# Authenticate with token, and return all pods and services for all namespaces
plugin: kubernetes.core.k8s
connections:
- host: https://192.168.64.4:8443
api_key: xxxxxxxxxxxxxxxx
validate_certs: false
# Use default config (~/.kube/config) file and active context, and return objects for a specific namespace
plugin: kubernetes.core.k8s
connections:
- namespaces:
- testing
# Use a custom config file, and a specific context.
plugin: kubernetes.core.k8s
connections:
- kubeconfig: /path/to/config
context: 'awx/192-168-64-4:8443/developer'
Authors¶
Chris Houseknecht <@chouseknecht>
Fabian von Feilitzsch <@fabianvf>