From 9edb9edfd1d80bf0e3ae7d688107d3e629fe745a Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 18 Aug 2022 21:12:57 -0500 Subject: [PATCH] add ingress examples --- CKA_Course/ingress.yaml | 15 +++++++++++++++ CKA_Course/ingress_named_port.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 CKA_Course/ingress.yaml create mode 100644 CKA_Course/ingress_named_port.yaml diff --git a/CKA_Course/ingress.yaml b/CKA_Course/ingress.yaml new file mode 100644 index 0000000..142dd1d --- /dev/null +++ b/CKA_Course/ingress.yaml @@ -0,0 +1,15 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: my-ingress +spec: + rules: + - http: + paths: + - path: /somepath + pathType: Prefix + backend: + service: + name: my-service + port: + number: 80 diff --git a/CKA_Course/ingress_named_port.yaml b/CKA_Course/ingress_named_port.yaml new file mode 100644 index 0000000..5345599 --- /dev/null +++ b/CKA_Course/ingress_named_port.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: Service +metadata: + name: my-service +spec: + selector: + app: MyApp + ports: + - name: web + protocol: TCP + port: 80 + targetPort: 8080 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: my-ingress +spec: + rules: + - http: + paths: + - path: /somepath + pathType: Prefix + backend: + service: + name: my-service + port: + name: web