Skip to content

Instantly share code, notes, and snippets.

@moondev
Last active August 14, 2020 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moondev/05b1c4f20a275daf8e093b812c1f889d to your computer and use it in GitHub Desktop.
Save moondev/05b1c4f20a275daf8e093b812c1f889d to your computer and use it in GitHub Desktop.
anchors.k8sh.yaml
exec docker run --rm -i --entrypoint=yq mikefarah/yq r - -d1 -X <$0
---
apiVersion: v1
kind: List
metadata:
anchors:
- &name drupal
- &image drupal:latest
- &port 80
- &replicas 4
items:
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: *name
name: *name
spec:
replicas: *replicas
selector:
matchLabels:
app: *name
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: *name
spec:
containers:
- image: *image
name: *name
- apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: *name
name: *name
spec:
ports:
- port: *port
protocol: TCP
targetPort: *port
selector:
app: *name
type: NodePort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment