This image shows the Kubernetes Dashboard with deployed microservices.
helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard
kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443
kubectl apply -f dashboard-adminuser.yaml
kubectl apply -f dashboard-rolebinding.yaml
kubectl apply -f secret.yml
kubectl -n kubernetes-dashboard create token admin-user
kubectl get secret admin-user -n kubernetes-dashboard -o jsonpath="{.data.token}" | base64 -d
kubectl get deployments
kubectl get services
kubectl get replicaset
kubectl get pods
kubectl describe pod <pod-name>
kubectl logs <pod-name>
kubectl get pods -o wide
Follow the steps mentioned in this link repository to create Docker images for this Kubernetes project from the Git repository: microservice-architecture-java.
kubectl apply -f configmaps.yml
To ensure services are deployed in a structured manner, the following order should be followed:
- Keycloak - Identity and access management service.
- ConfigMaps - Configuration for environment variables and other settings.
- ConfigServer - Centralized configuration management service.
- EurekaServer - Service registry for microservices.
- accountsdb - Database for microservices.
- cardsdb - Database for microservices.
- loandb - Database for microservices.
- Accounts - Microservice handling account-related operations.
- Loan - Microservice managing loan-related functionalities.
- Cards - Microservice handling card-related processes.
- Gateway - API Gateway for routing requests to services.
To deploy microservices and applications in a Kubernetes cluster, the appropriate YAML manifest files should be created and applied. Each microservice and configuration must be properly defined before deployment.
kubectl apply -f keycloak.yml
kubectl apply -f configserver.yml
kubectl apply -f eurekaserver.yml
kubectl apply -f accountsdb.yml
kubectl apply -f cardsdb.yml
kubectl apply -f loandb.yml
kubectl apply -f accounts.yml
kubectl apply -f loan.yml
kubectl apply -f cards.yml
kubectl apply -f gateway.yml
kubectl scale deployment accounts-deployment --replicas=2
Retrieves detailed information about the specified Pod and Displays its status, events, conditions, logs, and resource usage.
kubectl describe pod <pod-name>
kubectl set image deployment/<deployment-name> <container-name>=<new-image-name>:<new-image-tag>
Example:
kubectl set image deployment gatewayserver-deployment gatewayserver=akash9229/gatewayserver:v2
kubectl rollout restart deployment <deployment-name>
kubectl get deployment gatewayserver-deployment -o wide
Retrieves and displays Kubernetes events in the default namespace, sorted by creation time (oldest first), helping debug issues and track cluster activities and events.
kubectl get events -n default --sort-by=.metadata.creationTimestamp
kubectl delete pod <pod-name>
kubectl delete deployment <deployment-name>
kubectl delete service <service-name>
kubectl logs -f <pod-name>
kubectl top pod
kubectl top node
kubectl get namespaces
kubectl get all -n <namespace>
kubectl apply -f ./k8s/
kubectl exec -it <pod-name> -- /bin/sh
kubectl delete pod <pod-name> --grace-period=0 --force
kubectl config current-context
kubectl config use-context <context-name>
kubectl config get-contexts
kubectl config set-context <context-name> --cluster=<cluster-name> --user=<user-name> --namespace=<namespace-name>
kubectl config delete-context <context-name>
kubectl config delete-context <context-name>
kubectl config get-contexts
kubectl config set-cluster <cluster-name> --server=<cluster-server> --certificate-authority=<path-to-ca-cert>