• Stars
    star
    594
  • Rank 75,329 (Top 2 %)
  • Language
  • Created about 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kubernetes Yaml Templates

1 Kubernetes Yaml Templates

linkedin
github
slack


PRs Welcome

File me Issues or star this repo.

1.1 Pod

YamlSummary
pod/pod-dummy.yamlStart a dummy pod with a dead sleep loop
pod/pod-nginx.yamlStart a pod of sample app(nginx)
pod/pod-initcontainer-sysctl.yamlUse initContainer to run sysctl, when starting a Pod
pod/pod-healthcheck-nginx.yamlStart pod with tcp and http healthcheck
pod/pod-secrets.yamlPod use secrets as either volumes or environment variables
pod/pod-gitclone.yamlPod: use initContainer as sidecar to web host a git repo
pod/pod-hostaliases.yamlPod: add alias to /etc/hosts
pod/pod-serviceaccount.yamlStart pod with serviceaccount, instead of default serviceaccount
pod/pod-handlers.yamlPod’s events whenever it get started or stoppped
ReferenceLink: kubectl cheatsheet

1.2 Volume

YamlSummary
volume/volume-manual-pv.yamlCreate pv first, then pvc
volume/volume-mount-localpath.yamlMount a local folder to pods
volume/volume-emptydir.yamlCreate a empty folder, then mount to pods
volume/volume-ebs.yamlMount EBS volume to pod running in amazon instance with the same AZ
volume/volume-nfs.yamlCreate nfs pv
volume/volume-gcePersistentDisk.yamlMount GCE disk to pod running in amazon instance with the same AZ
volume/volume-digitalocean.yamlCreate DigitalOcean volume for your kubernetes cluster in DigitalOcean
ReferenceLink: kubectl cheatsheet, Link: volumes examples

1.3 Service

YamlSummary
service/service-loadbalancer.yamlService: loadbalancer
service/service-nodeport.yamlService: nodeport
service/service-ingress.yamlService: ingress
service/service-clusterip-nginx.yamlService: nginx with clusterip
service/service-cassandra.yamlService: cassandra
ReferenceLink: kubectl cheatsheet

1.4 Configmap/Envs

YamlSummary
config/pod-configmap.yamlCreate configmap from file, then use it as a pod volume
config/pod-environment-var.yamlStart a pod passing environment variables
config/pod-env-metada.yamlExpose metadata to pods
config/configmap-plaintext.yamlDefine configmap with plain text

1.5 Security - RBAC

YamlSummary
rbac/serviceaccount-default.yamlServiceaccount: basic usage
rbac/rbac-default.yamlServiceaccount: concret example
ReferenceLink: kubectl cheatsheet

1.6 Security - PodSecurityPolicy

YamlSummary
podsecurity/securitycontext-user.yamlConfigure userid, at both pod and container levels
podsecurity/podsecurity-privileged.yamlCreate pod security with privileged access
podsecurity/podsecurity-restricted.yamlCreate pod security with restricted access, then apply it later
podsecurity/podsecurity-enforce.yamlEnforce policy security by defining role and cluster role
podsecurity/podsecurity-advanced.yamlA more complicated definition of pod security policy
podsecurity/podsecurity-example.yamlA full example with everything included
LinksLink: kubectl cheatsheet

1.7 Security - NetworkPolicy

YamlSummary
networksecurity/networksecurity-denyall-ingress.yamlAllow all ingress
networksecurity/networksecurity-allowall-ingress.yamlDeny all ingress
networksecurity/networksecurity-denyall.yamlDeny all ingress and egress
networksecurity/networksecurity-pod.yamlWhitelist traffic control
networksecurity/networksecurity-complicated.yamlA comprehensive network policy example
networksecurity/networksecurity-port.yamlAllow TCP 443 from one namespace
networksecurity/networksecurity-deny-othernamespaces.yamlDeny all ingress traffic from other namespaces
networksecurity/networksecurity-denyegress-exceptdns.yamlDeny all egress traffic except DNS
ReferenceLink: kubectl cheatsheet, GitHub: kubernetes-network-policy-recipes

