Skip to main content

H Y P E R K U B E - A secure Serverless API and kubectl plugin that stores and retrieve Kubernetes cluster credentials. Hyperkube leverages AWS Secrets Manager for storing credential information.

Project description

hyper-kube-config

Build Status

PyPI version

hyper-kube-config - Provides a secure Serverless API to store and retrieve Kubernetes cluster config credentials. hyper-kube-config leverages AWS Secrets Manager for storing credential information. Included is a kubectl plugin to interface with hyperkube API. It just requires a configuration file. See hyperkube.yaml.example for layout.

hyper-kube-config

Install hyperkube kubectl plugin

pip3 install hyper-kube-config 

Post cluster and creds to hyperkube store

kubectl hyperkube -c ~/hyperkube.yaml add --k8s-config ~/.kube/config

Remove cluster and creds

kubectl hyperkube -c ~/hyperkube.yaml remove --cluster-to-remove 'k8s-cluster-example.cloud' 

Get user creds

kubectl hyperkube -c ~/hyperkube.yaml get --cluster cloud-infra.cloud

Get user creds multiple clusters

kubectl hyperkube -c ~/hyperkube.yaml get \
  --cluster cloud-infra.cloud \
  --cluster bar-cluster.cloud \
  --cluster baz-cluster.com 

List clusters

kubectl hyperkube -c ~/hyperkube-config.yaml list

Store and Associate PEM with Cluster

Store Pem

kubectl hyperkube -c ~/hyperkube-config.yaml add-pem --pem ~/.ssh/my-cluster.pem 

Get Stored Pem

kubectl hyperkube -c ~/hyperkube-config.yaml get-pem --cluster my-cluster.net

Set Cluster Status and/or Environment References

# Set arbitrary status string and environment reference for given cluster
kubectl hyperkube -c ~/hyperkube-config.yaml set-cluster-status --cluster my-cluster.net --status active --environment stage

Get Cluster Status for Environment

# Returns list of clusters that are active for prod environment
kubectl hyperkubetest -c ~/hyperkube-stage.yaml get-cluster-status --status active --environment prod

Requirements

  • Serverless - Serverless Framework
  • Docker - For serverless deploy
  • HTTPie - recommended for API client
  • serverless-python-requirements plugin. Uses Docker and Pip to package a newer vesion of Boto3 for AWS Lambda function use. AWS Lambda boto3 version by default doesn't have AWS Secrets Manager support for tags.
  • click - for hyperkube kubectl plugin
  • kubectl - version 1.12 or higher recommended for stable plugin support.

Deploying Serverless API

sls deploy \
  --stage dev \
  --product k8s \
  --owner myteam@foo.cloud \
  --team myteam \
  --environment dev

This will launch your hyperkube API. Capture the API URL, api key and stage for your hyperkube.yaml configuration. The kubectl hyperkube commands will leverage the config to interact with your stored k8s configs.

Serverless will launch an AWS API Gateway to handle API requests forwardered to AWS Lambda functions. A Dynamodb table is configured to store non-senstative cluster config details, while sensative information in uploaded configs (passwords and certs) is stored in AWS Secrets Manager.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hyper-kube-config-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file hyper-kube-config-0.1.0.tar.gz.

File metadata

  • Download URL: hyper-kube-config-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3

File hashes

Hashes for hyper-kube-config-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7a364462b9ceb8689a5e56d14faf7c7eb03e5e9d029932cd3dddd1cd1526197b
MD5 c977e083f2143cd6e1957bf9e1be5d79
BLAKE2b-256 c7814c3d77074a17a4d20e828a2c95553ce29d204691a295b4b6b8745a29d080

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page