forked from aws-samples/bedrock-access-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (45 loc) · 1.92 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.PHONY: default cluster pod-identity-agent load-balancer-controller gw-pod-identity load-balancer-controller build deploy dev ingress compose-up compose-down
# Default target: run default steps
default: build deploy
cluster:
@echo "\n========== Creating cluster... =========="
eksctl deployment/k8s/create cluster.yaml
iam: pod-identity-agent gw-pod-identity
pod-identity-agent:
@echo "Prequisits...."
eksctl create addon --cluster br-gw-demo --name eks-pod-identity-agent
gw-pod-identity:
@echo "\n========== Configuring EKS Pod Identity for the gateway =========="
eksctl create podidentityassociation \
--cluster br-gw-demo \
--namespace bedrock-proxy-api \
--service-account-name bedrock-proxy-api \
--permission-policy-arns="arn:aws:iam::aws:policy/AmazonBedrockFullAccess"
load-balancer-controller:
@echo "\n========== Setting up Load Balancer Controller... =========="
eksctl create podidentityassociation \
--cluster br-gw-demo \
--namespace kube-system \
--service-account-name aws-load-balancer-controller \
--well-known-policies="awsLoadBalancerController"
helm repo add eks https://aws.github.io/eks-charts
helm install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName=br-gw-demo
# Build target: build image and push to ECR
build:
@echo "\n========== Building and push the image to ECR... =========="
@cd scripts && ./push-to-ecr.sh
# Run target: deploy manifest to k8s
deploy:
@echo "\n========== Deploying manifest to k8s... =========="
kubectl apply -f deployment/k8s/manifest.yaml
ingress:
@echo "\n========== Deploying ingress... =========="
kubectl apply -f deployment/k8s/ingress.yaml
# Local development
dev: compose-up
compose-up:
@echo "\n========== Launching the Bedrock proxy api locally... =========="
docker-compose up
compose-down:
@echo "\n========== Destroying the Bedrock proxy api locally... =========="
docker-compose down