forked from DEVOPS-WITH-WEB-DEV/springboot-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install.txt
75 lines (38 loc) · 1.67 KB
/
Install.txt
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
1. Launch an instance from an Amazon Linux 2 or Amazon Linux AMI.
2. Connect to your instance.
3. Update the packages and package caches you have installed on your instance.
`
yum update -y
4. Install the latest Docker Engine packages.
Amazon Linux 2 amazon-linux-extras install
docker yum install docker -y
5. Start the Docker service.
systemctl start docker
systemctl enable docker
6. Install Conntrack:
yum install conntrack -y
7. Install k8
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
8. Start Minikube
/usr/local/bin/minikube start --force --driver=docker
/usr/local/bin/minikube version
9. Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
/usr/local/bin/kubectl version
10. Make the DB up
11.yum install maven -y
12. Create the docker image
docker build -t praveensingam1994/springboot-crud-k8s:1.0 .
13. docker login
14. /usr/local/bin/kubectl apply -f app-deployment.yaml
15. /usr/local/bin/kubectl get svc
16. /usr/local/bin/minikube ip
17. http://<minikubeIP>:31125/orders
18. PUT PORT FORWARD
/usr/local/bin/kubectl port-forward --address 0.0.0.0 svc/springboot-crud-svc 8080:8080 &
[HOST PORT TO CONTAINER PORT
kubectl port-forward --address 0.0.0.0 svc/{your service name} {external port to the Internet}:{your service port, the port your app is listening on in it's container}
for example, if my service is named badstore and is listening on 80
kubectl port-forward --address 0.0.0.0 svc/badstore 8888:80