The k8s folder contains scripts and configurations for deploying and managing Kubernetes resources for the project. Below is an overview of the contents and their purposes:
jenkins-deployment.yaml: Deployment configuration for Jenkins.api-gateway-hpa.yaml: Horizontal Pod Autoscaler configuration for the API Gateway.setup_k8s.py: Script for setting up Kubernetes resources including Jenkins, Istio, and Horizontal Pod Autoscaler.k8s_management.py: Script for managing Kubernetes resources and configurations, including monitoring and predictive scaling.springboot_generator.py: Script for generating Spring Boot project structure with Kubernetes configurations.terraform/py_generate_tr.py: Script for generating Terraform configuration files.setup_google_pay_spring_lambda.py: Script for setting up backend Spring Boot application with Kafka integration.initial_scripts_for_project.py: Script to automate the creation of necessary YAML files and provides instructions for manual tasks.
To install Istio, use the Istio CLI or Helm chart. For example, using Istioctl:
$ istioctl install --set profile=default -yEnable Istio injection for the default namespace:
$ kubectl label namespace default istio-injection=enabledTo configure TLS/SSL for all services, ensure your Ingress or Gateway resources are configured with TLS certificates. You may use cert-manager for automatic certificate provisioning:
kubectl create namespace cert-manager
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=trueRun the initial_scripts_for_project.py script to generate the YAML files for Jenkins deployment and API Gateway Horizontal Pod Autoscaler:
python initial_scripts_for_project.pyThis will generate the following files:
jenkins-deployment.yamlapi-gateway-hpa.yaml
These files can then be applied to your Kubernetes cluster using kubectl apply -f <file>.
kubectl apply -f jenkins-deployment.yaml
kubectl apply -f api-gateway-hpa.yamlRun the setup_k8s.py script for additional setup:
python setup_k8s.pyRun with advanced options:
python k8s_management.py --install-istio --setup-jenkins --setup-monitoringThe scripts in the k8s folder provide a starting point for setting up CI/CD pipelines and managing scalability in your Kubernetes cluster. Follow the instructions for manual tasks and use the generated YAML files to automate deployments.
For more information on the tools and concepts mentioned in this README, refer to the following resources: