Posts

Showing posts from 2019

Kubernetes namespace python lib

# KUBERNETES NAMESPACE A python-based helper capable of managing the Kubernetes namespace. ## Introduction This lib will manage namespace in kubernetes cluster and setting quoata and limits. ## Instalation ### git clone ```bash git clone https://github.com/danbordeanu/simple_kubernetes_namespace.git ``` ### Prerequisites 1. python/pip 2. ssl certs from kube/config file ## Getting the ssl certs and populating the config.ini file kube_namespace is using ssl cert file to authenticate, take a look at the __config.ini__ file ```bash # certificate-authority-data ssl_ca_cert_file: ssl/ca_cert.crt # client-certificate-data ssl_cert_file: ssl/cert_file.crt # client-key-data ssl_key_file: ssl/key_file.crt ``` The ssl certs are extracted from the kube config file: Ex: ``` apiVersion: v1 clusters: - cluster:     certificate-authority-data: XXXX     server: https://akscluster.xxxx.azmk8s.io:443   name: akscluster contexts: - context:     cluster: akscl

Simple python ldap lib

Simple lib for ldap authentication A python-based helper capable of authentication using ldap. Introduction Simple python lib that will perform authentication by connectiong to ldap endpoint. If login is succesful it wil return a token that can be used in different REST/API apps. Prerequisites python/pip memcached server ldap server Installation Cloning git clone https://github.com/danbordeanu/simple_ldap_token.git Installing pip packages pip install -r requirements.txt Configuration Edit the config.ini file based on your server settings. [ldap] # ldap address server: ldaps://ldapserver:636 # my super secret key secret_key: supersecretthing # expire interval expire_interval: 3600 ldap_search: OU=eCore Office,OU=People Accounts,DC=domain,DC=com [memcache] port: 11211 host: localhost Also env vars for ldap and memcache host are supported. export LDAP_HOST='ldaps://ldapserver:636 export MEMCACHED_HOST='localhost' export MEMCACHE