Skip to content

AWS Specific Configuration

Ingress

Ingress configuration example for AWS Load Balancer Controller:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:xxxxx:certificate/xxxxxxx
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/security-policy: ELBSecurityPolicy-TLS13-1-2-2021-06
    alb.ingress.kubernetes.io/target-type: ip    
  name: talisman
  namespace: talisman-dev
spec:
  ingressClassName: alb
  rules:
  - host: YOUR_HOST
    http:
      paths:
      - backend:
          service:
            name: talisman
            port:
              number: 443
        path: /
        pathType: Prefix
status:
  loadBalancer:
    ingress:
    - hostname: aaaaaaaaaaa.us-west-2.elb.amazonaws.com

ECR

Amazon Elastic Container Registry can not create new repository on push automatically like all other Image Registries. More info: https://github.com/aws/containers-roadmap/issues/853

As a workaround add the foolowing code with your REGION and REGISTRY_ID in build.sh before mvn command:

output=$(aws ecr describe-repositories --region=REGION --registry-id=REGISTRY_ID --repository-names ${PROJECT_ID} 2>&1)
if [ $? -ne 0 ]; then
  if echo ${output} | grep -q RepositoryNotFoundException; then
    aws ecr create-repository --region=REGION --registry-id=REGISTRY_ID --repository-name ${PROJECT_ID}
  else
    >&2 echo ${output}
  fi
fi