GithubHelp home page GithubHelp logo

gsm1011 / kubernetes-yaml-templates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dennyzhang/kubernetes-yaml-templates

0.0 1.0 0.0 1.21 MB

Kubernetes Yaml Templates

Home Page: https://cheatsheet.dennyzhang.com/cheatsheet-kubernetes-yaml

kubernetes-yaml-templates's Introduction

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 General

YamlSummary
namespace/ns-dummy.yamlCreate a dummy namespace

1.12 Jobs & CronJob

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

1.13 Related Tools

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

1.14 More Resources

License: Code is licensed under MIT License.

kubernetes-yaml-templates's People

Contributors

dennyzhang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.