Kitchen::K8s

Build Status Gem Version

A Test Kitchen driver for testing on top of a Kubernetes cluster.

Installation

Prerequisites:

An installed and configured kubectl binary.

Install the driver:

chef gem install kitchen-k8s

Configure your kitchen.yml to use the driver:

---
  driver:
    name: k8s
    api_server: http://your-k8s-api-server/api
    namespace: default
    token: <your bearer token>
    image: centos:latest
    service_account: default

Options

You can customize things by setting additonal options in the driver section:

---
  driver:
    name: k8s
    api_server: http://your-k8s-api-server/api
    namespace: default
    token: <your bearer token>
    image: centos:latest
    service_account: default
  • api_server - Currently unused The Kubernetes api server that will be used to make connections, used for direct API calls when creating pods (default: http://localhost:8080/api)
  • api_version - Currently unused The version of the Kubernetes API, used in direct API calls (default: v1)
  • binary - The path to kubectl (default: kubectl)
  • image - The default docker image to pull in for testing (default: centos:latest)
  • kubeconfig - The location of your kubeconfig file (default: ~/.kube/config)
  • namespace - The Kuberentes namespace where the pod will spin up in (default: default)
  • service_account - The Kubernetes service account that will be running the pod (default: default)
  • token - Currently unused The bearer token of the user used to authenticate API calls
  • platform - The platform being tested against (default: auto detect)
  • pod_name - The name of the generated pod (default: auto generate)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mickfeech/kitchen-k8s.

License

Copyright 2018, Chris McFee

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.