Skip to content

Instantly share code, notes, and snippets.

@innovia
innovia / package.py
Last active December 21, 2022 06:52
from setuptools import Command
import shlex
import subprocess
import os
WHEELHOUSE = "wheelhouse"
class Package(Command):
"""Package Code and Dependencies into wheelhouse"""
@innovia
innovia / setup.py
Last active October 23, 2022 13:22
from setuptools import find_packages, setup
from package import Package
setup(
author="Ami Mahloof",
author_email="[email protected]",
packages=find_packages(),
include_package_data=True,
cmdclass={
"package": Package
@innovia
innovia / setup_confg.yaml
Created September 9, 2017 09:02
Basic setup_config file
---
name: "MyProject"
description: "Some Django App"
manifest:
graft: "location/to/Django/staticfiles"
prune: "some-un-needed folder"
@innovia
innovia / service_account_role_and_role_binding.yaml
Last active March 12, 2019 12:19
Role for serviceacocunt bound to namespace
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
namespace: services-stg
name: deploy-stg
rules:
- apiGroups: ["", "extensions", "apps"] # "" indicates the core API group
resources: ["*"]
verbs: ["*"]
@innovia
innovia / tiller_role_service_account_rbac.yaml
Last active March 12, 2019 12:19
Tiller service account per namespace
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: tiller-manager
namespace: stg
rules:
- apiGroups: ["", "extensions", "apps"]
resources: ["*"]
verbs: ["*"]
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@innovia
innovia / ElasticSearch Unassigned Shards Reassigner
Created June 30, 2015 11:32
ElasticSaerch unassigned shards reassign
#!/usr/bin/env ruby
require 'json'
es_cluster = 'http://localhost:9200'
master_node = "Howard the Duck" # sey your master node name here
unassigned_shards_info = `curl -s -XGET #{es_cluster}/_cat/shards | grep UNASSIGNED `.split("\n")
shard_indexes = []