All Projects → zillow → hyper-kube-config

zillow / hyper-kube-config

Licence: MIT License
H Y P E R K U B E - A Serverless API and kubectl plugin providing a storage and retrieval Kubernetes cluster credentials. Hyperkube leverages AWS Secrets Manager for storing credential information.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to hyper-kube-config

Awsmobile Cli
CLI experience for Frontend developers in the JavaScript ecosystem.
Stars: ✭ 147 (+444.44%)
Mutual labels:  aws-lambda, dynamodb, aws-apigateway
Serverless Express
Run Node.js web applications and APIs using existing application frameworks on AWS #serverless technologies such as Lambda, API Gateway, Lambda@Edge, and ALB.
Stars: ✭ 4,265 (+15696.3%)
Mutual labels:  aws-lambda, dynamodb, serverless-framework
twitter
A serverless social network that's under development with some cool stuff, such as Serverless Framework, AppSync, GraphQL, Lambda, DynamoDB, Cognito, Kinesis Firehose, and Algolia ☁️
Stars: ✭ 29 (+7.41%)
Mutual labels:  aws-lambda, dynamodb, serverless-framework
Graphql Serverless
Sample project to guide the use of GraphQL and Serverless Architecture.
Stars: ✭ 28 (+3.7%)
Mutual labels:  aws-lambda, dynamodb, serverless-framework
Serverless
Serverless 架构应用开发指南 - Serverless Architecture Application Development Guide with Serverless Framework.
Stars: ✭ 1,616 (+5885.19%)
Mutual labels:  aws-lambda, dynamodb, serverless-framework
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+31429.63%)
Mutual labels:  aws-lambda, aws-apigateway, serverless-framework
Aws Iot Chat Example
💬 Chat application using AWS IoT platform via MQTT over the WebSocket protocol
Stars: ✭ 474 (+1655.56%)
Mutual labels:  aws-lambda, dynamodb, serverless-framework
Serverless Sam
Serverless framework plugin to export AWS SAM templates for a service
Stars: ✭ 143 (+429.63%)
Mutual labels:  aws-lambda, aws-apigateway, serverless-framework
Aws Lambda Typescript
This sample uses the Serverless Application Framework to implement an AWS Lambda function in TypeScript, deploy it via CloudFormation, publish it through API Gateway to a custom domain registered on Route53, and document it with Swagger.
Stars: ✭ 228 (+744.44%)
Mutual labels:  aws-lambda, aws-apigateway, serverless-framework
amazon-ivs-ecommerce-web-demo
This repository shows how you can build a compelling eCommerce experience with Amazon IVS.
Stars: ✭ 19 (-29.63%)
Mutual labels:  aws-lambda, serverless-framework
lockbot
🔒 Coordinate use of your team's shared resources, in Slack 🤝
Stars: ✭ 47 (+74.07%)
Mutual labels:  dynamodb, serverless-framework
super-serverless-sample
Backend serverless que simula o sistema de votação do BBB
Stars: ✭ 30 (+11.11%)
Mutual labels:  aws-lambda, dynamodb
aws-secure-websockets
Secure web socket implementation using AWS products and serverless framework
Stars: ✭ 49 (+81.48%)
Mutual labels:  aws-apigateway, serverless-framework
amazon-ivs-ugc-web-demo
This repository shows how you can build a compelling user-generated content (UGC) live streaming webapp with Amazon IVS.
Stars: ✭ 14 (-48.15%)
Mutual labels:  dynamodb, serverless-framework
amazon-ivs-simple-chat-web-demo
⚠️ IMPORTANT ⚠️ This repository is no longer actively maintained and will be archived at the end of 2022. A basic live chat implementation built with WebSockets, that can be used in conjunction with Amazon IVS to build compelling customer experiences for live video streams with chat use cases.
Stars: ✭ 53 (+96.3%)
Mutual labels:  aws-lambda, serverless-framework
CloudFrontier
Monitor the internet attack surface of various public cloud environments. Currently supports AWS, GCP, Azure, DigitalOcean and Oracle Cloud.
Stars: ✭ 102 (+277.78%)
Mutual labels:  dynamodb, serverless-framework
serverless-swagger-api
Simplifies the process of generating an API Gateway API from a swagger file.
Stars: ✭ 15 (-44.44%)
Mutual labels:  aws-apigateway, serverless-framework
aws-serverless-swift-api-template
A Serverless REST API template, implemented in Swift with swift-aws-lambda-runtime.
Stars: ✭ 42 (+55.56%)
Mutual labels:  aws-apigateway, serverless-framework
Jazz
Platform to develop and manage serverless applications at an enterprise scale!
Stars: ✭ 254 (+840.74%)
Mutual labels:  aws-lambda, serverless-framework
aws-serverless-prototype
Serverless Frameworkを使ったAWS Lambdaプロジェクトの試作品
Stars: ✭ 16 (-40.74%)
Mutual labels:  dynamodb, serverless-framework

