Skip to content

Instantly share code, notes, and snippets.

@jodykpw
jodykpw / bobp-python.md
Created June 28, 2019 16:38 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@jodykpw
jodykpw / .gitlab-ci.yml
Last active June 26, 2019 00:52
Local Vs NFS Performance Test
.ci_job: &ci_job
only:
- <only>
tags:
- <tags>
.ci_manual_job: &ci_manual_job
when: manual
<<: *ci_job
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-pv-claim
spec:
storageClassName: "nfs-01"
accessModes:
- ReadWriteMany
resources:
@jodykpw
jodykpw / values.yaml
Last active June 25, 2019 05:12
nfs-client-provisioner example helm chart values
# Default values for nfs-client-provisioner.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
strategyType: Recreate
image:
repository: quay.io/external_storage/nfs-client-provisioner
tag: v3.1.0-k8s1.11
@jodykpw
jodykpw / gitlab-ci.yml
Last active June 25, 2019 03:09
nfs-server-provisioner ci/cd
variables:
CHART_PATH: './nfs-server-provisioner'
NAMESPACE: ''
HELM_RELEASE_NAME: ''
HELM_VALUES: 'nfs-server-provisioner/values.yaml'
.ci_job: &ci_job
only:
- <only>
tags:
@jodykpw
jodykpw / .gitlab-ci.yml
Created June 6, 2019 09:18
Block Storage Storage Class gitlab-ci
.ci_job: &ci_job
only:
- k8s.nerv-system.live
tags:
- master-node-01.nerv-system.live.shared.ssh
.ci_manual_job: &ci_manual_job
when: manual
<<: *ci_job
@jodykpw
jodykpw / storageclass.yaml
Created June 6, 2019 09:12
ROOK Ceph Block Storage
#################################################################################################################
# Create a storage class with a pool that sets replication for a production environment.
# A minimum of 3 nodes with OSDs are required in this example since the default failureDomain is host.
# kubectl create -f storageclass.yaml
#################################################################################################################
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: replicapool
@jodykpw
jodykpw / inventory.ini
Created June 4, 2019 05:56
kubespray sample inventory
# ## Configure 'ip' variable to bind kubernetes services on a
# ## different ip than the default iface
# ## We should set etcd_member_name for etcd cluster. The node that is not a etcd member do not need to set the value, or can set the empty string value.
[all]
# node1 ansible_host=95.54.0.12 # ip=10.3.0.1 etcd_member_name=etcd1
# node2 ansible_host=95.54.0.13 # ip=10.3.0.2 etcd_member_name=etcd2
# node3 ansible_host=95.54.0.14 # ip=10.3.0.3 etcd_member_name=etcd3
# node4 ansible_host=95.54.0.15 # ip=10.3.0.4 etcd_member_name=etcd4
# node5 ansible_host=95.54.0.16 # ip=10.3.0.5 etcd_member_name=etcd5
# node6 ansible_host=95.54.0.17 # ip=10.3.0.6 etcd_member_name=etcd6
@jodykpw
jodykpw / docker-compose.yml
Created May 20, 2019 05:21
GitLab OpenLDAP config
### LDAP Settings
###! Docs: https://docs.gitlab.com/omnibus/settings/ldap.html
###! **Be careful not to break the indentation in the ldap_servers block. It is
###! in yaml format and the spaces must be retained. Using tabs will not work.**
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = {
'main' => {
'label' => 'LDAP',
'host' => 'nerv-system.live',
@jodykpw
jodykpw / .gitlab-ci.yml
Last active April 29, 2019 08:20
Shared SSH GitLab Runner Example
# PRODUCTION
.prd_ci_job: &prd_ci_job
only:
- production
tags:
- hostname.shared.ssh
.prd_ci_manual_job: &prd_ci_manual_job
when: manual
<<: *prd_ci_job