Skip to content

Instantly share code, notes, and snippets.

@zufardhiyaulhaq
Created May 31, 2020 06:00
Show Gist options
  • Save zufardhiyaulhaq/c7d59b0725e6c23e5bf6daeeb82b3333 to your computer and use it in GitHub Desktop.
Save zufardhiyaulhaq/c7d59b0725e6c23e5bf6daeeb82b3333 to your computer and use it in GitHub Desktop.
---
apiVersion: v1
kind: Namespace
metadata:
name: nginx-example
labels:
app: nginx
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: nginx-example
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx:1.17.6
name: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
labels:
app: nginx
name: my-nginx
namespace: nginx-example
spec:
ports:
- port: 80
targetPort: 80
selector:
app: nginx
type: ClusterIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment