Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash -xe
apt-get update -q
apt-get install -yq git python-pip
git clone https://github.com/kubernetes-sigs/kubespray
cd kubespray
pip install -r requirements.txt
#!/bin/bash -e
NAMESPACE=$1
cat << EOF | kubectl apply -f -
---
apiVersion: v1
kind: Namespace
metadata:
name: ${NAMESPACE}
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: chroot
spec:
replicas: 1
template:
metadata:
labels:
#!/usr/bin/env python3
import sys
import argparse
import subprocess
import yaml
def main(path, name, namespace, options):
command = "helm template"
@egeneralov
egeneralov / README.md
Last active October 25, 2019 09:09
Ansible configuration for limit user to its namespace, and list all namespaces in cluster (for dashboard). Can be used for provide access to stage environments for your developers.

k8s-rbac-limit-user-to-namespace.yml

Ansible configuration for limit user to its namespace, and list all namespaces in cluster (for dashboard). Can be used for provide access to stage environments for your developers.

Just ansible-playbook k8s-rbac-limit-user-to-namespace.yml -e namespace=cool-app-development and gather result from /tmp/cool-app-development.yaml

pre-requirements

You must have:

enable ldap auth

vault auth enable ldap

write ldap configuration

vault write auth/ldap/config \

on:
push:
tags:
- 'v*'
name: Release
jobs:
build:
name: Release
@egeneralov
egeneralov / gitlab-create-migrations.py
Last active November 28, 2019 07:33
upgrade your gitlab instance correctly
#!/usr/bin/env python
import re
import subprocess
result = subprocess.check_output("/usr/bin/dpkg --status gitlab-ce".split())
current_version = re.findall(r"Version: (.*)", result)[0].split('-')[0]
print("# Current version: {}".format(current_version))
/tool netwatch add interval="00:01:00" down-script="/system routerboard usb power-reset duration=1" host=10.0.0.1 timeout=2s comment="monkeypath for fucking yota"
#!/bin/bash -xe
kubectl delete -n gitlab-managed-apps \
configmap/prometheus.v1 \
configmap/prometheus-prometheus-server \
pvc/prometheus-prometheus-server \
sa/prometheus-prometheus-server \
sa/prometheus-node-exporter \
sa/prometheus-alertmanager \
sa/prometheus-kube-state-metrics \