Created
September 9, 2021 10:51
-
-
Save ThorstenHans/7c376842bbeebe0a5b6dd4f3c17060b3 to your computer and use it in GitHub Desktop.
Sample NGINX Pod exposed via Ingress rule
This file contains hidden or 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: v1 | |
kind: Pod | |
metadata: | |
name: webserver | |
labels: | |
app: nginx | |
name: sample | |
spec: | |
containers: | |
- name: main | |
image: nginx:alpine | |
resources: | |
limits: | |
memory: "64Mi" | |
cpu: "200m" | |
requests: | |
memory: "48Mi" | |
cpu: "100m" | |
ports: | |
- containerPort: 80 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: web | |
spec: | |
selector: | |
app: nginx | |
name: sample | |
ports: | |
- port: 8080 | |
targetPort: 80 | |
--- | |
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
name: sample-rule | |
annotations: | |
kubernetes.io/ingress.class: "nginx" | |
spec: | |
rules: | |
- host: "sample.thns.dev" | |
http: | |
paths: | |
- path: / | |
pathType: "Prefix" | |
backend: | |
service: | |
name: web | |
port: | |
number: 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment