Skip to content

Instantly share code, notes, and snippets.

View chukaofili's full-sized avatar

Chuka Ofili chukaofili

View GitHub Profile
@chukaofili
chukaofili / digitalocean-sc.yml
Last active November 1, 2019 00:02
DigitalOcean storage class
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: [name-goes-here]
annotations:
storageclass.kubernetes.io/is-default-class: "true"
parameters:
zone: [region-goes-here]
provisioner: external/digitalocean
@chukaofili
chukaofili / do-blockstorage-pv.sh
Last active November 1, 2019 00:02
Block storage script
#!/bin/bash
sudo su
mkdir -p /etc/kubernetes/kubelet-plugins/volume
## Uncomment line 8 and comment out line 7 below if you are using kubernetes 1.11+.
sed -i -e 's#\(KUBELET_EXTRA_ARGS=\)#\1--volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume #' /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
# echo "KUBELET_EXTRA_ARGS=--volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume " > /etc/default/kubelet # Use /etc/default/kubelet config file instead
systemctl daemon-reload
@chukaofili
chukaofili / digitalocean-pv-example.yml
Last active November 1, 2019 00:02
DigitalOcean persistent volume exammple
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pv1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Under spec.containers.command add the following:
- --flex-volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume
Under spec.containers.volumeMounts add the following:
- mountPath: /etc/kubernetes/kubelet-plugins/volume
name: flexvolume-mount
readOnly: true
Under spec.volumes update the following:
@chukaofili
chukaofili / k8s-dashboard-admin-user.yaml
Last active May 18, 2024 06:30
k8s user for dashboard
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: admin-user
@chukaofili
chukaofili / heapster-influxdb-grafana.yaml
Last active January 20, 2023 09:10
heapster-influxdb-grafana
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: monitoring-influxdb
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: tiller
@chukaofili
chukaofili / cert-manager-cluster-issuer.yaml
Created May 24, 2018 13:38
cert-manager-cluster-issuer
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
server: https://acme-staging.api.letsencrypt.org/directory
email: [your-email-goes-here]
privateKeySecretRef:
name: letsencrypt-staging
@chukaofili
chukaofili / echo-server-tls.yaml
Last active November 1, 2019 00:00
echo-server-tls.yaml
apiVersion: v1
kind: Namespace
metadata:
name: echoserver
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: echoserver
namespace: echoserver
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane