Created
November 24, 2021 00:03
-
-
Save rodrigobaron/a01e20f3454902a0d2ea680d47afde15 to your computer and use it in GitHub Desktop.
Exemple of how to use ingress-nginx
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: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-app | |
labels: | |
app: hello-app | |
spec: | |
selector: | |
matchLabels: | |
app: hello-app | |
replicas: 3 | |
template: | |
metadata: | |
labels: | |
app: hello-app | |
spec: | |
containers: | |
- name: hello-app | |
image: hashicorp/http-echo | |
args: | |
- "-text=hello" | |
ports: | |
- containerPort: 5678 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-app-service | |
spec: | |
selector: | |
app: hello-app | |
ports: | |
- port: 8088 | |
targetPort: 5678 | |
type: ClusterIP | |
--- | |
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
name: hello-ingress | |
annotations: | |
kubernetes.io/ingress.class: nginx | |
spec: | |
rules: | |
- host: localhost | |
http: | |
paths: | |
- path: / | |
pathType: Prefix | |
backend: | |
service: | |
name: hello-app-service | |
port: | |
number: 8088 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment