Mender k8s install on AWS

Here are the serial annoyances I experienced, and formula I used, for getting Mender 3.4.0 running on a Kubernetes instance on AWS.

I used eksctl to create a cluster on AWS. Then I followed the instructions at Setting up the LB controller :: Amazon EKS Workshop for installing the aws-load-balancer-controller, which is necessary for allowing an AWS application load balancer to be instanced from within k8s.

From there, I followed the instructions at Production installation with Kubernetes | Mender documentation until it came time to create the mender ingress.

Then I created a certificate using AWS Certificate Manager to apply to the Mender subdomain I was hosting. The application load balancer will need to reference that certificate during its construction.

Here is the yaml file I used to create an ingress compatible with Mender, replacing aws-account-number and certificate-uuid accordingly:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: mender-ingress
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:[aws-account-number]:certificate/[aws-certificate-uuid]
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80},{"HTTPS":443}]'
    alb.ingress.kubernetes.io/ssl-redirect: '443'
    alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
spec:
  ingressClassName: alb
  rules:
  - host: mender.[yourhostingdomain].com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: mender-api-gateway
            port:
              number: 80

Use

kubectl apply -f the-above-yaml-file

to create the Mender ingress on AWS.

Hope this helps save some time for others trying to get Mender running on AWS and k8s.

1 Like