• Enable access logs for an Ingress using ALB

    3 min read

    AWS Kubernetes Ingress ALB access logs

    When configuring the ALB using an Ingress object we can enable storing access logs to an S3 bucket in the same way we can do it for any ALB using terraform

    28/06/2022

    Read more...
  • Configure an AWS Load Balancer to target an Autoscaling Group using terraform

    3 min read

    Terraform AWS load balancer target auto scaling group

    It's quite convenient to be able to configure a AWS Load Balancer to target an Auto Scaling Group so we don't have to handle how instances are getting in and out of this load balancer. This can be done easily using terraform as follows

    04/05/2022

    Read more...
  • Enable access logs for an AWS ALB using terraform

    2 min read

    To be able to collect access logs it might be just more convenient to be able to enable them at the load balancer level rather than having to aggregate logs from all the backend services. If we are using an AWS ALB we can configure it to push it's logs to an S3 bucket

    29/04/2022

    Read more...
  • ArgoCD redirect loop when using a Ingress objects with HTTPS offloading

    3 min read

    When enabling an Ingress for ArgoCD we might end up with a redirect loop: ArgoCD keeps redirecting to the main page using https, even tough it is already using https:

    $ curl -I https://argocd.pet2cattle.com/
    
    HTTP/2 307 
    date: Wed, 23 Mar 2022 22:38:31 GMT
    content-type: text/html; charset=utf-8
    location: https://argocd.pet2cattle.com/
    

    This issue happens because, by default, ArgoCD expects to handle the TLS termination by itself, always redirecting HTTP requests to HTTPS. If we try to offload the TLS termination to the ingress controller, from ArgoCD's perspective the connection is HTTP, so it keeps redirecting to HTTPS

    24/03/2022

    Read more...
  • Failed build model due to couldn't auto-discover subnets: unable to discover at least one subnet

    2 min read

    Using an ALB controller we might face the following error while creating Ingress objects:

    $ kubectl describe ingress pet2cattle -n pet2cattle
    Name:             pet2cattle
    Namespace:        pet2cattle
    Address:          
    Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
    Rules:
      Host                        Path  Backends
      ----                        ----  --------
      admin-site.pet2cattle.com  
                                  /   ssl-redirect:use-annotation (<error: endpoints "ssl-redirect" not found>)
                                  /   pet2cattle:http (10.103.202.36:9000)
    Annotations:                  alb.ingress.kubernetes.io/actions.ssl-redirect:
                                    {"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}
                                  alb.ingress.kubernetes.io/group.name: pet2cattle
                                  alb.ingress.kubernetes.io/listen-ports: [{"HTTP":80},{"HTTPS":443}]
                                  alb.ingress.kubernetes.io/scheme: internal
                                  alb.ingress.kubernetes.io/target-type: ip
                                  kubernetes.io/ingress.class: alb
                                  meta.helm.sh/release-name: pet2cattle
                                  meta.helm.sh/release-namespace: pet2cattle
    
    Events:
      Type     Reason            Age                 From     Message
      ----     ------            ----                ----     -------
      Warning  FailedBuildModel  16m (x19 over 38m)  ingress  Failed build model due to couldn't auto-discover subnets: unable to discover at least one subnet
    

    This message is telling us that the ALB controller is no able to find the subnets of the requested type. We will have to check the following:

    12/07/2021

    Read more...

From pet to cattle
Treat your kubernetes clusters like cattle, not pets