Submission 3: Proyek Implementasi Asynchronous Communication pada Aplikasi E-Commerce App
🌟🌟🌟🌟🌟
Menambahkan submodule​
git submodule add -b order-service https://github.com/lyrihkaesa/a433-microservices.git order-service
git submodule add -b shipping-service https://github.com/lyrihkaesa/a433-microservices.git shipping-service
Reset minikube
dan pemasangan istio
​
minikube stop
minikube delete
minikube start
istioctl install --set profile=demo -y
kubectl create namespace ecommerce
kubectl label namespace ecommerce istio-injection=enabled
atau default
kubectl label namespace default istio-injection=enabled
Menambahkan RabbitMQ ke Kubernetes dengan helm
​
Menambahkan repo ke helm
helm repo add bitnami https://charts.bitnami.com/bitnami
Jangan lupa perbarui repo
helm repo update
Cek repo-nya sudah ada belum:
helm repo list
Pasang RabbitMQ dengan namespace ecommerce:
helm install rabbit --set service.type=NodePort bitnami/rabbitmq --namespace ecommerce
username dari RabbitMQ adalah user
Dapatkan password RabbitMQ dengan perintah berikut:
echo $(kubectl get secret --namespace ecommerce rabbit-rabbitmq -o jsonpath="{.data.rabbitmq-password}" | base64 -d)
Membuat object kubernetes:
kubectl apply -f kubernetes/shipping/shipping-service.yaml -n ecommerce
kubectl apply -f kubernetes/shipping/shipping-deployment.yaml -n ecommerce
kubectl apply -f kubernetes/order/order-service.yaml -n ecommerce
kubectl apply -f kubernetes/order/order-deployment.yaml -n ecommerce
kubectl get all -n ecommerce
kubectl get all -n ecommerce -o wide
Menambahkan istio
​
kubectl apply -f kubernetes/istio/ecommerce-gateway.yaml -n ecommerce
export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}')
echo "$INGRESS_HOST" "$INGRESS_PORT" "$SECURE_INGRESS_PORT"
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
echo "http://$GATEWAY_URL/order"
kubectl get statefulset.apps/rabbit-rabbitmq -o yaml -n ecommerce
minikube tunnel
POST
http:127.0.0.1/order dengan body:
{
   "order": {
     "book_name": "Harry Potter",
     "author": "J.K Rowling",