### Download and install Admiralty CLI Source: https://github.com/admiraltyio/admiralty/blob/master/docs/tutorials/fargate.md Downloads and installs the Admiralty CLI v0.14.1 for the specified OS and architecture. The script sets the OS and architecture variables, downloads the binary, makes it executable, and moves it to /usr/local/bin. ```shell os=linux # or darwin (i.e., Mac OS X) or windows arch=amd64 # or arm64, ppc64le, s390x (linux only) curl -Lo admiralty "https://artifacts.admiralty.io/admiralty-v0.14.1-$os-$arch" chmod +x admiralty sudo mv admiralty /usr/local/bin ``` -------------------------------- ### Install Admiralty in each cluster with Helm Source: https://github.com/admiraltyio/admiralty/blob/master/docs/tutorials/fargate.md Adds the Admiralty Helm repository and installs Admiralty v0.14.1 in each cluster. The loop iterates over cluster names, sets the KUBECONFIG, creates the admiralty namespace, and installs the Helm chart with the account name and cluster name. ```shell helm repo add admiralty https://charts.admiralty.io helm repo update for cluster_name in "${cluster_names[@]}" do export KUBECONFIG=kubeconfig-$cluster_name kubectl create namespace admiralty helm install admiralty admiralty/admiralty \ --namespace admiralty \ --version v0.14.1 \ --set accountName=$(admiralty get-account-name) \ --set clusterName=$cluster_name done ``` -------------------------------- ### Create a Source YAML Source: https://github.com/admiraltyio/admiralty/blob/master/docs/operator_guide/scheduling.md Example Source manifest that binds the source cluster role to a user in a specific namespace. Use this to receive pods only in the namespace-a namespace. ```yaml apiVersion: multicluster.admiralty.io/v1alpha1 kind: Source metadata: name: source-cluster namespace: namespace-a spec: userName: spiffe://source-cluster/ns/namespace-a/id/default ``` -------------------------------- ### Install cert-manager with Helm Source: https://github.com/admiraltyio/admiralty/blob/master/docs/tutorials/fargate.md Installs cert-manager v0.16.1 in all clusters using Helm. The script adds the Jetstack Helm repository, creates the cert-manager namespace, applies the CRDs, and installs the chart. This is a dependency of Admiralty for managing certificates. ```shell helm repo add jetstack https://charts.jetstack.io helm repo update for cluster_name in "${cluster_names[@]}" do export KUBECONFIG=kubeconfig-$cluster_name kubectl create namespace cert-manager kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.16.1/cert-manager.crds.yaml helm install cert-manager jetstack/cert-manager \ --namespace cert-manager \ --version v0.16.1 done ``` -------------------------------- ### Install ALB ingress controller in each cluster Source: https://github.com/admiraltyio/admiralty/blob/master/docs/tutorials/fargate.md Installs the ALB ingress controller v1.1.8 in each workload cluster. The script creates an IAM policy, associates an OIDC provider, applies RBAC roles, creates an IAM service account, and deploys the controller with the cluster name, VPC ID, and region. ```shell curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v1.1.8/docs/examples/iam-policy.json policy_arn="$(aws iam create-policy \ --policy-name ALBIngressController \ --policy-document file://iam-policy.json \ --query Policy.Arn \ --output text)" for region in us-west-2 eu-west-3 do for i in 0 1 do cluster_name=$region-$i export KUBECONFIG=kubeconfig-$cluster_name eksctl utils associate-iam-oidc-provider \ --region $region \ --cluster $cluster_name \ --approve kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v1.1.8/docs/examples/rbac-role.yaml eksctl create iamserviceaccount \ --region $region \ --name alb-ingress-controller \ --namespace kube-system \ --cluster $cluster_name \ --attach-policy-arn $policy_arn \ --override-existing-serviceaccounts \ --approve vpc_id="$(eksctl get cluster \ --name=$cluster_name \ --region=$region \ --output json | jq -r .[0].ResourcesVpcConfig.VpcId)" cat <