Skip to content

Instantly share code, notes, and snippets.

View matthewpalmer's full-sized avatar

Matthew Palmer matthewpalmer

View GitHub Profile
kind: Pod
apiVersion: v1
metadata:
name: pod-env-var
spec:
containers:
- name: env-var-configmap
image: nginx:1.7.9
envFrom:
- configMapRef:
@matthewpalmer
matthewpalmer / pod.yaml
Created October 22, 2018 00:54
Pod using NFS volume
# Create a pod that reads and writes to the
# NFS server via an NFS volume.
kind: Pod
apiVersion: v1
metadata:
name: pod-using-nfs
spec:
# Add the server as an NFS volume for the pod
volumes:
@matthewpalmer
matthewpalmer / volume.yaml
Created October 21, 2018 20:37
Kubernetes volume example YAML
kind: Pod
apiVersion: v1
metadata:
name: simple-volume-pod
spec:
# Volumes are declared by the pod. They share its lifecycle
# and are communal across containers.
volumes:
# Volumes have a name and configuration based on the type of volume.
# In this example, we use the emptyDir volume type
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: example-ingress
annotations:
ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
kind: Pod
apiVersion: v1
metadata:
name: banana-app
labels:
app: banana
spec:
containers:
- name: banana-app
image: hashicorp/http-echo
# ~ ⟩ kubectl config view
apiVersion: v1
clusters:
- cluster:
insecure-skip-tls-verify: true
server: https://localhost:6443
name: docker-for-desktop-cluster
- cluster:
certificate-authority: /Users/matthewpalmer/.minikube/ca.crt
server: https://192.168.99.100:8443
kind: Pod
apiVersion: v1
metadata:
name: example-pod
spec:
containers:
- image: nginx
name: example-container
@matthewpalmer
matthewpalmer / service.yaml
Created July 22, 2018 01:27
overview of kubernetes port definitions
kind: Service
apiVersion: v1
metadata:
name: port-example-svc
spec:
# Make the service externally visible via the node
type: NodePort
ports:
# Which port on the node is the service available through?
@matthewpalmer
matthewpalmer / configmap.yaml
Created July 21, 2018 04:12
kubernetes php fpm nginx config
# First, create a ConfigMap whose contents are used
# as the nginx.conf file in the web server.
# This server uses /var/www/html as its
# root document directory. When the server gets a
# request for *.php, it will forward that request
# to our PHP-FPM container.
kind: ConfigMap
apiVersion: v1
metadata:
@matthewpalmer
matthewpalmer / Dockerfile
Created July 21, 2018 04:09
kubernetes php fpm nginx
# docker build . -t my-php-app:1.0.0
FROM php:7.2-fpm
RUN mkdir /app
COPY hello.php /app