Giter Site home page Giter Site logo

signaleleven / aws-ssm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cmattoon/aws-ssm

0.0 2.0 0.0 4.71 MB

Populates Kubernetes Secrets from AWS Parameter Store

Home Page: https://hub.docker.com/r/cmattoon/aws-ssm/

License: Apache License 2.0

Dockerfile 2.89% Makefile 4.86% Smarty 0.99% Go 87.18% Shell 4.08%

aws-ssm's Introduction

cmattoon/aws-ssm

Build Status GitHub tag Docker Pulls codecov Go Report Card Maintainability Anchore Image Overview

Updates Kubernetes Secrets with values from AWS Parameter Store

  • For example usage, see example.yaml
  • Use the Helm chart to get up and running quickly

Build Options

  • Helm Chart (recommended): make {lint|install|purge}
  • Go: make test && make build
  • Docker: make container

Helm Chart

Install Helm Chart

First, export required variables, then run make install.

export AWS_REGION=<region>
export AWS_SECRET_KEY=<secret>
export AWS_ACCESS_KEY=<access-key-id>

AWS User/Role

The AWS credentials should be associated with an IAM user/role that has the following permissions:

  • @todo

Values

The following chart values may be set. Only the required variables (AWS credentials) need provided by the user. Most of the time, the other defaults should work as-is.

Req'd Value Default Example Description
YES aws.region "" us-west-2 The AWS region in which the Pod is deployed
YES aws.access_key ""
YES aws.secret_key ""
NO kubeconfig64 "" The output of `$(cat $KUBE_CONFIG
NO metrics_port 9999 Serve metrics/healthchecks on this port
NO replicas 1 The number of Pods
NO image.name cmattoon/aws-ssm / The Docker image to use for the Pod container
NO image.tag latest The Docker tag for the image
NO resources {} Kubernetes Resource Requests/Limits
NO host_ssl_dir "" /etc/ssl/certs If specified, mounts certs from the host.
NO rbac.enabled true Whether or not to add Kubernetes RBAC stuff

Docker Container

Build

Run make container to build the Docker image

Configuration

The following app config values can be provided via environment variables or CLI flags. CLI flags take precdence over environment variables.

A KUBE_CONFIG and MASTER_URL are only necessary when running outside of the cluster (e.g., dev)

Environment Flag Default Description
AWS_REGION -region us-west-2 The AWS Region
METRICS_URL -metrics-url 0.0.0.0:9999 Address for healthchecks/metrics
KUBE_CONFIG -kube-config The path to the kube config file
MASTER_URL -master-url The Kubernetes master API URL

MVP Working (go binary)

  1. Create Parameter in AWS Parameter Store

my_value = foobar

  1. Create Kubernetes Secret with Annotations
apiVersion: v1
kind: Secret
metadata:
  name: my-secret
  annotations:
    "alpha.ssm.cmattoon.com/k8s-secret-name": my-secret
    "alpha.ssm.cmattoon.com/aws-param-name": my_value
    "alpha.ssm.cmattoon.com/aws-param-type": SecureString
    "alpha.ssm.cmattoon.com/aws-param-key": "alias/aws/ssm"
data: {}
  1. Run Binary

  2. A key with the name $ParameterType should have been added to your Secret

apiVersion: v1
kind: Secret
metadata:
  name: my-secret
  annotations:
    "alpha.ssm.cmattoon.com/k8s-secret-name": my-secret
    "alpha.ssm.cmattoon.com/aws-param-name": my_value
    "alpha.ssm.cmattoon.com/aws-param-type": SecureString
    "alpha.ssm.cmattoon.com/aws-param-key": "alias/aws/ssm"
data:
  SecureString: foobar

Build

make
make container

CA Certificates

For ease of use, the ca-certificates package is installed on the final library/alpine image. If you're having SSL/TLS connection issues, export HOST_SSL_DIR=/etc/ssl/certs before running make install. This will mount the SSL cert directory on the EC2 instance.

aws-ssm's People

Contributors

cmattoon avatar cmosetick avatar msacchippro avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.