Skip to content

Instantly share code, notes, and snippets.

@collabnix
Created September 2, 2020 07:15
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 collabnix/214278d715cb8b82eeec33af5e0fa1cf to your computer and use it in GitHub Desktop.
Save collabnix/214278d715cb8b82eeec33af5e0fa1cf to your computer and use it in GitHub Desktop.
Deploying NGINX using Portainer 2.0 UI
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: nginx
replicas: 3 # tells deployment to run 1 pods matching the template
template: # create pods using pod definition in this template
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx
namespace: default
labels:
app: nginx
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
spec:
externalTrafficPolicy: Local
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment