aws-global-accelerator-controller

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

Test Docker GitHub release (latest by date) Renovate GitHub

AWS Global Accelerator Controller

AWS Global Accelerator Controller is a controller to manage Global Accelerator for a Kubenretes cluster. The features are

  • Create Global Accelerator for the Load Balancer which is created by Service type: LoadBalancer.
  • You can control the behavior using Service's annotations
  • Create Route53 records associated to Global Accelerator (future work)

Install

You can install this controller using helm.

$ helm repo add h3poteto-stable https://h3poteto.github.io/charts/stable
$ helm install global-accelerator-controller --namespace kube-system h3poteto-stable/aws-global-accelerator-controller
Setup IAM Policy

This controller requires these permissions, so please assign this policy to the controller pod using IRSA, kube2iam or kiam.

{
    "Statement": [
        {
            "Action": [
                "elasticloadbalancing:DescribeLoadBalancers",
                "globalaccelerator:DescribeAccelerator",
                "globalaccelerator:ListAccelerators",
                "globalaccelerator:ListTagsForResource",
                "globalaccelerator:CreateAccelerator",
                "globalaccelerator:DeleteAccelerator",
                "globalaccelerator:ListListeners",
                "globalaccelerator:CreateListener",
                "globalaccelerator:UpdateListener",
                "globalaccelerator:DeleteListener",
                "globalaccelerator:ListEndpointGroups",
                "globalaccelerator:CreateEndpointGroup",
                "globalaccelerator:UpdateEndpointGroup",
                "globalaccelerator:DeleteEndpointGroup"
            ],
            "Effect": "Allow",
            "Resource": "*"
        }
    ],
    "Version": "2012-10-17"
}

Usage

Please specify an annotation h3poteto.dev/aws-global-accelerator-enabled: "yes" to your service.

apiVersion: v1
kind: Service
metadata:
  annotations:
    h3poteto.dev/aws-global-accelerator-enabled: "yes"
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
    service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
    service.beta.kubernetes.io/aws-load-balancer-type: nlb
  name: h3poteto-test
  namespace: default
spec:
  externalTrafficPolicy: Local
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 80
  - name: https
    port: 443
    protocol: TCP
    targetPort: 443
  selector:
    app: h3poteto
  sessionAffinity: None
  type: LoadBalancer

Notice: If the service is not type: LoadBalancer, this controller does nothing.

Development

$ export KUBECONFIG=$HOME/.kube/config
$ go run ./main.go controller --v=4

License

The software is available as open source under the terms of the Apache License 2.0.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
pkg
leaderelection
https://github.com/kubernetes/client-go/blob/master/examples/leader-election/main.go
https://github.com/kubernetes/client-go/blob/master/examples/leader-election/main.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL