Skip to content

Instantly share code, notes, and snippets.

View pathcl's full-sized avatar

pathcl

View GitHub Profile
@pathcl
pathcl / rabbitmq-cluster.md
Created December 20, 2020 20:34 — forked from pobsuwan/rabbitmq-cluster.md
How to config rabbitmq server cluster [3 nodes]

How to config rabbitmq server cluster [3 nodes]

Edit /etc/hosts

vi /etc/hosts
192.168.10.157  rabbitmq-1
192.168.10.159  rabbitmq-2
192.168.10.161  rabbitmq-3
@pathcl
pathcl / test.tf
Created December 16, 2020 18:42
test.tf
provider "rabbitmq" {
endpoint = "https://someotherendpoint"
alias = "lab"
username = var.rabbit_username
password = var.rabbit_password
insecure = true
}
provider "rabbitmq" {
endpoint = "https://someendpoint"
@pathcl
pathcl / ingress-nginx.yaml
Last active March 14, 2020 18:45
nginx ingress
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
rules:
- apiGroups: [""]
@pathcl
pathcl / checkdhcp.py
Created March 12, 2020 17:05
checkdhcp.py
#!/usr/bin/env python
#
# Author: Hari Sekhon
# Date: 2007-11-20 18:16:55 +0000 (Tue, 20 Nov 2007)
#
# https://github.com/harisekhon/nagios-plugins
#
# License: see accompanying LICENSE file
#
@pathcl
pathcl / example.py
Created March 12, 2020 10:53
kubernetes python api example
#
from kubernetes import client, config
from kubernetes.utils import create_from_yaml
k8s_config = config.load_kube_config(
config_file="/yourkubeconfig/kubeconfig")
k8s_client = client.api_client.ApiClient(configuration=k8s_config)
# taken from here https://raw.githubusercontent.com/pathcl/hellok8s/master/helloworld.yaml
create_from_yaml(yaml_file='helloworld.yaml',
@pathcl
pathcl / example.py
Last active March 12, 2020 10:55
Example for crd/python kubernetes client
from pprint import pprint
from kubernetes import client, config
c = client.Configuration()
c.debug = True
config.load_kube_config(
config_file="/Users/lsanmartin/work/capv/out/k8s-m-mgmt/kubeconfig")
api = client.CustomObjectsApi()
@pathcl
pathcl / rbac-helm.yaml
Created December 2, 2019 16:04
rbac-helm.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller
@pathcl
pathcl / main.go
Created October 18, 2019 15:37
example
package main
import (
"crypto/tls"
"crypto/x509"
"encoding/json"
"encoding/pem"
"flag"
"io/ioutil"
"log"
@pathcl
pathcl / ingress.go
Created October 9, 2019 20:46
Get ingress using tls from k8s
// Problem
// - we simply want to check ssl certs on ingress on kubernetes
package main
import (
"flag"
"fmt"
"os"
"path/filepath"
@pathcl
pathcl / .vimrc
Created October 6, 2019 13:07
.vimrc
" vim-bootstrap b0a75e4
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.vim/autoload/plug.vim')