Skip to content

Instantly share code, notes, and snippets.

@arellano-gustavo
Created October 25, 2022 19:02
Show Gist options
  • Save arellano-gustavo/0746191eec67eeb8d657cf2f2db4bbc1 to your computer and use it in GitHub Desktop.
Save arellano-gustavo/0746191eec67eeb8d657cf2f2db4bbc1 to your computer and use it in GitHub Desktop.
yaml file for us to deploy a simple springboot app (with 3 replicas) in microk8s and nginx as a reverse proxy (ingress balancer)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: demo-microk8s-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
tls:
- hosts:
- access.qbits.mx
secretName: hello-app-tls
rules:
- host: access.qbits.mx
http:
paths:
- path: /demo-microk8s(/|$)(.*)
pathType: Prefix
backend:
service:
name: demo-microk8s
port:
number: 8080
ingressClassName: nginx
---
kind: Service
apiVersion: v1
metadata:
name: demo-microk8s
labels:
app: demo-microk8s
spec:
type: ClusterIP
selector:
app: demo-microk8s
ports:
- port: 8080
targetPort: 8080
name: http
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo-microk8s
labels:
app: demo-microk8s
spec:
selector:
matchLabels:
octopusexport: OctopusExport
replicas: 3
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: demo-microk8s
octopusexport: OctopusExport
spec:
containers:
- name: demo-microk8s
image: gustavoarellano/microk8s-demo:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
protocol: TCP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment