This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# != 2 ]; then | |
echo "Specify sa name and namespace" | |
exit 2 | |
fi | |
SA_NAME=$1 | |
SA_NAMESPACE=$2 | |
NEW_KUBECONFIG="k8s_cluster_${SA_NAME}.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired by: https://stackoverflow.com/questions/42170380/how-to-add-users-to-kubernetes-kubectl | |
# this script creates a service account (user1) on a Kubernetes cluster (tested with AWS EKS 1.9) | |
# prereqs: a kubectl ver 1.10 installed and proper configuration of the heptio authenticator | |
# this has been tested on Linux in a Cloud9 environment (for MacOS the syntax may be slightly different) | |
************************************************** | |
******* Create an account ******* | |
************************************************** | |
# Create service account for user user1 | |
kubectl create sa user1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pika, os, sys, argparse | |
arg_parser = argparse.ArgumentParser(description='Send message to RabbitMQ queue.', add_help=False) | |
arg_parser.add_argument('--host', '-h', required=True, help='RammbitMQ host name.') | |
arg_parser.add_argument('--port', '-p', default=5672, type=int, help='RammbitMQ port. Default: 5672') | |
arg_parser.add_argument('--queue', '-q', required=True, help='RammbitMQ queue name. Prod queue is "environments"') | |
arg_parser.add_argument('--data', '-d', required=True, help='Message to RammbitMQ.') | |
args = arg_parser.parse_args() | |
print("Sending data to %s:%s/%s"% (args.host, args.port, args.queue)) |