Skip to content

Instantly share code, notes, and snippets.

@virtualhobbit
Created April 27, 2022 13:35
Show Gist options
  • Save virtualhobbit/bc7fc862a9fd10c7ce839cac63e0ff5f to your computer and use it in GitHub Desktop.
Save virtualhobbit/bc7fc862a9fd10c7ce839cac63e0ff5f to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment-nginx
labels:
app: nginx
namespace: nginx-test
spec:
selector:
matchLabels:
app: nginx
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: svc-nginx
labels:
app: nginx
namespace: nginx-test
spec:
type: LoadBalancer
ports:
- name: https
port: 443
targetPort: 80
protocol: TCP
selector:
app: nginx
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-nginx
labels:
app: nginx
namespace: nginx-test
spec:
tls:
- hosts:
- nginx-test.tkg.mdb-lab.com
secretName: nginx-test-tkg-mdb-lab-com
rules:
- host: nginx-test.tkg.mdb-lab.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: svc-nginx
port:
number: 443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment