Skip to content

Instantly share code, notes, and snippets.

View ingress-nginx.yaml
---
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: [""]
View 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 Mar 12, 2020
kubernetes python api example
View example.py
#
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 Mar 12, 2020
Example for crd/python kubernetes client
View example.py
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()
View rbac-helm.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller
View main.go
package main
import (
"crypto/tls"
"crypto/x509"
"encoding/json"
"encoding/pem"
"flag"
"io/ioutil"
"log"
@pathcl
pathcl / ingress.go
Created Oct 9, 2019
Get ingress using tls from k8s
View ingress.go
// Problem
// - we simply want to check ssl certs on ingress on kubernetes
package main
import (
"flag"
"fmt"
"os"
"path/filepath"
View .vimrc
" vim-bootstrap b0a75e4
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
@pathcl
pathcl / kubeadm.yaml
Last active Sep 16, 2019
kind configuration for multi master
View kubeadm.yaml
# this config file contains all config fields with comments
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
# patch the generated kubeadm config with some extra settings
kubeadmConfigPatches:
- |
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
metadata:
name: config
@pathcl
pathcl / test.py
Last active Aug 14, 2019
test.py
View test.py
import os
def main():
print("Os: {}".format(os.uname().version))
print("Hostname: {}".format(os.uname().nodename))
if __name__ == "__main__":
main()
You can’t perform that action at this time.