1.8 Quota & Limits

YamlSummary
quota/limitrange-pvc-size.yamlLimitRange: PVC size
quota/limitrange-pvc-cumulative-size.yamlResourceQuota: pvc count and storage size
quota/limitrange-mem-size.yamlLimitRange: Pod ram usage. Then apply it to namespace
ReferenceLink: kubectl cheatsheet

1.9 Deployment

YamlSummary
deployment/deployment-nginx.yamlDeploy nginx with 2 replicas
deployment/deployment-mysql.yamlDeploy mysql
ReferenceLink: kubectl cheatsheet

1.10 Statefulset

YamlSummary
statefulset/statefulset-nginx.yamlStatefulset: nginx
statefulset/statefulset-single-mysqlStatefulset: mysql
statefulset/statefulset-replicated-cassandra.yamlStatefulset: single cassandra
statefulset/statefulset-replicated-mysqlStatefulset: cassandra with replicas
ReferenceLink: kubectl cheatsheet

1.11 Jobs & CronJob

YamlSummary
job/job-affinity.yamlDeploy a job with node affinity

1.12 HorizontalPodAutoscaler

YamlSummary
hpa/hpa-nginx.yamlDeploy a horizontal pod autoscaler for nginx deployment

1.13 Adhoc

YamlSummary
namespace/ns-dummy.yamlCreate a dummy namespace

1.14 Related Tools

NameSummary
GitHub: kubernetes-sigs/kustomizeCustomization of kubernetes YAML configurations

1.15 More Resources

License: Code is licensed under MIT License.

More Repositories

1

cheatsheet-kubernetes-A4

📖 Kubernetes CheatSheets In A4
Shell
1,851
star
2

cheatsheet.dennyzhang.com

Apply best practices via CheatSheets
Shell
649
star
3

cheatsheet-jenkins-groovy-A4

📖 Groovy CheatSheet For Jenkins Usage In A4
Groovy
325
star
4

challenges-kubernetes

☁️ Challenges Your Kubernetes Skills And Knowledge
Shell
230
star
5

devops_public

🎩 DevOps Scripts
Shell
179
star
6

cheatsheet-gcp-A4

☁️ GCP gcloud, gsutil, etc.
110
star
7

cheatsheet-python-A4

📖 Advanced Python Syntax In A4
Python
100
star
8

code.dennyzhang.com

❓ Algorithms & Coding Problems
CSS
95
star
9

cheatsheet-docker-A4

📖 Docker CheatSheets In A4
Dockerfile
90
star
10

monitor-docker-slack

⏰ Get Slack Notifications, When Containers Run Into Issues
Python
71
star
11

challenges-cloudformation-jenkins

🏫 Challenges Your AWS And Cloudformation Skills By Solving Real Questions.
Shell
60
star
12

cheatsheet-golang-A4

📖 Advanced Golang Syntax In A4
Go
56
star
13

prepare-k8s-cka

📖 Preparation For Kubernetes CKA/CKAD Exam
51
star
14

cheatsheet-aws-A4

☁️ AWS CheatSheets In A4
48
star
15

cheatsheet-paper-A4

https://cheatsheet.dennyzhang.com/cheatsheet-paper-A4
46
star
16

Denny-s-emacs-configuration

🤖 Emacs shapes me to be a better programmer
Emacs Lisp
41
star
17

kubernetes-scripts

Handy kubernetes scripts for common scenarios
Shell
37
star
18

challenges-chef

📖 Challenges Your Chef Skills By Solving Real Questions.
Ruby
26
star
19

cheatsheet-git-A4

CheatSheet For Git & GitHub
25
star
20

developer-free-saas

🕸️ A curated list Of Free Web-based Tools For Developers
Shell
23
star
21

devops_jenkins

🤖 VisualOps via Jenkins jobs
21
star
22

architect.dennyzhang.com

☝️ Learn system design in a solid way
Shell
21
star
23

cheatsheet-tmux-A4

tmux/tmate Usage in A4
20
star
24

