diff --git a/cmd/install/ack.go b/cmd/install/ack.go index 74528b1..938dd79 100644 --- a/cmd/install/ack.go +++ b/cmd/install/ack.go @@ -45,6 +45,7 @@ func init() { ack.NewAPIGatewayv2Controller, ack.NewEC2Controller, ack.NewECRController, + ack.NewEFSController, ack.NewEKSController, ack.NewIAMController, ack.NewPrometheusServiceController, diff --git a/pkg/application/ack/efs_controller.go b/pkg/application/ack/efs_controller.go new file mode 100644 index 0000000..e53c2df --- /dev/null +++ b/pkg/application/ack/efs_controller.go @@ -0,0 +1,72 @@ +package ack + +import ( + "github.com/awslabs/eksdemo/pkg/application" + "github.com/awslabs/eksdemo/pkg/cmd" + "github.com/awslabs/eksdemo/pkg/installer" + "github.com/awslabs/eksdemo/pkg/resource" + "github.com/awslabs/eksdemo/pkg/resource/irsa" + "github.com/awslabs/eksdemo/pkg/template" +) + +// Docs: https://aws-controllers-k8s.github.io/community/docs/community/overview/ +// Docs: https://aws-controllers-k8s.github.io/community/reference/ +// GitHub: https://github.com/aws-controllers-k8s/efs-controller +// Helm: https://github.com/aws-controllers-k8s/efs-controller/tree/main/helm +// Chart: https://gallery.ecr.aws/aws-controllers-k8s/efs-chart +// Repo: https://gallery.ecr.aws/aws-controllers-k8s/efs-controller +// Version: Latest is v1.0.0 (as of 9/6/24) + +func NewEFSController() *application.Application { + return &application.Application{ + Command: cmd.Command{ + Parent: "ack", + Name: "efs-controller", + Description: "ACK EFS Controller", + Aliases: []string{"efs"}, + }, + + Dependencies: []*resource.Resource{ + irsa.NewResourceWithOptions(&irsa.IrsaOptions{ + CommonOptions: resource.CommonOptions{ + Name: "ack-efs-controller-irsa", + }, + // https://github.com/aws-controllers-k8s/efs-controller/blob/main/config/iam/recommended-policy-arn + PolicyType: irsa.PolicyARNs, + Policy: []string{"arn:aws:iam::aws:policy/AmazonElasticFileSystemFullAccess"}, + }), + }, + + Options: &application.ApplicationOptions{ + Namespace: "ack-system", + ServiceAccount: "ack-efs-controller", + DefaultVersion: &application.LatestPrevious{ + LatestChart: "1.0.0", + Latest: "1.0.0", + PreviousChart: "1.0.0", + Previous: "1.0.0", + }, + }, + + Installer: &installer.HelmInstaller{ + ReleaseName: "ack-efs-controller", + RepositoryURL: "oci://public.ecr.aws/aws-controllers-k8s/efs-chart", + ValuesTemplate: &template.TextTemplate{ + Template: efsValuesTemplate, + }, + }, + } +} + +// https://github.com/aws-controllers-k8s/efs-controller/blob/main/helm/values.yaml +const efsValuesTemplate = `--- +image: + tag: {{ .Version }} +fullnameOverride: ack-efs-controller +aws: + region: {{ .Region }} +serviceAccount: + name: {{ .ServiceAccount }} + annotations: + {{ .IrsaAnnotation }} +`