-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapply.sh
executable file
·47 lines (40 loc) · 1.35 KB
/
apply.sh
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
#!/bin/bash
build-jenkins() {
cd jenkins
docker build -t custom-jenkins .
cd ..
}
apply-terraform(){
terraform init
terraform apply -auto-approve
}
kubectl-setup(){
cp ~/.kube/config /tmp/config-before
terraform output kubeconfig > ~/.kube/config
cp ~/.kube/config /tmp/config-terraform
aws eks --region us-east-1 update-kubeconfig --name simple-eks
cp ~/.kube/config /tmp/config-eks
terraform output config-map-aws-auth > /tmp/x.yml
kubectl apply -f /tmp/x.yml
rm /tmp/x.yml
}
start-jenkins(){
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 576962245852.dkr.ecr.us-east-1.amazonaws.com
docker tag custom-jenkins:latest 576962245852.dkr.ecr.us-east-1.amazonaws.com/custom-jenkins:latest
docker push 576962245852.dkr.ecr.us-east-1.amazonaws.com/custom-jenkins:latest
kubectl apply -f jenkins/jenkins-deployment.yml
kubectl apply -f jenkins/jenkins-service.yml
}
kafka-setup(){
kubectl apply -f kafka/zookeeper.yml
kubectl apply -f kafka/kafka-broker1.yml
kubectl apply -f kafka/kafka-service.yml
#KAHN=$(kubectl describe svc kafka | grep "LoadBalancer Ingress" | awk -F ": " '{print $2}')
#echo "$KAHN"
#kubectl create configmap kafka-config --from-literal=kahn=
}
build-jenkins
apply-terraform
kubectl-setup
start-jenkins
kafka-setup