hyper-kube-config

Python Tests

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.

You can also set cluster's status and retrieve this information. Useful in CI/CD pipelines when trying to pull access to particular cluters without needing to know their names, just their environments.

It requires a configuration file. See hyperkube-config.yaml.example for layout.

hyper-kube-config

Install hyperkube kubectl plugin

pip3 install hyper-kube-config 

Setup ~/hyperkube-config.yaml file

The default locations for the config file is ~/hyperkube-config.yaml. You can also place the config file at a different location and pass the location as a command line option -c <hyper-kube-config-location> or --config <hyper-kube-config-location>

Post cluster and creds to hyperkube store

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

Remove cluster and creds

kubectl hyperkube remove --cluster-to-remove 'k8s-cluster-example.cloud' 

Get user creds and merge it with existing ~/.kube/config

# for single cluster
kubectl hyperkube get --cluster cloud-infra.cloud -m

Get user creds multiple clusters and merge them with existing ~/.kube/config

kubectl hyperkube get \
  --cluster cloud-infra.cloud \
  --cluster bar-cluster.cloud \
  --cluster baz-cluster.com -m

Get creds for all clusters and merge it with existing ~/.kube/config

kubectl hyperkube get-all -m

List clusters

kubectl hyperkube list

Store and Associate SSH PEM and CA private key with Cluster

Store SSH Pem

kubectl hyperkube add-pem --pem ~/.ssh/my-cluster.pem 

Get Stored SSH Pem

kubectl hyperkube get-pem --cluster my-cluster.net

Store Add CA Private Key

kubectl hyperkube add-ca-key --ca-key ca-key-file.key --cluser my-cluster.net

Set Cluster Status and/or Environment References

# Set arbitrary status string and environment reference for given cluster
kubectl hyperkube 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 hyperkube get-cluster-status --status active --environment prod

Requirements

  • Serverless - Serverless Framework
  • 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

Choose authentication method

API Key

Example Serverless Config for API Key Authentication

This config should work out of the box. Feel free to copy to serverless.yml and deploy

IAM Authentication

Example Serverless Config for IAM Authentication

This configuration will require you to add IAM roles to the allowed principal section. These roles are managed outside the scope of this project.

See the section that has:

  resourcePolicy:
    - Effect: Allow
      Principal:
        AWS:
          - arn:aws:iam::{{otherAWSAccountID}}:root
          - arn:aws:iam::{{otherAWSAccountID}}:user/{{otherAWSUserName}}
          - arn:aws:iam::{{otherAWSAccountID}}:role/{{otherAWSRoleName}}

replace with your roles you would like to grant access.

sls deployment
pipenv install
pipenv shell
sls deploy \
  --stage dev \
  --product k8s \
  --owner [email protected] \
  --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.

Testing for lint errors on your local machine

  1. Install Test Dependencies
pip install -U -r tests/requirements.txt
  1. Run flake8 to check for lint errors
flake8 *.py tests cli/kubectl-hyperkube
  1. Run unit tests
python -m unittest discover -s tests/ -p "*.py"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].