cheatsheet-vim-A4

Vim usage and personal knowledge base
18
star
25

cheatsheet-pks-A4

CheatSheet For PKS: Pivotal Kubernetes Service
Shell
16
star
26

popular-github-template

📗 Repo Template: Make Your GitHub Repos More Popular
16
star
27

cheatsheet-shell-A4

🏫 Examine your shell skills
Shell
16
star
28

xiaozibao

Your personal magzine, adjusted by your taste.
Objective-C
13
star
29

python-selenium

Use Python Selenium For GUI Automation Test
Python
11
star
30

cheatsheet-bosh-A4

📖 CheatSheet For CloudFoundry Bosh
Shell
10
star
31

remote-commands-servers

👪 Run remote ssh commands on multiple servers
Python
9
star
32

monitoring

Checks for various monitoring
Shell
9
star
33

chatops_slack

🚀 Python Slack ChatOps
Python
7
star
34

elasticsearch-cli-tool

🏪 CLI tools for ealsticsearch
Python
6
star
35

developer-technical-selling

💵 Do a better technical selling as a developer
5
star
36

linkedin-grow-influence

🔌 How To Improve Professional Influence In Linkedin
5
star
37

challenges-k8s-monitoring

Notes for deep dive into Kubernetes monitoring
5
star
38

cheatsheet-emacs-A4

📖 Emacs lisp cheatsheet
Emacs Lisp
5
star
39

challenges-aws-ecs

✍️ Case study using AWS ECS to setup personal wordpress
PHP
5
star
40

challenges-k8s-crd

Kubernets CRD: extend k8s resource
Dockerfile
4
star
41

cheatsheet-ruby-A4

📖 Advanced Ruby Syntax In A4
4
star
42

detect_suspicious_process

Detect suspicious process
Python
4
star
43

directory-cli-tool

📁 CLI tools for directories
Shell
3
star
44

python-hosts-tool

📍 Manage /etc/hosts in an organized way by Python
Python
3
star
45

code-with-docker

Use docker to write code in different languages
Shell
3
star
46

www.dennyzhang.com

Personal blog: DevOps, Cloud, Life
Shell
3
star
47

challenges-k8s-logging

Notes for deep dive into Kubernetes logging
3
star
48

challenges-k8s-storage

Notes for deep dive into Kubernetes storage
3
star
49

maintain-github-repos

👪 KnowledgeBase: Grow Influence From Maintaining Github Projects
3
star
50

maintain-it-blog

📚 Be a better IT Blogger
3
star
51

chef_community_cookbooks

🍖 Chef cookbooks for devops
Python
3
star
52

nmap-scan-docker

nmap network scan via docker
Python
3
star
53

shadowsocks-vpn-docker

🏗️ Docker shadowsocks VPN
Shell
2
star
54

dennytest

Github Repo to host various test scripts
Go
2
star
55

jenkins_image

💂‍♂️ Jenkins Docker Image
Shell
2
star
56

my-slides

Host my slides: devops, kubernetes, life, etc
2
star
57

cleanup_old_files

Clean old files in an organized way
Python
2
star
58

terraform_jenkins_digitalocean

Define Jenkins job to create and provision digitalocean VMs by terraform
Shell
2
star
59

python-aws-cli-wrapper

☁️ Wrapper layer of AWS CLI in Python
Python
2
star
60

cheatsheet-living-in-ca

👪 CheatSheet for living in Canifornia
2
star
61

quiz.dennyzhang.com

📖 Examine skills in a hard way
Shell
1
star
62

dennyzhang.github.io

dummy website
1
star
63

check_logfiles

nagios plugin to check log files
Perl
1
star
64

book-reading-cloud

📖 My book reading to be a good cloud engineer/architect
1
star
65

couchbase-cli-tool

Couchbase CLI Tools
Python
1
star
66

node_status_in_json

Query node status and return a structured json
Python
1
star
67

challenges-fluent-bit

Deep dive into fluent-bit
1
star
68

today-learning

Personal memo for #today-learnings in our DevOps slack group
1
star