Skip to content

Instantly share code, notes, and snippets.

@ahmad-elbatanouni
Last active December 18, 2023 10:50
Show Gist options
  • Save ahmad-elbatanouni/92cd6f574eceb067e3e8c19610629e96 to your computer and use it in GitHub Desktop.
Save ahmad-elbatanouni/92cd6f574eceb067e3e8c19610629e96 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
spec:
selector:
matchLabels:
my-label: some-value
replicas: 3
template:
metadata:
name: any-name-that-you-like
labels:
my-label: some-value # Must be the same as the one in the selector
spec:
containers:
- image: nginx
name: nginx-container
resources: # Will cause errors when used on killerCoda due to the limited resources
limits:
memory: '512Mi'
cpu: '1'
# Create by running the following command in the terminal
# kubectl apply -f pod.yml
# Access on your browser using
# kubectl port-forward deployments/my-deployment-controller 8080:80 --address='0.0.0.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment