12 - Ingress Rules

Updated 1 month ago by Michael Cretzman

For Ingress Rules, you simply add your Kubernetes service and Ingress manifests to your Harness Service, and then refer to the Service name in the Ingress manifest. In the following manifests, you can see the Service name my-svc referred to in the Ingress manifest.

Service manifest:

apiVersion: v1
kind: Service
metadata:
name: my-svc
spec:
ports:
- name: my-port
port: 8080
protocol: TCP
targetPort: my-container-port
selector:
app: my-deployment
type: ClusterIP

Ingress manifest:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- http:
paths:
- path: /my/path
backend:
serviceName: my-svc
servicePort: 8080

Using the values.yaml file and Go templating, you would simply add the service name and any other key values to the values.yaml file and then replace them in both manifests with the variable. For examples of using Go templating, see Go Templating and Harness Variables.

Next Steps


How did we do?