Created
October 25, 2022 19:02
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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