From 022f44dcc6d8ad131c0fdf70c883fe745c5f34a7 Mon Sep 17 00:00:00 2001 From: Aaron Miller <1521726+aaroniscode@users.noreply.github.com> Date: Sun, 8 Sep 2024 17:26:49 -0700 Subject: [PATCH] remove: `appmesh-controller` (#248) --- README.md | 1 - cmd/install/install.go | 2 - cmd/install/uninstall.go | 2 - .../appmesh_controller/appmesh_controller.go | 150 ------------------ 4 files changed, 155 deletions(-) delete mode 100644 pkg/application/appmesh_controller/appmesh_controller.go diff --git a/README.md b/README.md index 81e33b0..b69d4ee 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,6 @@ The application catalog includes: * `prometheusservice-controller` — ACK Prometheus Service Controller * `s3-controller` — ACK S3 Controller * `adot-operator` — AWS Distro for OpenTelemetry (ADOT) Operator -* `appmesh-controller` — AWS App Mesh Controller * `argo` — Get stuff done with Kubernetes! * `cd` — Declarative continuous deployment for Kubernetes * `workflows` — Workflow engine for Kubernetes diff --git a/cmd/install/install.go b/cmd/install/install.go index 5ae16ae..fa155b5 100644 --- a/cmd/install/install.go +++ b/cmd/install/install.go @@ -3,7 +3,6 @@ package install import ( "github.com/awslabs/eksdemo/pkg/application" "github.com/awslabs/eksdemo/pkg/application/adot" - "github.com/awslabs/eksdemo/pkg/application/appmesh_controller" "github.com/awslabs/eksdemo/pkg/application/argo/argo_cd" "github.com/awslabs/eksdemo/pkg/application/autoscaling/cluster_autoscaler" awslbc "github.com/awslabs/eksdemo/pkg/application/aws/lbc" @@ -44,7 +43,6 @@ func NewInstallCmd() *cobra.Command { cmd.AddCommand(NewInstallAckCmd()) cmd.AddCommand(NewInstallAliasCmds(ackControllers, "ack-")...) cmd.AddCommand(adot.NewApp().NewInstallCmd()) - cmd.AddCommand(appmesh_controller.NewApp().NewInstallCmd()) cmd.AddCommand(NewInstallArgoCmd()) cmd.AddCommand(NewInstallAliasCmds(argoApps, "argo-")...) cmd.AddCommand(NewInstallAutoscalingCmd()) diff --git a/cmd/install/uninstall.go b/cmd/install/uninstall.go index b5455f0..0719369 100644 --- a/cmd/install/uninstall.go +++ b/cmd/install/uninstall.go @@ -3,7 +3,6 @@ package install import ( "github.com/awslabs/eksdemo/pkg/application" "github.com/awslabs/eksdemo/pkg/application/adot" - "github.com/awslabs/eksdemo/pkg/application/appmesh_controller" "github.com/awslabs/eksdemo/pkg/application/argo/argo_cd" "github.com/awslabs/eksdemo/pkg/application/autoscaling/cluster_autoscaler" awslbc "github.com/awslabs/eksdemo/pkg/application/aws/lbc" @@ -44,7 +43,6 @@ func NewUninstallCmd() *cobra.Command { cmd.AddCommand(NewUninstallAckCmd()) cmd.AddCommand(NewUninstallAliasCmds(ackControllers, "ack-")...) cmd.AddCommand(adot.NewApp().NewUninstallCmd()) - cmd.AddCommand(appmesh_controller.NewApp().NewUninstallCmd()) cmd.AddCommand(NewUninstallArgoCmd()) cmd.AddCommand(NewUninstallAliasCmds(argoApps, "argo-")...) cmd.AddCommand(NewUninstallAutoscalingCmd()) diff --git a/pkg/application/appmesh_controller/appmesh_controller.go b/pkg/application/appmesh_controller/appmesh_controller.go deleted file mode 100644 index 8173272..0000000 --- a/pkg/application/appmesh_controller/appmesh_controller.go +++ /dev/null @@ -1,150 +0,0 @@ -package appmesh_controller - -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://docs.aws.amazon.com/app-mesh/latest/userguide/ -// Docs: https://aws.github.io/aws-app-mesh-controller-for-k8s/ -// GitHub: https://github.com/aws/aws-app-mesh-controller-for-k8s -// Helm: https://github.com/aws/aws-app-mesh-controller-for-k8s/tree/master/config/helm/appmesh-controller -// Repo: 840364872350.dkr.ecr.us-west-2.amazonaws.com/amazon/appmesh-controller -// Version: Latest is v1.12.1 (as of 6/19/23) - -func NewApp() *application.Application { - app := &application.Application{ - Command: cmd.Command{ - Name: "appmesh-controller", - Description: "AWS App Mesh Controller", - Aliases: []string{"appmesh", "app-mesh"}, - }, - - Dependencies: []*resource.Resource{ - irsa.NewResourceWithOptions(&irsa.IrsaOptions{ - CommonOptions: resource.CommonOptions{ - Name: "appmesh-controller-irsa", - }, - PolicyType: irsa.PolicyDocument, - PolicyDocTemplate: &template.TextTemplate{ - Template: policyDocument, - }, - }), - }, - - Options: &application.ApplicationOptions{ - Namespace: "appmesh-system", - ServiceAccount: "appmesh-controller", - DefaultVersion: &application.LatestPrevious{ - LatestChart: "1.12.1", - Latest: "v1.12.1", - PreviousChart: "1.7.0", - Previous: "v1.7.0", - }, - }, - - Installer: &installer.HelmInstaller{ - ChartName: "appmesh-controller", - ReleaseName: "appmesh-controller", - RepositoryURL: "https://aws.github.io/eks-charts", - ValuesTemplate: &template.TextTemplate{ - Template: valuesTemplate, - }, - }, - } - return app -} - -const valuesTemplate = `--- -region: {{ .Region }} -accountId: {{ .Account }} -serviceAccount: - annotations: - {{ .IrsaAnnotation }} - name: {{ .ServiceAccount }} -image: - tag: {{ .Version }} -` - -// https://github.com/aws/aws-app-mesh-controller-for-k8s/blob/master/config/iam/controller-iam-policy.json -const policyDocument = ` -Version: '2012-10-17' -Statement: -- Effect: Allow - Action: - - appmesh:ListVirtualRouters - - appmesh:ListVirtualServices - - appmesh:ListRoutes - - appmesh:ListGatewayRoutes - - appmesh:ListMeshes - - appmesh:ListVirtualNodes - - appmesh:ListVirtualGateways - - appmesh:DescribeMesh - - appmesh:DescribeVirtualRouter - - appmesh:DescribeRoute - - appmesh:DescribeVirtualNode - - appmesh:DescribeVirtualGateway - - appmesh:DescribeGatewayRoute - - appmesh:DescribeVirtualService - - appmesh:CreateMesh - - appmesh:CreateVirtualRouter - - appmesh:CreateVirtualGateway - - appmesh:CreateVirtualService - - appmesh:CreateGatewayRoute - - appmesh:CreateRoute - - appmesh:CreateVirtualNode - - appmesh:UpdateMesh - - appmesh:UpdateRoute - - appmesh:UpdateVirtualGateway - - appmesh:UpdateVirtualRouter - - appmesh:UpdateGatewayRoute - - appmesh:UpdateVirtualService - - appmesh:UpdateVirtualNode - - appmesh:DeleteMesh - - appmesh:DeleteRoute - - appmesh:DeleteVirtualRouter - - appmesh:DeleteGatewayRoute - - appmesh:DeleteVirtualService - - appmesh:DeleteVirtualNode - - appmesh:DeleteVirtualGateway - Resource: "*" -- Effect: Allow - Action: - - iam:CreateServiceLinkedRole - Resource: arn:aws:iam::*:role/aws-service-role/appmesh.amazonaws.com/AWSServiceRoleForAppMesh - Condition: - StringLike: - iam:AWSServiceName: - - appmesh.amazonaws.com -- Effect: Allow - Action: - - acm:ListCertificates - - acm:DescribeCertificate - - acm-pca:DescribeCertificateAuthority - - acm-pca:ListCertificateAuthorities - Resource: "*" -- Effect: Allow - Action: - - servicediscovery:CreateService - - servicediscovery:DeleteService - - servicediscovery:GetService - - servicediscovery:GetInstance - - servicediscovery:RegisterInstance - - servicediscovery:DeregisterInstance - - servicediscovery:ListInstances - - servicediscovery:ListNamespaces - - servicediscovery:ListServices - - servicediscovery:GetInstancesHealthStatus - - servicediscovery:UpdateInstanceCustomHealthStatus - - servicediscovery:GetOperation - - route53:GetHealthCheck - - route53:CreateHealthCheck - - route53:UpdateHealthCheck - - route53:ChangeResourceRecordSets - - route53:DeleteHealthCheck - Resource: "*" -`