Skip to content

Instantly share code, notes, and snippets.

View eyarz's full-sized avatar
🐐

Eyar Zilberman eyarz

🐐
View GitHub Profile
apiVersion: v1
kind: Ingress
metadata:
name: test
spec:
rules:
- host: * # <-- this setup will forward all Ingress traffic to a single container
http:
paths:
- path: /foo
apiVersion: v1
kind: Pod
metadata :
labels :
test: liveness
name: liveness—http
spec:
containers:
— name: liveness
image: some-random-image:v1.0
ports:
- protocol: TCP
port: 6379
apiVersion: networking.k8s.io/v1
kind: networkPolicy
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness—http
spec:
containers:
— name: liveness
image: some-random-image:v1.0
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
livenessprobe:
httpGet:
path: /healthz
port: 8080
initialDetaySeconds: 3
periodSeconds: 3
apiVersion: vl
kind: Service
metadata :
name: <my—nodeport—service>
labels:
<my-label-key>: <my-label-value>
spec :
selector:
<my-selector-key>: <my-selector-value>
type: NodePort // <-- This sets the "type"
kind: Service
apiVersion: v1
metadata :
name: my—service
spec:
selector:
app: MyApp
ports :
— protocol: TCP
port: 80
@eyarz
eyarz / bad-practice-example.yml
Last active September 12, 2019 09:23
How not to write a YAML file
apiVersion: v1
kind: Pod
metadata:
name: Octocat-service
labels:
purpose: Generate Octocats
spec:
containers:
- name: octocat-generator-container
image: docker.pkg.github.com/ubuntu:latest