Skip to main content

MarkLogic Server on Kubernetes

Install ALB Ingress

To install ALB Ingress, see AWS Load Balancer Controller installation.

Note

To use External DNS, see Setup External DNS.

This feature is still in alpha release and should not be used in production.

Ingress definition

When you Install ALB Ingress, the Ingresses definition will automatically create an ALB. To expose a MarkLogic cluster, deploy one Ingress per application server:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/healthcheck-port: '8002'
    alb.ingress.kubernetes.io/healthcheck-path: /
    alb.ingress.kubernetes.io/success-codes: '200-401'
    alb.ingress.kubernetes.io/load-balancer-name: ml-lb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 8001}]'
    alb.ingress.kubernetes.io/target-group-attributes: load_balancing.algorithm.type
    =least_outstanding_requests
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:XXXXXXXXXXX:
    certificate/ XXXXX-xxxx-XXXX-XXXX-XXXXxxxXXX
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/group.name: ml-lb-group
  labels:
    app.kubernetes.io/instance: ml-enode
    app.kubernetes.io/name: ml-lb
  name: ml-enode-ml-lb-admin
  namespace: ml-lb
spec:
  ingressClassName: alb
  rules:
  - http:
      paths:
      - backend:
          service:
            name: ml-enode-ml-lb
            port:
              number: 8001
        path: /
        pathType: Prefix
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/healthcheck-port: '8002'
    alb.ingress.kubernetes.io/healthcheck-path: /
    alb.ingress.kubernetes.io/success-codes: '200-401'
    alb.ingress.kubernetes.io/load-balancer-name: ml-lb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 8000}]'
    alb.ingress.kubernetes.io/target-group-attributes: load_balancing.algorithm.
    type=least_outstanding_requests
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:XXXXXXXXXXX:
    certificate/XXXXX-xxxx-XXXX-XXXX-XXXXxxxXXX
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/group.name: ml-lb-group
  labels:
    app.kubernetes.io/instance: ml-enode
    app.kubernetes.io/name: ml-lb
  name: ml-enode-ml-lb-console
  namespace: ml-lb
spec:
  ingressClassName: alb
  rules:
  - http:
      paths:
      - backend:
          service:
            name: ml-enode-ml-lb
            port:
              number: 8000
        path: /
        pathType: Prefix
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/healthcheck-port: '8002'
    alb.ingress.kubernetes.io/healthcheck-path: /
    alb.ingress.kubernetes.io/success-codes: '200-401'
    alb.ingress.kubernetes.io/load-balancer-name: ml-lb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 8002}]'
    alb.ingress.kubernetes.io/target-group-attributes: load_balancing.algorithm.
    type=least_outstanding_requests
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:XXXXXXXXXXX:
    certificate/XXXXX-xxxx-XXXX-XXXX-XXXXxxxXXX
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/group.name: ml-lb-group
  labels:
    app.kubernetes.io/instance: ml-enode
    app.kubernetes.io/name: ml-lb
  name: ml-enode-ml-lb-manage
  namespace: ml-lb
spec:
  ingressClassName: alb
  rules:
  - http:
      paths:
      - backend:
          service:
            name: ml-enode-ml-lb
            port:
              number: 8002
        path: /
        pathType: Prefix
Annotation details

Code

Description

alb.ingress.kubernetes.io/healthcheck-port

Specifies the port on which to perform the health check. See https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/#healthcheck-port.

alb.ingress.kubernetes.io/healthcheck-path

Specifies the path used for the health check.

See https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/#healthcheck-path.

alb.ingress.kubernetes.io/success-codes

Specifies the HTTP status code that is expected during health checks against the specified health check path.

The 401 code is included because authentication is needed on the port.

See https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/ingress/annotations/#success-codes.

alb.ingress.kubernetes.io/load-balancer-name: ml-lb

Specifies the prefix for the name of the ALB. Note that name impacts the entire IngressGroup.

See https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/#load-balancer-name.

alb.ingress.kubernetes.io/scheme: internet-facing

Specifies the scheme. Because MarkLogic app-servers should be exposed from outside of the cluster and outside of the cloud, this is set it to internet-facing. See https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/#scheme.

alb.ingress.kubernetes.io/listen-ports

Specifies the listening port for each Ingress. The syntax is : <protocol>:<port>.

Protocol can only be HTTP or HTTPS see Application Load Balancer (ALB) Ingress only for the limitations.

See https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/#listen-ports.

alb.ingress.kubernetes.io/target-group-attributes

Specifies the target group attributes as the load balancing algorithm.

alb.ingress.kubernetes.io/certificate-arn

Specifes the certificates to be used (HTTPS termination on the ALB should be enabled).

See https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/#certificate-arn.

alb.ingress.kubernetes.io/target-type

Specifies the target type. The target type can be instance or ip.

Instance type is only available if the target service is type NodePort.

See https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/#target-type.

alb.ingress.kubernetes.io/group.name

Specifies the group name for the ALB. This allows several Ingresses to use the same ALB.

group.name and load.balancer.name have to be the same in the same IngressGroup.

See https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/ingress/annotations/#group.name.

For additional annotations, see the complete list.

Ingress class name

Specifying the ingressClass is recommended, especially with multiple Ingress controllers. Adding alb ensures that the Ingress will be managed by the ALB Ingress Controller:

spec:  
    ingressClassName: alb