├── .gitignore ├── others └── code │ └── springboot-kubernetes │ ├── 01-helloworld-service │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stacksimplify │ │ │ │ └── helloworld │ │ │ │ ├── HelloworldApplication.java │ │ │ │ ├── serverinfo │ │ │ │ └── ServerInformationService.java │ │ │ │ └── HelloWorldController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── stacksimplify │ │ │ └── helloworld │ │ │ └── HelloworldApplicationTests.java │ ├── Dockerfile │ ├── .DS_Store │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ └── .gitignore │ ├── 02-usermanagement-service │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ ├── jwt.jks │ │ │ │ ├── .DS_Store │ │ │ │ ├── Fonts │ │ │ │ │ ├── Arial.ttf │ │ │ │ │ ├── Arial Bold.ttf │ │ │ │ │ ├── Arial Italic.ttf │ │ │ │ │ └── Arial Bold Italic.ttf │ │ │ │ ├── static │ │ │ │ │ ├── error404.html │ │ │ │ │ ├── error403.html │ │ │ │ │ └── error500.html │ │ │ │ └── application-h2.properties │ │ │ ├── .DS_Store │ │ │ └── java │ │ │ │ ├── .DS_Store │ │ │ │ └── com │ │ │ │ ├── .DS_Store │ │ │ │ └── stacksimplify │ │ │ │ └── restservices │ │ │ │ ├── .DS_Store │ │ │ │ ├── configuration │ │ │ │ ├── RecordNotFoundException.java │ │ │ │ ├── ThreadPoolConfiguration.java │ │ │ │ └── CorsFilter.java │ │ │ │ ├── authorizationserver │ │ │ │ └── users │ │ │ │ │ ├── controllers │ │ │ │ │ ├── ApplicationStatusController.java │ │ │ │ │ └── HelloWorldController.java │ │ │ │ │ ├── dtos │ │ │ │ │ ├── NoticationModel.java │ │ │ │ │ ├── EmailMessage.java │ │ │ │ │ └── UserModel.java │ │ │ │ │ ├── entities │ │ │ │ │ └── SimpleMessage.java │ │ │ │ │ ├── repositories │ │ │ │ │ └── UserRepository.java │ │ │ │ │ └── services │ │ │ │ │ └── UserService.java │ │ │ │ ├── UserManagementApplication.java │ │ │ │ └── xray │ │ │ │ ├── XRayInspector.java │ │ │ │ └── AwsXrayConfig.java │ │ ├── .DS_Store │ │ └── test │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── com │ │ │ └── stacksimplify │ │ │ └── restservices │ │ │ └── UserManagementApplicationTests.java │ ├── bin │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ ├── application.properties │ │ │ │ │ ├── jwt.jks │ │ │ │ │ ├── .DS_Store │ │ │ │ │ ├── Fonts │ │ │ │ │ │ ├── Arial.ttf │ │ │ │ │ │ ├── Arial Bold.ttf │ │ │ │ │ │ ├── Arial Italic.ttf │ │ │ │ │ │ └── Arial Bold Italic.ttf │ │ │ │ │ ├── static │ │ │ │ │ │ ├── error404.html │ │ │ │ │ │ ├── error403.html │ │ │ │ │ │ └── error500.html │ │ │ │ │ └── application-h2.properties │ │ │ │ ├── .DS_Store │ │ │ │ └── java │ │ │ │ │ ├── .DS_Store │ │ │ │ │ └── com │ │ │ │ │ ├── .DS_Store │ │ │ │ │ └── stacksimplify │ │ │ │ │ └── restservices │ │ │ │ │ ├── .DS_Store │ │ │ │ │ ├── configuration │ │ │ │ │ ├── ApiError.class │ │ │ │ │ ├── CorsFilter.class │ │ │ │ │ ├── ApiError$ApiSubError.class │ │ │ │ │ ├── RestExceptionHandler.class │ │ │ │ │ ├── RecordNotFoundException.class │ │ │ │ │ ├── ThreadPoolConfiguration.class │ │ │ │ │ ├── ApiError$ApiValidationError.class │ │ │ │ │ └── LowerCaseClassNameResolver.class │ │ │ │ │ ├── UserManagementApplication.class │ │ │ │ │ └── authorizationserver │ │ │ │ │ ├── users │ │ │ │ │ ├── entities │ │ │ │ │ │ ├── User.class │ │ │ │ │ │ └── SimpleMessage.class │ │ │ │ │ ├── dtos │ │ │ │ │ │ └── UserModel.class │ │ │ │ │ ├── services │ │ │ │ │ │ └── UserService.class │ │ │ │ │ ├── controllers │ │ │ │ │ │ ├── UserController.class │ │ │ │ │ │ ├── AdminUserController.class │ │ │ │ │ │ ├── HelloWorldController.class │ │ │ │ │ │ └── ApplicationStatusController.class │ │ │ │ │ └── repositories │ │ │ │ │ │ └── UserRepository.class │ │ │ │ │ └── configuration │ │ │ │ │ ├── AuthorizationServerConfig.class │ │ │ │ │ └── AuthorizationServerAuthConfig.class │ │ │ ├── .DS_Store │ │ │ └── test │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stacksimplify │ │ │ │ └── restservices │ │ │ │ └── UserManagementApplicationTests.class │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── maven-wrapper.properties │ │ │ │ └── maven-wrapper.jar │ │ ├── .DS_Store │ │ ├── .gitignore │ │ └── buildspec.yml │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ ├── .DS_Store │ ├── Dockerfile │ ├── .gitignore │ └── README.md │ ├── .DS_Store │ └── 03-notifications-service │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.properties │ │ └── maven-wrapper.jar │ ├── .DS_Store │ ├── src │ ├── .DS_Store │ ├── main │ │ ├── .DS_Store │ │ ├── java │ │ │ ├── .DS_Store │ │ │ └── com │ │ │ │ ├── .DS_Store │ │ │ │ └── stacksimplify │ │ │ │ └── notifications │ │ │ │ ├── core │ │ │ │ ├── services │ │ │ │ │ └── NotificationService.java │ │ │ │ └── dtos │ │ │ │ │ └── EmailMessage.java │ │ │ │ ├── NotificationsApplication.java │ │ │ │ ├── configurations │ │ │ │ ├── ThreadPoolConfiguration.java │ │ │ │ ├── CorsFilter.java │ │ │ │ └── MailConfig.java │ │ │ │ ├── xray │ │ │ │ ├── XRayInspector.java │ │ │ │ └── AwsXrayConfig.java │ │ │ │ └── entities │ │ │ │ └── HelloMessage.java │ │ └── resources │ │ │ ├── .DS_Store │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── com │ │ └── stacksimplify │ │ └── notifications │ │ └── NotificationsApplicationTests.java │ ├── Dockerfile │ ├── .gitignore │ └── README.md ├── 11-DevOps-with-AWS-Developer-Tools └── Application-Manifests │ ├── Dockerfile │ ├── app1 │ └── index.html │ └── kube-manifests │ ├── 01-DEVOPS-Nginx-Deployment.yml │ └── 02-DEVOPS-Nginx-NodePortService.yml ├── 10-ECR-Elastic-Container-Registry-and-EKS ├── 01-aws-ecr-kubenginx │ ├── Dockerfile │ └── index.html └── 02-kube-manifests │ ├── 02-ECR-Nginx-NodePortService.yml │ └── 01-ECR-Nginx-Deployment.yml ├── presentation ├── .DS_Store └── AWS-Fargate-and-EKS-Masterclass.pptx ├── 09-EKS-Workloads-on-Fargate ├── 09-01-Fargate-Profile-Basic │ └── kube-manifests │ │ ├── 01-namespace.yml │ │ └── 02-Nginx-App1-Deployment-and-NodePortService.yml ├── .DS_Store ├── 09-02-Fargate-Profiles-Advanced-YAML │ └── kube-manifests │ │ ├── 02-Applications │ │ ├── 03-ns-ums │ │ │ ├── 01-namespace.yml │ │ │ ├── 04-Kubernetes-Secrets.yml │ │ │ ├── 02-MySQL-externalName-Service.yml │ │ │ └── 05-UserManagement-NodePort-Service.yml │ │ ├── 02-ns-app2 │ │ │ ├── 01-namespace.yml │ │ │ └── 02-Nginx-App2-Deployment-and-NodePortService.yml │ │ └── 01-ns-app1 │ │ │ ├── 01-namespace.yml │ │ │ └── 02-Nginx-App1-Deployment-and-NodePortService.yml │ │ └── 01-Fargate-Advanced-Profiles │ │ └── 01-fargate-profiles.yml └── README.md ├── 02-Docker-Fundamentals └── README.md ├── 03-Kubernetes-Fundamentals └── README.md ├── 06-EKS-Storage-with-RDS-Database └── kube-manifests │ ├── 04-Kubernetes-Secrets.yml │ ├── 01-MySQL-externalName-Service.yml │ ├── 03-UserManagement-Service.yml │ └── 02-UserManagementMicroservice-Deployment-Service.yml ├── 07-ELB-Classic-and-Network-LoadBalancers ├── README.md ├── 07-02-Classic-LoadBalancer-CLB │ ├── kube-manifests │ │ ├── 03-Kubernetes-Secrets.yml │ │ ├── 01-MySQL-externalName-Service.yml │ │ ├── 04-ClassicLoadBalancer.yml │ │ └── 02-UserManagementMicroservice-Deployment-Service.yml │ └── README.md └── 07-03-Network-LoadBalancer-NLB │ ├── kube-manifests │ ├── 03-Kubernetes-Secrets.yml │ ├── 01-MySQL-externalName-Service.yml │ ├── 04-NetworkLoadBalancer.yml │ └── 02-UserManagementMicroservice-Deployment-Service.yml │ └── README.md ├── 08-ELB-Application-LoadBalancers ├── 08-02-ALB-Ingress-Basics │ └── kube-manifests │ │ ├── 03-Kubernetes-Secrets.yml │ │ ├── 01-MySQL-externalName-Service.yml │ │ ├── 04-UserManagement-NodePort-Service.yml │ │ ├── 05-ALB-Ingress-Basic.yml │ │ └── 02-UserManagementMicroservice-Deployment-Service.yml ├── 08-04-ALB-Ingress-SSL │ └── kube-manifests │ │ ├── 03-Kubernetes-Secrets.yml │ │ ├── 01-MySQL-externalName-Service.yml │ │ ├── 04-UserManagement-NodePort-Service.yml │ │ ├── 05-Nginx-App1-Deployment-and-NodePortService.yml │ │ ├── 06-Nginx-App2-Deployment-and-NodePortService.yml │ │ └── 02-UserManagementMicroservice-Deployment-Service.yml ├── 08-05-ALB-Ingress-SSL-Redirect │ └── kube-manifests │ │ ├── 03-Kubernetes-Secrets.yml │ │ ├── 01-MySQL-externalName-Service.yml │ │ ├── 04-UserManagement-NodePort-Service.yml │ │ ├── 05-Nginx-App1-Deployment-and-NodePortService.yml │ │ ├── 06-Nginx-App2-Deployment-and-NodePortService.yml │ │ └── 02-UserManagementMicroservice-Deployment-Service.yml ├── 08-03-ALB-Ingress-ContextPath-Based-Routing │ └── kube-manifests │ │ ├── 03-Kubernetes-Secrets.yml │ │ ├── 01-MySQL-externalName-Service.yml │ │ ├── 04-UserManagement-NodePort-Service.yml │ │ ├── 06-Nginx-App2-Deployment-and-NodePortService.yml │ │ ├── 05-Nginx-App1-Deployment-and-NodePortService.yml │ │ ├── 07-ALB-Ingress-ContextPath-Based-Routing.yml │ │ └── 02-UserManagementMicroservice-Deployment-Service.yml ├── 08-06-ALB-Ingress-ExternalDNS │ ├── 08-06-02-Use-ExternalDNS-for-Apps │ │ └── kube-manifests │ │ │ ├── 03-Kubernetes-Secrets.yml │ │ │ ├── 01-MySQL-externalName-Service.yml │ │ │ ├── 04-UserManagement-NodePort-Service.yml │ │ │ ├── 06-Nginx-App2-Deployment-and-NodePortService.yml │ │ │ ├── 05-Nginx-App1-Deployment-and-NodePortService.yml │ │ │ └── 02-UserManagementMicroservice-Deployment-Service.yml │ └── README.md ├── README.md └── 08-01-ALB-Ingress-Install │ └── ALBIngress-rbac-role.yml ├── 12-Microservices-Deployment-on-EKS └── kube-manifests │ ├── 01-MySQL-externalName-Service.yml │ ├── 05-NotificationMicroservice-SMTP-externalName-Service.yml │ ├── 06-NotificationMicroservice-ClusterIP-Service.yml │ ├── 03-UserManagement-NodePort-Service.yml │ └── 04-NotificationMicroservice-Deployment.yml ├── 14-Microservices-Canary-Deployments └── kube-manifests │ ├── 01-MySQL-externalName-Service.yml │ ├── 05-NotificationMicroservice-SMTP-externalName-Service.yml │ ├── 06-NotificationMicroservice-ClusterIP-Service.yml │ ├── 03-UserManagement-NodePort-Service.yml │ ├── 04-NotificationMicroservice-Deployment.yml │ └── 08-V2-NotificationMicroservice-Deployment.yml ├── 05-Kubernetes-Important-Concepts-for-Application-Deployments ├── 05-01-Kubernetes-Secrets │ ├── kube-manifests │ │ ├── 08-Kubernetes-Secrets.yml │ │ ├── 01-storage-class.yml │ │ ├── 03-UserManagement-ConfigMap.yml │ │ ├── 05-mysql-clusterip-service.yml │ │ ├── 02-persistent-volume-claim.yml │ │ ├── 07-UserManagement-Service.yml │ │ ├── 06-UserManagementMicroservice-Deployment-Service.yml │ │ └── 04-mysql-deployment.yml │ └── README.md ├── 05-02-Kubernetes-Init-Containers │ └── kube-manifests │ │ ├── 08-Kubernetes-Secrets.yml │ │ ├── 01-storage-class.yml │ │ ├── 03-UserManagement-ConfigMap.yml │ │ ├── 05-mysql-clusterip-service.yml │ │ ├── 02-persistent-volume-claim.yml │ │ ├── 07-UserManagement-Service.yml │ │ ├── 04-mysql-deployment.yml │ │ └── 06-UserManagementMicroservice-Deployment-Service.yml ├── 05-04-Kubernetes-Requests-Limits │ ├── kube-manifests │ │ ├── 08-Kubernetes-Secrets.yml │ │ ├── 01-storage-class.yml │ │ ├── 03-UserManagement-ConfigMap.yml │ │ ├── 05-mysql-clusterip-service.yml │ │ ├── 02-persistent-volume-claim.yml │ │ ├── 07-UserManagement-Service.yml │ │ └── 04-mysql-deployment.yml │ └── README.md ├── 05-05-Kubernetes-Namespaces │ ├── README.md │ ├── 05-05-01-Namespaces-Imperative │ │ └── kube-manifests │ │ │ ├── 08-Kubernetes-Secrets.yml │ │ │ ├── 01-storage-class.yml │ │ │ ├── 03-UserManagement-ConfigMap.yml │ │ │ ├── 05-mysql-clusterip-service.yml │ │ │ ├── 02-persistent-volume-claim.yml │ │ │ ├── 07-UserManagement-Service.yml │ │ │ ├── 04-mysql-deployment.yml │ │ │ └── 06-UserManagementMicroservice-Deployment-Service.yml │ ├── 05-05-03-Namespaces-ResourceQuota │ │ └── kube-manifests │ │ │ ├── 01-storage-class.yml │ │ │ ├── 08-Kubernetes-Secrets.yml │ │ │ ├── 03-UserManagement-ConfigMap.yml │ │ │ ├── 05-mysql-clusterip-service.yml │ │ │ ├── 02-persistent-volume-claim.yml │ │ │ ├── 07-UserManagement-Service.yml │ │ │ ├── 00-namespace-LimitRange-ResourceQuota.yml │ │ │ ├── 04-mysql-deployment.yml │ │ │ └── 06-UserManagementMicroservice-Deployment-Service.yml │ └── 05-05-02-Namespaces-LimitRange-default │ │ └── kube-manifests │ │ ├── 01-storage-class.yml │ │ ├── 08-Kubernetes-Secrets.yml │ │ ├── 03-UserManagement-ConfigMap.yml │ │ ├── 05-mysql-clusterip-service.yml │ │ ├── 02-persistent-volume-claim.yml │ │ ├── 07-UserManagement-Service.yml │ │ ├── 00-namespace-LimitRange-default.yml │ │ ├── 04-mysql-deployment.yml │ │ └── 06-UserManagementMicroservice-Deployment-Service.yml ├── 05-03-Kubernetes-Liveness-and-Readiness-Probes │ ├── kube-manifests │ │ ├── 08-Kubernetes-Secrets.yml │ │ ├── 01-storage-class.yml │ │ ├── 03-UserManagement-ConfigMap.yml │ │ ├── 05-mysql-clusterip-service.yml │ │ ├── 02-persistent-volume-claim.yml │ │ ├── 07-UserManagement-Service.yml │ │ ├── 04-mysql-deployment.yml │ │ └── 06-UserManagementMicroservice-Deployment-Service.yml │ └── README.md └── README.md ├── 04-EKS-Storage-with-EBS-ElasticBlockStore ├── 04-02-SC-PVC-ConfigMap-MySQL │ └── kube-manifests │ │ ├── 01-storage-class.yml │ │ ├── 03-UserManagement-ConfigMap.yml │ │ ├── 05-mysql-clusterip-service.yml │ │ ├── 02-persistent-volume-claim.yml │ │ └── 04-mysql-deployment.yml ├── 04-03-UserManagement-MicroService-with-MySQLDB │ └── kube-manifests │ │ ├── 01-storage-class.yml │ │ ├── 03-UserManagement-ConfigMap.yml │ │ ├── 05-mysql-clusterip-service.yml │ │ ├── 02-persistent-volume-claim.yml │ │ ├── 07-UserManagement-Service.yml │ │ ├── 06-UserManagementMicroservice-Deployment-Service.yml │ │ └── 04-mysql-deployment.yml └── README.md ├── 13-Microservices-Distributed-Tracing-using-AWS-XRay-on-EKS └── kube-manifests │ ├── 01-XRay-DaemonSet │ └── .DS_Store │ └── 02-Applications │ ├── 01-MySQL-externalName-Service.yml │ ├── 05-NotificationMicroservice-SMTP-externalName-Service.yml │ ├── 06-NotificationMicroservice-ClusterIP-Service.yml │ ├── 03-UserManagement-NodePort-Service.yml │ └── 04-NotificationMicroservice-Deployment.yml ├── 01-EKS-Create-Cluster-using-eksctl ├── README.md ├── 01-03-EKSCluster-Pricing │ └── README.md └── 01-04-Delete-EKSCluster-and-NodeGroups │ └── README.md ├── 16-EKS-VPA-Vertical-Pod-Autoscaler └── kube-manifests │ ├── 02-VPA-Manifest.yml │ └── 01-VPA-DemoApplication.yml ├── 17-EKS-Autoscaling-Cluster-Autoscaler └── kube-manifests │ └── 01-kubenginx-Deployment-Service.yml ├── 15-EKS-HPA-Horizontal-Pod-Autoscaler └── kube-manifests │ └── 01-HPA-Demo.yml └── 18-EKS-Monitoring-using-CloudWatch-Container-Insights └── kube-manifests └── Sample-Nginx-App.yml /.gitignore: -------------------------------------------------------------------------------- 1 | /ADDITIONAL-TOPICS 2 | /FUTURE-TOPCS 3 | *.sh 4 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /11-DevOps-with-AWS-Developer-Tools/Application-Manifests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | COPY app1 /usr/share/nginx/html/app1 -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=mysqlaws -------------------------------------------------------------------------------- /10-ECR-Elastic-Container-Registry-and-EKS/01-aws-ecr-kubenginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | COPY index.html /usr/share/nginx/html 3 | 4 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=mysqlaws -------------------------------------------------------------------------------- /presentation/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/presentation/.DS_Store -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-01-Fargate-Profile-Basic/kube-manifests/01-namespace.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: fp-dev -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/09-EKS-Workloads-on-Fargate/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/.DS_Store -------------------------------------------------------------------------------- /presentation/AWS-Fargate-and-EKS-Masterclass.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/presentation/AWS-Fargate-and-EKS-Masterclass.pptx -------------------------------------------------------------------------------- /02-Docker-Fundamentals/README.md: -------------------------------------------------------------------------------- 1 | # Docker Fundamentals 2 | - For Docker Fundamentals github repository, please click on below link 3 | - https://github.com/stacksimplify/docker-fundamentals 4 | 5 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | VOLUME /tmp 3 | EXPOSE 8080 4 | ADD target/*.jar app.jar 5 | ENTRYPOINT [ "sh", "-c", "java -jar /app.jar" ] -------------------------------------------------------------------------------- /03-Kubernetes-Fundamentals/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Fundamentals 2 | - For Kubernetes Fundamentals github repository, please click on below link 3 | - https://github.com/stacksimplify/kubernetes-fundamentals 4 | -------------------------------------------------------------------------------- /06-EKS-Storage-with-RDS-Database/kube-manifests/04-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/README.md: -------------------------------------------------------------------------------- 1 | # AWS Elastic Load Balancers 2 | 3 | ## AWS Load Balancer Types 4 | 1. Classic Load Balancer 5 | 2. Network Load Balancer 6 | 3. Application Load Balancer (k8s Ingress) -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/01-helloworld-service/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/03-notifications-service/.DS_Store -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-02-ALB-Ingress-Basics/kube-manifests/03-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-04-ALB-Ingress-SSL/kube-manifests/03-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/03-notifications-service/src/.DS_Store -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-05-ALB-Ingress-SSL-Redirect/kube-manifests/03-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/03-notifications-service/src/main/.DS_Store -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-02-Classic-LoadBalancer-CLB/kube-manifests/03-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-03-Network-LoadBalancer-NLB/kube-manifests/03-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /06-EKS-Storage-with-RDS-Database/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com 8 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-03-ALB-Ingress-ContextPath-Based-Routing/kube-manifests/03-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-02-Fargate-Profiles-Advanced-YAML/kube-manifests/02-Applications/03-ns-ums/01-namespace.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: ns-ums 5 | # Apps deployed in this namespace will run on a Fargate fp-ums -------------------------------------------------------------------------------- /12-Microservices-Deployment-on-EKS/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com -------------------------------------------------------------------------------- /14-Microservices-Canary-Deployments/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/03-notifications-service/src/main/java/.DS_Store -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-02-Fargate-Profiles-Advanced-YAML/kube-manifests/02-Applications/02-ns-app2/01-namespace.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: ns-app2 5 | # Apps deployed in this namespace will run on a Fargate fp-app2 -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/01-helloworld-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/jwt.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/jwt.jks -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/.DS_Store -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-01-Kubernetes-Secrets/kube-manifests/08-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/03-notifications-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/03-notifications-service/src/main/resources/.DS_Store -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-02-SC-PVC-ConfigMap-MySQL/kube-manifests/01-storage-class.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: ebs-sc 5 | provisioner: ebs.csi.aws.com 6 | volumeBindingMode: WaitForFirstConsumer -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-02-Kubernetes-Init-Containers/kube-manifests/08-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-04-Kubernetes-Requests-Limits/kube-manifests/08-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-02-Fargate-Profiles-Advanced-YAML/kube-manifests/02-Applications/01-ns-app1/01-namespace.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: ns-app1 5 | # Apps deployed in this namespace will run on a EC2 Managed Node Group 6 | -------------------------------------------------------------------------------- /12-Microservices-Deployment-on-EKS/kube-manifests/05-NotificationMicroservice-SMTP-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: smtp-service 5 | spec: 6 | type: ExternalName 7 | externalName: email-smtp.us-east-1.amazonaws.com 8 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/jwt.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/jwt.jks -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-06-ALB-Ingress-ExternalDNS/08-06-02-Use-ExternalDNS-for-Apps/kube-manifests/03-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /14-Microservices-Canary-Deployments/kube-manifests/05-NotificationMicroservice-SMTP-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: smtp-service 5 | spec: 6 | type: ExternalName 7 | externalName: email-smtp.us-east-1.amazonaws.com 8 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/Fonts/Arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/Fonts/Arial.ttf -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/README.md: -------------------------------------------------------------------------------- 1 | # Namespaces 2 | 3 | 1. Namespaces - Imperative using kubectl 4 | 2. Namespaces - Declarative using YAML & LimitRange 5 | 3. Namespaces - Declarative using YAML & ResourceQuota 6 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-02-ALB-Ingress-Basics/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com 8 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-04-ALB-Ingress-SSL/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com 8 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | VOLUME /tmp 3 | EXPOSE 8095 4 | ADD target/*.jar app.jar 5 | ENV JAVA_OPTS="" 6 | ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ] -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | VOLUME /tmp 3 | EXPOSE 8096 4 | ADD target/*.jar app.jar 5 | ENV JAVA_OPTS="" 6 | ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ] -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-03-UserManagement-MicroService-with-MySQLDB/kube-manifests/01-storage-class.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: ebs-sc 5 | provisioner: ebs.csi.aws.com 6 | volumeBindingMode: WaitForFirstConsumer -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-01-Kubernetes-Secrets/kube-manifests/01-storage-class.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: ebs-sc 5 | provisioner: ebs.csi.aws.com 6 | volumeBindingMode: WaitForFirstConsumer -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-03-Kubernetes-Liveness-and-Readiness-Probes/kube-manifests/08-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-05-ALB-Ingress-SSL-Redirect/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com 8 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/Fonts/Arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/Fonts/Arial.ttf -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/Fonts/Arial Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/Fonts/Arial Bold.ttf -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-02-Kubernetes-Init-Containers/kube-manifests/01-storage-class.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: ebs-sc 5 | provisioner: ebs.csi.aws.com 6 | volumeBindingMode: WaitForFirstConsumer -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-04-Kubernetes-Requests-Limits/kube-manifests/01-storage-class.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: ebs-sc 5 | provisioner: ebs.csi.aws.com 6 | volumeBindingMode: WaitForFirstConsumer -------------------------------------------------------------------------------- /13-Microservices-Distributed-Tracing-using-AWS-XRay-on-EKS/kube-manifests/01-XRay-DaemonSet/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/13-Microservices-Distributed-Tracing-using-AWS-XRay-on-EKS/kube-manifests/01-XRay-DaemonSet/.DS_Store -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/Fonts/Arial Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/Fonts/Arial Italic.ttf -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-02-Classic-LoadBalancer-CLB/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com 8 | -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-03-Network-LoadBalancer-NLB/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com 8 | -------------------------------------------------------------------------------- /10-ECR-Elastic-Container-Registry-and-EKS/01-aws-ecr-kubenginx/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Welcome to Stack Simplify

6 |

AWS EKS Master Class - Integration with ECR Registry

7 | 8 | 9 | -------------------------------------------------------------------------------- /13-Microservices-Distributed-Tracing-using-AWS-XRay-on-EKS/kube-manifests/02-Applications/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/Fonts/Arial Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/Fonts/Arial Bold.ttf -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-01-Namespaces-Imperative/kube-manifests/08-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-03-ALB-Ingress-ContextPath-Based-Routing/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com 8 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/Fonts/Arial Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/Fonts/Arial Italic.ttf -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/Fonts/Arial Bold Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/Fonts/Arial Bold Italic.ttf -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/static/error404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | User Management Application 6 | 7 | 8 |

Resource not found!

9 | 10 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-03-Kubernetes-Liveness-and-Readiness-Probes/kube-manifests/01-storage-class.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: ebs-sc 5 | provisioner: ebs.csi.aws.com 6 | volumeBindingMode: WaitForFirstConsumer -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/static/error404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | User Management Application 6 | 7 | 8 |

Resource not found!

9 | 10 | -------------------------------------------------------------------------------- /13-Microservices-Distributed-Tracing-using-AWS-XRay-on-EKS/kube-manifests/02-Applications/05-NotificationMicroservice-SMTP-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: smtp-service 5 | spec: 6 | type: ExternalName 7 | externalName: email-smtp.us-east-1.amazonaws.com 8 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/Fonts/Arial Bold Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/Fonts/Arial Bold Italic.ttf -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/.DS_Store -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-01-Namespaces-Imperative/kube-manifests/01-storage-class.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: ebs-sc 5 | provisioner: ebs.csi.aws.com 6 | volumeBindingMode: WaitForFirstConsumer -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-03-Namespaces-ResourceQuota/kube-manifests/01-storage-class.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: ebs-sc 5 | provisioner: ebs.csi.aws.com 6 | volumeBindingMode: WaitForFirstConsumer -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-06-ALB-Ingress-ExternalDNS/08-06-02-Use-ExternalDNS-for-Apps/kube-manifests/01-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | type: ExternalName 7 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com 8 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-02-SC-PVC-ConfigMap-MySQL/kube-manifests/03-UserManagement-ConfigMap.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS usermgmt; 8 | CREATE DATABASE usermgmt; -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-02-Namespaces-LimitRange-default/kube-manifests/01-storage-class.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: ebs-sc 5 | provisioner: ebs.csi.aws.com 6 | volumeBindingMode: WaitForFirstConsumer -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-03-Namespaces-ResourceQuota/kube-manifests/08-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | namespace: dev3 6 | type: Opaque 7 | data: 8 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/.DS_Store -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-02-Namespaces-LimitRange-default/kube-manifests/08-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | namespace: dev3 6 | type: Opaque 7 | data: 8 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.hibernate.ddl-auto=create-drop 2 | spring.datasource.driver-class-name=org.h2.Driver 3 | spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 4 | spring.datasource.username=sa 5 | spring.datasource.password=sa 6 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.hibernate.ddl-auto=create-drop 2 | spring.datasource.driver-class-name=org.h2.Driver 3 | spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 4 | spring.datasource.username=sa 5 | spring.datasource.password=sa 6 | -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-02-SC-PVC-ConfigMap-MySQL/kube-manifests/05-mysql-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | selector: 7 | app: mysql 8 | ports: 9 | - port: 3306 10 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-01-Kubernetes-Secrets/kube-manifests/03-UserManagement-ConfigMap.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS usermgmt; 8 | CREATE DATABASE usermgmt; -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-02-Fargate-Profiles-Advanced-YAML/kube-manifests/02-Applications/03-ns-ums/04-Kubernetes-Secrets.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | labels: 6 | runon: fargate 7 | namespace: ns-ums 8 | type: Opaque 9 | data: 10 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-03-UserManagement-MicroService-with-MySQLDB/kube-manifests/03-UserManagement-ConfigMap.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS usermgmt; 8 | CREATE DATABASE usermgmt; -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-02-Kubernetes-Init-Containers/kube-manifests/03-UserManagement-ConfigMap.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS usermgmt; 8 | CREATE DATABASE usermgmt; -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-04-Kubernetes-Requests-Limits/kube-manifests/03-UserManagement-ConfigMap.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS usermgmt; 8 | CREATE DATABASE usermgmt; -------------------------------------------------------------------------------- /11-DevOps-with-AWS-Developer-Tools/Application-Manifests/app1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify - App Version - V1

5 |

DevOps for EKS with AWS Developer Tools

6 |

Application Name: App1

7 | 8 | -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-03-UserManagement-MicroService-with-MySQLDB/kube-manifests/05-mysql-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | selector: 7 | app: mysql 8 | ports: 9 | - port: 3306 10 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-01-Kubernetes-Secrets/kube-manifests/05-mysql-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | selector: 7 | app: mysql 8 | ports: 9 | - port: 3306 10 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-02-SC-PVC-ConfigMap-MySQL/kube-manifests/02-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: ebs-mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: ebs-sc 9 | resources: 10 | requests: 11 | storage: 4Gi -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-02-Kubernetes-Init-Containers/kube-manifests/05-mysql-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | selector: 7 | app: mysql 8 | ports: 9 | - port: 3306 10 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-04-Kubernetes-Requests-Limits/kube-manifests/05-mysql-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | selector: 7 | app: mysql 8 | ports: 9 | - port: 3306 10 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-03-Kubernetes-Liveness-and-Readiness-Probes/kube-manifests/03-UserManagement-ConfigMap.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS usermgmt; 8 | CREATE DATABASE usermgmt; -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/ApiError.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/ApiError.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/CorsFilter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/CorsFilter.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/UserManagementApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/UserManagementApplication.class -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-01-Kubernetes-Secrets/kube-manifests/02-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: ebs-mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: ebs-sc 9 | resources: 10 | requests: 11 | storage: 4Gi -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-03-Kubernetes-Liveness-and-Readiness-Probes/kube-manifests/05-mysql-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | selector: 7 | app: mysql 8 | ports: 9 | - port: 3306 10 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-01-Namespaces-Imperative/kube-manifests/03-UserManagement-ConfigMap.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS usermgmt; 8 | CREATE DATABASE usermgmt; -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Important Concepts for Application Deployments 2 | 3 | | S.No | k8s Concept Name | 4 | | ------------- | ------------- | 5 | | 1. | Secrets | 6 | | 2. | Init Containers | 7 | | 3. | Liveness & Readiness Probes | 8 | | 4. | Requests & Limits | 9 | | 5. | Namespaces | 10 | -------------------------------------------------------------------------------- /01-EKS-Create-Cluster-using-eksctl/README.md: -------------------------------------------------------------------------------- 1 | # EKS - Create Cluster 2 | 3 | ## List of Topics 4 | - Install CLIs 5 | - AWS CLI 6 | - kubectl 7 | - eksctl 8 | - Create EKS Cluster 9 | - Create EKS Node Groups 10 | - Understand EKS Cluster Pricing 11 | - EKS Control Plane 12 | - EKS Worker Nodes 13 | - EKS Fargate Profile 14 | - Delete EKS Clusters 15 | 16 | -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-03-UserManagement-MicroService-with-MySQLDB/kube-manifests/02-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: ebs-mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: ebs-sc 9 | resources: 10 | requests: 11 | storage: 4Gi -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/test/java/com/stacksimplify/restservices/UserManagementApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/test/java/com/stacksimplify/restservices/UserManagementApplicationTests.class -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-02-Kubernetes-Init-Containers/kube-manifests/02-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: ebs-mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: ebs-sc 9 | resources: 10 | requests: 11 | storage: 4Gi -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-04-Kubernetes-Requests-Limits/kube-manifests/02-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: ebs-mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: ebs-sc 9 | resources: 10 | requests: 11 | storage: 4Gi -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-02-Fargate-Profiles-Advanced-YAML/kube-manifests/02-Applications/03-ns-ums/02-MySQL-externalName-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | labels: 6 | runon: fargate 7 | namespace: ns-ums 8 | spec: 9 | type: ExternalName 10 | externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com 11 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/ApiError$ApiSubError.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/ApiError$ApiSubError.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/RestExceptionHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/RestExceptionHandler.class -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-01-Namespaces-Imperative/kube-manifests/05-mysql-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | selector: 7 | app: mysql 8 | ports: 9 | - port: 3306 10 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /06-EKS-Storage-with-RDS-Database/kube-manifests/03-UserManagement-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-service 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | type: NodePort 9 | selector: 10 | app: usermgmt-restapp 11 | ports: 12 | - port: 8095 13 | targetPort: 8095 14 | nodePort: 31231 15 | -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/README.md: -------------------------------------------------------------------------------- 1 | # AWS EKS - Fargate Profiles 2 | 3 | 1. Fargate Profiles - Basic 4 | 2. Fargate Profiles - Advanced using YAML 5 | 6 | ## References 7 | - https://eksctl.io/usage/fargate-support/ 8 | - https://docs.aws.amazon.com/eks/latest/userguide/fargate.html 9 | - https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/#target-type -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/static/error403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | User Management Application 6 | 7 | 8 |

Access Denied!

9 |
If you think you should have access to this resource, please contact Support.
10 | 11 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/static/error403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | User Management Application 6 | 7 | 8 |

Access Denied!

9 |
If you think you should have access to this resource, please contact Support.
10 | 11 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/static/error500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | User Management Application 6 | 7 | 8 |

Something went wrong, please try again later!

9 |
If the problem persists, please contact Support.
10 | 11 | -------------------------------------------------------------------------------- /12-Microservices-Deployment-on-EKS/kube-manifests/06-NotificationMicroservice-ClusterIP-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: notification-clusterip-service 5 | labels: 6 | app: notification-restapp 7 | spec: 8 | type: ClusterIP 9 | selector: 10 | app: notification-restapp 11 | ports: 12 | - port: 8096 13 | targetPort: 8096 14 | -------------------------------------------------------------------------------- /14-Microservices-Canary-Deployments/kube-manifests/06-NotificationMicroservice-ClusterIP-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: notification-clusterip-service 5 | labels: 6 | app: notification-restapp 7 | spec: 8 | type: ClusterIP 9 | selector: 10 | app: notification-restapp 11 | ports: 12 | - port: 8096 13 | targetPort: 8096 14 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/entities/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/entities/User.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/RecordNotFoundException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/RecordNotFoundException.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/ThreadPoolConfiguration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/ThreadPoolConfiguration.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/static/error500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | User Management Application 6 | 7 | 8 |

Something went wrong, please try again later!

9 |
If the problem persists, please contact Support.
10 | 11 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-03-Kubernetes-Liveness-and-Readiness-Probes/kube-manifests/02-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: ebs-mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: ebs-sc 9 | resources: 10 | requests: 11 | storage: 4Gi -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-03-Namespaces-ResourceQuota/kube-manifests/03-UserManagement-ConfigMap.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | namespace: dev3 6 | data: 7 | mysql_usermgmt.sql: |- 8 | DROP DATABASE IF EXISTS usermgmt; 9 | CREATE DATABASE usermgmt; -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/dtos/UserModel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/dtos/UserModel.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/ApiError$ApiValidationError.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/ApiError$ApiValidationError.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/LowerCaseClassNameResolver.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/configuration/LowerCaseClassNameResolver.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/stacksimplify/notifications/core/services/NotificationService.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications.core.services; 2 | 3 | import com.stacksimplify.notifications.core.dtos.EmailMessage; 4 | 5 | public interface NotificationService { 6 | 7 | public void sendEmail(EmailMessage emailMessage); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-02-Namespaces-LimitRange-default/kube-manifests/03-UserManagement-ConfigMap.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | namespace: dev3 6 | data: 7 | mysql_usermgmt.sql: |- 8 | DROP DATABASE IF EXISTS usermgmt; 9 | CREATE DATABASE usermgmt; -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-01-Namespaces-Imperative/kube-manifests/02-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: ebs-mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: ebs-sc 9 | resources: 10 | requests: 11 | storage: 4Gi -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-02-Classic-LoadBalancer-CLB/kube-manifests/04-ClassicLoadBalancer.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: clb-usermgmt-restapp 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | type: LoadBalancer # Default - CLB 9 | selector: 10 | app: usermgmt-restapp 11 | ports: 12 | - port: 80 13 | targetPort: 8095 14 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/services/UserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/services/UserService.class -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-03-Namespaces-ResourceQuota/kube-manifests/05-mysql-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | namespace: dev3 6 | spec: 7 | selector: 8 | app: mysql 9 | ports: 10 | - port: 3306 11 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-06-ALB-Ingress-ExternalDNS/README.md: -------------------------------------------------------------------------------- 1 | # External DNS 2 | 3 | 1. Deploy External DNS 4 | 2. Use External DNS for our Application 5 | 6 | 7 | ## External DNS References 8 | - https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/alb-ingress.md 9 | - https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md 10 | 11 | 12 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/entities/SimpleMessage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/entities/SimpleMessage.class -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-02-Namespaces-LimitRange-default/kube-manifests/05-mysql-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | namespace: dev3 6 | spec: 7 | selector: 8 | app: mysql 9 | ports: 10 | - port: 3306 11 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/src/test/java/com/stacksimplify/helloworld/HelloworldApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.helloworld; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class HelloworldApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/UserController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/UserController.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/repositories/UserRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/repositories/UserRepository.class -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-03-Namespaces-ResourceQuota/kube-manifests/02-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: ebs-mysql-pv-claim 5 | namespace: dev3 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | storageClassName: ebs-sc 10 | resources: 11 | requests: 12 | storage: 4Gi -------------------------------------------------------------------------------- /13-Microservices-Distributed-Tracing-using-AWS-XRay-on-EKS/kube-manifests/02-Applications/06-NotificationMicroservice-ClusterIP-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: notification-clusterip-service 5 | labels: 6 | app: notification-restapp 7 | spec: 8 | type: ClusterIP 9 | selector: 10 | app: notification-restapp 11 | ports: 12 | - port: 8096 13 | targetPort: 8096 14 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/configuration/AuthorizationServerConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/configuration/AuthorizationServerConfig.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/AdminUserController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/AdminUserController.class -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/HelloWorldController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/HelloWorldController.class -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-01-Kubernetes-Secrets/kube-manifests/07-UserManagement-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-service 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | type: NodePort 9 | selector: 10 | app: usermgmt-restapp 11 | ports: 12 | - port: 8095 13 | targetPort: 8095 14 | nodePort: 31231 15 | -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-03-UserManagement-MicroService-with-MySQLDB/kube-manifests/07-UserManagement-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-service 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | type: NodePort 9 | selector: 10 | app: usermgmt-restapp 11 | ports: 12 | - port: 8095 13 | targetPort: 8095 14 | nodePort: 31231 15 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-02-Namespaces-LimitRange-default/kube-manifests/02-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: ebs-mysql-pv-claim 5 | namespace: dev3 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | storageClassName: ebs-sc 10 | resources: 11 | requests: 12 | storage: 4Gi -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-02-ALB-Ingress-Basics/kube-manifests/04-UserManagement-NodePort-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-nodeport-service 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | type: NodePort 9 | selector: 10 | app: usermgmt-restapp 11 | ports: 12 | - port: 8095 13 | targetPort: 8095 14 | #nodePort: 31231 15 | 16 | 17 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/configuration/AuthorizationServerAuthConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/configuration/AuthorizationServerAuthConfig.class -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-02-Kubernetes-Init-Containers/kube-manifests/07-UserManagement-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-service 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | type: NodePort 9 | selector: 10 | app: usermgmt-restapp 11 | ports: 12 | - port: 8095 13 | targetPort: 8095 14 | nodePort: 31231 15 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-04-Kubernetes-Requests-Limits/kube-manifests/07-UserManagement-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-service 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | type: NodePort 9 | selector: 10 | app: usermgmt-restapp 11 | ports: 12 | - port: 8095 13 | targetPort: 8095 14 | nodePort: 31231 15 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/ApplicationStatusController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Soprano37/StackSimplify-aws-eks-kubernetes-masterclass/HEAD/others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/ApplicationStatusController.class -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-03-Kubernetes-Liveness-and-Readiness-Probes/kube-manifests/07-UserManagement-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-service 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | type: NodePort 9 | selector: 10 | app: usermgmt-restapp 11 | ports: 12 | - port: 8095 13 | targetPort: 8095 14 | nodePort: 31231 15 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-01-Namespaces-Imperative/kube-manifests/07-UserManagement-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-service 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | type: NodePort 9 | selector: 10 | app: usermgmt-restapp 11 | ports: 12 | - port: 8095 13 | targetPort: 8095 14 | #nodePort: 31231 15 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-03-Namespaces-ResourceQuota/kube-manifests/07-UserManagement-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-service 5 | labels: 6 | app: usermgmt-restapp 7 | namespace: dev3 8 | spec: 9 | type: NodePort 10 | selector: 11 | app: usermgmt-restapp 12 | ports: 13 | - port: 8095 14 | targetPort: 8095 15 | #nodePort: 31231 16 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | 27 | ### test log file ### 28 | *.log 29 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-02-Namespaces-LimitRange-default/kube-manifests/07-UserManagement-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-service 5 | labels: 6 | app: usermgmt-restapp 7 | namespace: dev3 8 | spec: 9 | type: NodePort 10 | selector: 11 | app: usermgmt-restapp 12 | ports: 13 | - port: 8095 14 | targetPort: 8095 15 | #nodePort: 31231 16 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | 27 | ### test log file ### 28 | *.log 29 | 30 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/src/main/java/com/stacksimplify/helloworld/HelloworldApplication.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.helloworld; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class HelloworldApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(HelloworldApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | 27 | ### test log file ### 28 | *.log 29 | 30 | -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-03-Network-LoadBalancer-NLB/kube-manifests/04-NetworkLoadBalancer.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: nlb-usermgmt-restapp 5 | labels: 6 | app: usermgmt-restapp 7 | annotations: 8 | service.beta.kubernetes.io/aws-load-balancer-type: nlb # To create Network Load Balancer 9 | spec: 10 | type: LoadBalancer # Default - CLB 11 | selector: 12 | app: usermgmt-restapp 13 | ports: 14 | - port: 80 15 | targetPort: 8095 16 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/configuration/RecordNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.configuration; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class RecordNotFoundException extends RuntimeException { 8 | public RecordNotFoundException(String exception) { 9 | super(exception); 10 | } 11 | } -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /11-DevOps-with-AWS-Developer-Tools/Application-Manifests/kube-manifests/01-DEVOPS-Nginx-Deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: eks-devops-deployment 5 | labels: 6 | app: eks-devops 7 | spec: 8 | replicas: 2 9 | selector: 10 | matchLabels: 11 | app: eks-devops 12 | template: 13 | metadata: 14 | labels: 15 | app: eks-devops 16 | spec: 17 | containers: 18 | - name: eks-devops 19 | image: CONTAINER_IMAGE 20 | ports: 21 | - containerPort: 80 -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/test/java/com/stacksimplify/notifications/NotificationsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class NotificationsApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/test/java/com/stacksimplify/restservices/UserManagementApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | //@RunWith(SpringRunner.class) 9 | //@SpringBootTest 10 | public class UserManagementApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /16-EKS-VPA-Vertical-Pod-Autoscaler/kube-manifests/02-VPA-Manifest.yml: -------------------------------------------------------------------------------- 1 | apiVersion: "autoscaling.k8s.io/v1beta2" 2 | kind: VerticalPodAutoscaler 3 | metadata: 4 | name: kubengix-vpa 5 | spec: 6 | targetRef: 7 | apiVersion: "apps/v1" 8 | kind: Deployment 9 | name: vpa-demo-deployment 10 | resourcePolicy: 11 | containerPolicies: 12 | - containerName: '*' 13 | minAllowed: 14 | cpu: 5m 15 | memory: 5Mi 16 | maxAllowed: 17 | cpu: 1 18 | memory: 500Mi 19 | controlledResources: ["cpu", "memory"] -------------------------------------------------------------------------------- /10-ECR-Elastic-Container-Registry-and-EKS/02-kube-manifests/02-ECR-Nginx-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: kubeapp-ecr-nodeport-service 5 | labels: 6 | app: kubeapp-ecr 7 | annotations: 8 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 9 | alb.ingress.kubernetes.io/healthcheck-path: /index.html 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: kubeapp-ecr 14 | ports: 15 | - port: 80 16 | targetPort: 80 17 | -------------------------------------------------------------------------------- /12-Microservices-Deployment-on-EKS/kube-manifests/03-UserManagement-NodePort-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-nodeport-service 5 | labels: 6 | app: usermgmt-restapp 7 | annotations: 8 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 9 | alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: usermgmt-restapp 14 | ports: 15 | - port: 8095 16 | targetPort: 8095 17 | -------------------------------------------------------------------------------- /14-Microservices-Canary-Deployments/kube-manifests/03-UserManagement-NodePort-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-nodeport-service 5 | labels: 6 | app: usermgmt-restapp 7 | annotations: 8 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 9 | alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: usermgmt-restapp 14 | ports: 15 | - port: 8095 16 | targetPort: 8095 17 | -------------------------------------------------------------------------------- /11-DevOps-with-AWS-Developer-Tools/Application-Manifests/kube-manifests/02-DEVOPS-Nginx-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: eks-devops-nodeport-service 5 | labels: 6 | app: eks-devops 7 | annotations: 8 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 9 | alb.ingress.kubernetes.io/healthcheck-path: /app1/index.html 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: eks-devops 14 | ports: 15 | - port: 80 16 | targetPort: 80 17 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-04-ALB-Ingress-SSL/kube-manifests/04-UserManagement-NodePort-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-nodeport-service 5 | labels: 6 | app: usermgmt-restapp 7 | annotations: 8 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 9 | alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: usermgmt-restapp 14 | ports: 15 | - port: 8095 16 | targetPort: 8095 17 | 18 | 19 | -------------------------------------------------------------------------------- /13-Microservices-Distributed-Tracing-using-AWS-XRay-on-EKS/kube-manifests/02-Applications/03-UserManagement-NodePort-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-nodeport-service 5 | labels: 6 | app: usermgmt-restapp 7 | annotations: 8 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 9 | alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: usermgmt-restapp 14 | ports: 15 | - port: 8095 16 | targetPort: 8095 17 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-05-ALB-Ingress-SSL-Redirect/kube-manifests/04-UserManagement-NodePort-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-nodeport-service 5 | labels: 6 | app: usermgmt-restapp 7 | annotations: 8 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 9 | alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: usermgmt-restapp 14 | ports: 15 | - port: 8095 16 | targetPort: 8095 17 | 18 | 19 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-03-ALB-Ingress-ContextPath-Based-Routing/kube-manifests/04-UserManagement-NodePort-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-nodeport-service 5 | labels: 6 | app: usermgmt-restapp 7 | annotations: 8 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 9 | alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: usermgmt-restapp 14 | ports: 15 | - port: 8095 16 | targetPort: 8095 17 | 18 | 19 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/buildspec.yml: -------------------------------------------------------------------------------- 1 | version: 0.2 2 | 3 | phases: 4 | install: 5 | runtime-versions: 6 | java: openjdk8 7 | commands: 8 | - echo "Install Phase - using Open JDK 8" 9 | pre_build: 10 | commands: 11 | - echo "Pre-build phase - No commands to execute" 12 | build: 13 | commands: 14 | - mvn package 15 | - echo "Build phase - mvn package execution completed" 16 | post_build: 17 | commands: 18 | - echo "Post Build phase - No commands to execute" 19 | artifacts: 20 | files: 21 | - 'target/usermgmt-react-backend-springboot-0.0.1-SNAPSHOT.jar' -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-06-ALB-Ingress-ExternalDNS/08-06-02-Use-ExternalDNS-for-Apps/kube-manifests/04-UserManagement-NodePort-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-nodeport-service 5 | labels: 6 | app: usermgmt-restapp 7 | annotations: 8 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 9 | alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: usermgmt-restapp 14 | ports: 15 | - port: 8095 16 | targetPort: 8095 17 | 18 | 19 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/src/main/java/com/stacksimplify/helloworld/serverinfo/ServerInformationService.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.helloworld.serverinfo; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class ServerInformationService { 8 | 9 | private static final String HOST_NAME = "HOSTNAME"; 10 | 11 | private static final String INSTANCE_GUID = "LOCAL"; 12 | 13 | @Value("${" + HOST_NAME + ":" + INSTANCE_GUID + "}") 14 | private String hostName; 15 | 16 | public String getServerInfo() { 17 | return hostName.substring(hostName.length()-5); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-02-Fargate-Profiles-Advanced-YAML/kube-manifests/02-Applications/03-ns-ums/05-UserManagement-NodePort-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-restapp-nodeport-service 5 | labels: 6 | app: usermgmt-restapp 7 | runon: fargate 8 | namespace: ns-ums 9 | annotations: 10 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 11 | alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 12 | spec: 13 | type: NodePort 14 | selector: 15 | app: usermgmt-restapp 16 | ports: 17 | - port: 8095 18 | targetPort: 8095 19 | 20 | 21 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/01-helloworld-service/src/main/java/com/stacksimplify/helloworld/HelloWorldController.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.helloworld; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import com.stacksimplify.helloworld.serverinfo.ServerInformationService; 8 | 9 | @RestController 10 | public class HelloWorldController { 11 | 12 | @Autowired 13 | private ServerInformationService serverInfo; 14 | 15 | @GetMapping(path = "/hello") 16 | public String helloWorld() { 17 | return "Hello World " + " V1 " + serverInfo.getServerInfo(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/ApplicationStatusController.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.authorizationserver.users.controllers; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import com.amazonaws.xray.spring.aop.XRayEnabled; 8 | 9 | @RestController 10 | //@XRayEnabled 11 | @RequestMapping("/health") 12 | public class ApplicationStatusController { 13 | 14 | @GetMapping("/status") 15 | public String appstatus() { 16 | return "OK"; 17 | } 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-02-Fargate-Profiles-Advanced-YAML/kube-manifests/01-Fargate-Advanced-Profiles/01-fargate-profiles.yml: -------------------------------------------------------------------------------- 1 | apiVersion: eksctl.io/v1alpha5 2 | kind: ClusterConfig 3 | metadata: 4 | name: eksdemo1 # Name of the EKS Cluster 5 | region: us-east-1 6 | fargateProfiles: 7 | - name: fp-app2 8 | selectors: 9 | # All workloads in the "ns-app2" Kubernetes namespace will be 10 | # scheduled onto Fargate: 11 | - namespace: ns-app2 12 | - name: fp-ums 13 | selectors: 14 | # All workloads in the "ns-ums" Kubernetes namespace matching the following 15 | # label selectors will be scheduled onto Fargate: 16 | - namespace: ns-ums 17 | labels: 18 | runon: fargate 19 | -------------------------------------------------------------------------------- /10-ECR-Elastic-Container-Registry-and-EKS/02-kube-manifests/01-ECR-Nginx-Deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: kubeapp-ecr 5 | labels: 6 | app: kubeapp-ecr 7 | spec: 8 | replicas: 2 9 | selector: 10 | matchLabels: 11 | app: kubeapp-ecr 12 | template: 13 | metadata: 14 | labels: 15 | app: kubeapp-ecr 16 | spec: 17 | containers: 18 | - name: kubeapp-ecr 19 | image: 180789647333.dkr.ecr.us-east-1.amazonaws.com/aws-ecr-kubenginx:1.0.0 20 | resources: 21 | requests: 22 | memory: "128Mi" 23 | cpu: "500m" 24 | limits: 25 | memory: "256Mi" 26 | cpu: "1000m" 27 | ports: 28 | - containerPort: 80 -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/authorizationserver/users/dtos/NoticationModel.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.authorizationserver.users.dtos; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class NoticationModel { 6 | 7 | @JsonProperty("servicename") 8 | private String servicename; 9 | 10 | @JsonProperty("status") 11 | private String status; 12 | 13 | public String getServicename() { 14 | return servicename; 15 | } 16 | 17 | public void setServicename(String servicename) { 18 | this.servicename = servicename; 19 | } 20 | 21 | public String getStatus() { 22 | return status; 23 | } 24 | 25 | public void setStatus(String status) { 26 | this.status = status; 27 | } 28 | 29 | 30 | 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/authorizationserver/users/entities/SimpleMessage.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.authorizationserver.users.entities; 2 | 3 | public class SimpleMessage { 4 | 5 | private String message; 6 | private String appversion; 7 | public SimpleMessage(String message, String appversion) { 8 | super(); 9 | this.message = message; 10 | this.appversion = appversion; 11 | } 12 | public String getMessage() { 13 | return message; 14 | } 15 | public void setMessage(String message) { 16 | this.message = message; 17 | } 18 | public String getAppversion() { 19 | return appversion; 20 | } 21 | public void setAppversion(String appversion) { 22 | this.appversion = appversion; 23 | } 24 | 25 | 26 | 27 | 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/stacksimplify/notifications/NotificationsApplication.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.builder.SpringApplicationBuilder; 6 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 7 | 8 | @SpringBootApplication 9 | public class NotificationsApplication extends SpringBootServletInitializer { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(NotificationsApplication.class, args); 13 | } 14 | 15 | @Override 16 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 17 | return application.sources(NotificationsApplication.class); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-02-Namespaces-LimitRange-default/kube-manifests/00-namespace-LimitRange-default.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: dev3 5 | --- 6 | apiVersion: v1 7 | kind: LimitRange 8 | metadata: 9 | name: default-cpu-mem-limit-range 10 | namespace: dev3 11 | spec: 12 | limits: 13 | - default: 14 | cpu: "500m" # If not specified default limit is 1 vCPU per container 15 | memory: "512Mi" # If not specified the Container's memory limit is set to 512Mi, which is the default memory limit for the namespace. 16 | defaultRequest: 17 | cpu: "300m" # If not specified default it will take from whatever specified in limits.default.cpu 18 | memory: "256Mi" # If not specified default it will take from whatever specified in limits.default.memory 19 | type: Container -------------------------------------------------------------------------------- /16-EKS-VPA-Vertical-Pod-Autoscaler/kube-manifests/01-VPA-DemoApplication.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: vpa-demo-deployment 5 | labels: 6 | app: vpa-nginx 7 | spec: 8 | replicas: 4 9 | selector: 10 | matchLabels: 11 | app: vpa-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: vpa-nginx 16 | spec: 17 | containers: 18 | - name: vpa-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | resources: 23 | requests: 24 | cpu: "5m" 25 | memory: "5Mi" 26 | --- 27 | apiVersion: v1 28 | kind: Service 29 | metadata: 30 | name: vpa-demo-service-nginx 31 | labels: 32 | app: vpa-nginx 33 | spec: 34 | type: NodePort 35 | selector: 36 | app: vpa-nginx 37 | ports: 38 | - port: 80 39 | targetPort: 80 40 | nodePort: 31232 41 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/UserManagementApplication.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; 6 | import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | 9 | @SpringBootApplication 10 | @EnableTransactionManagement 11 | @EnableGlobalMethodSecurity(prePostEnabled = true) 12 | //@EnableScheduling 13 | @EnableResourceServer 14 | public class UserManagementApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(UserManagementApplication.class, args); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /17-EKS-Autoscaling-Cluster-Autoscaler/kube-manifests/01-kubenginx-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: ca-demo-deployment 5 | labels: 6 | app: ca-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: ca-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: ca-nginx 16 | spec: 17 | containers: 18 | - name: ca-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | resources: 23 | requests: 24 | cpu: "200m" 25 | memory: "200Mi" 26 | --- 27 | apiVersion: v1 28 | kind: Service 29 | metadata: 30 | name: ca-demo-service-nginx 31 | labels: 32 | app: ca-nginx 33 | spec: 34 | type: NodePort 35 | selector: 36 | app: ca-nginx 37 | ports: 38 | - port: 80 39 | targetPort: 80 40 | nodePort: 31233 41 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/authorizationserver/users/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.authorizationserver.users.repositories; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import com.stacksimplify.restservices.authorizationserver.users.entities.User; 9 | 10 | public interface UserRepository extends JpaRepository { 11 | 12 | public long countByEmail(String email); 13 | 14 | @Query("select u.username from User u where u.role = ?1") 15 | List findUsernamesByRole(String role); 16 | 17 | @Query("select u.email from User u where u.role = ?1") 18 | List findEmailsByRole(String role); 19 | 20 | @Query("select u.email from User u where u.username = ?1") 21 | String findEmailByUsername(String username); 22 | } -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/authorizationserver/users/controllers/HelloWorldController.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.authorizationserver.users.controllers; 2 | 3 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 4 | import org.springframework.security.crypto.password.PasswordEncoder; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import com.stacksimplify.restservices.authorizationserver.users.entities.SimpleMessage; 9 | 10 | @RestController 11 | //@XRayEnabled 12 | public class HelloWorldController { 13 | 14 | @GetMapping("/hello") 15 | public String simpleHello() { 16 | return "Hello World - V1"; 17 | } 18 | 19 | 20 | @GetMapping("/hello-bean") 21 | public SimpleMessage helloBean() { 22 | return new SimpleMessage("Hello World Bean", "V1"); 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/configuration/ThreadPoolConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.configuration; 2 | 3 | import java.util.concurrent.Executor; 4 | 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.scheduling.annotation.EnableAsync; 8 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; 9 | 10 | @EnableAsync 11 | @Configuration 12 | public class ThreadPoolConfiguration { 13 | 14 | @Bean(name = "threadPoolExecutor") 15 | public Executor getAsyncExecutorNotificationBuilder() { 16 | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); 17 | executor.setCorePoolSize(20); 18 | executor.setMaxPoolSize(30); 19 | executor.setQueueCapacity(200); 20 | executor.setThreadNamePrefix("threadPoolExecutor-"); 21 | executor.initialize(); 22 | return executor; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/stacksimplify/notifications/configurations/ThreadPoolConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications.configurations; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; 7 | 8 | import java.util.concurrent.Executor; 9 | 10 | @EnableAsync 11 | @Configuration 12 | public class ThreadPoolConfiguration { 13 | 14 | @Bean(name = "threadPoolExecutor") 15 | public Executor getAsyncExecutorNotificationBuilder() { 16 | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); 17 | executor.setCorePoolSize(20); 18 | executor.setMaxPoolSize(30); 19 | executor.setQueueCapacity(200); 20 | executor.setThreadNamePrefix("threadPoolExecutor-"); 21 | executor.initialize(); 22 | return executor; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/xray/XRayInspector.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.xray; 2 | 3 | import java.util.Map; 4 | 5 | import org.aspectj.lang.ProceedingJoinPoint; 6 | import org.aspectj.lang.annotation.Aspect; 7 | import org.aspectj.lang.annotation.Pointcut; 8 | import org.springframework.stereotype.Component; 9 | 10 | import com.amazonaws.xray.entities.Subsegment; 11 | import com.amazonaws.xray.spring.aop.AbstractXRayInterceptor; 12 | @Aspect 13 | @Component 14 | public class XRayInspector extends AbstractXRayInterceptor { 15 | 16 | @Override 17 | protected Map> generateMetadata(ProceedingJoinPoint proceedingJoinPoint, 18 | Subsegment subsegment) { 19 | return super.generateMetadata(proceedingJoinPoint, subsegment); 20 | } 21 | 22 | @Override 23 | @Pointcut("@within(com.amazonaws.xray.spring.aop.XRayEnabled) && bean(*)") 24 | public void xrayEnabledClasses() { 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/stacksimplify/notifications/xray/XRayInspector.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications.xray; 2 | 3 | import java.util.Map; 4 | 5 | import org.aspectj.lang.ProceedingJoinPoint; 6 | import org.aspectj.lang.annotation.Aspect; 7 | import org.aspectj.lang.annotation.Pointcut; 8 | import org.springframework.stereotype.Component; 9 | 10 | import com.amazonaws.xray.entities.Subsegment; 11 | import com.amazonaws.xray.spring.aop.AbstractXRayInterceptor; 12 | @Aspect 13 | @Component 14 | public class XRayInspector extends AbstractXRayInterceptor { 15 | 16 | @Override 17 | protected Map> generateMetadata(ProceedingJoinPoint proceedingJoinPoint, 18 | Subsegment subsegment) { 19 | return super.generateMetadata(proceedingJoinPoint, subsegment); 20 | } 21 | 22 | @Override 23 | @Pointcut("@within(com.amazonaws.xray.spring.aop.XRayEnabled) && bean(*)") 24 | public void xrayEnabledClasses() { 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /15-EKS-HPA-Horizontal-Pod-Autoscaler/kube-manifests/01-HPA-Demo.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: hpa-demo-deployment 5 | labels: 6 | app: hpa-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: hpa-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: hpa-nginx 16 | spec: 17 | containers: 18 | - name: hpa-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | resources: 23 | requests: 24 | memory: "128Mi" 25 | cpu: "100m" 26 | limits: 27 | memory: "500Mi" 28 | cpu: "200m" 29 | --- 30 | apiVersion: v1 31 | kind: Service 32 | metadata: 33 | name: hpa-demo-service-nginx 34 | labels: 35 | app: hpa-nginx 36 | spec: 37 | type: NodePort 38 | selector: 39 | app: hpa-nginx 40 | ports: 41 | - port: 80 42 | targetPort: 80 43 | nodePort: 31231 44 | -------------------------------------------------------------------------------- /18-EKS-Monitoring-using-CloudWatch-Container-Insights/kube-manifests/Sample-Nginx-App.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: sample-nginx-deployment 5 | labels: 6 | app: sample-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: sample-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: sample-nginx 16 | spec: 17 | containers: 18 | - name: sample-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | resources: 23 | requests: 24 | cpu: "5m" 25 | memory: "5Mi" 26 | limits: 27 | cpu: "10m" 28 | memory: "10Mi" 29 | --- 30 | apiVersion: v1 31 | kind: Service 32 | metadata: 33 | name: sample-nginx-service 34 | labels: 35 | app: sample-nginx 36 | spec: 37 | selector: 38 | app: sample-nginx 39 | ports: 40 | - port: 80 41 | targetPort: 80 42 | -------------------------------------------------------------------------------- /12-Microservices-Deployment-on-EKS/kube-manifests/04-NotificationMicroservice-Deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: notification-microservice 5 | labels: 6 | app: notification-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: notification-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: notification-restapp 16 | spec: 17 | containers: 18 | - name: notification-service 19 | image: stacksimplify/kube-notifications-microservice:1.0.0 20 | ports: 21 | - containerPort: 8096 22 | imagePullPolicy: Always 23 | env: 24 | - name: AWS_MAIL_SERVER_HOST 25 | value: "smtp-service" 26 | - name: AWS_MAIL_SERVER_USERNAME 27 | value: "AKIASUF7HC7SQJ6BCLVS" 28 | - name: AWS_MAIL_SERVER_PASSWORD 29 | value: "BARcmLiC68wgmhTy/cQvz/E8vFzeizGqdeASNtCs6+Nv" 30 | - name: AWS_MAIL_SERVER_FROM_ADDRESS 31 | value: "stacksimplify@gmail.com" 32 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/bin/src/main/resources/application-h2.properties: -------------------------------------------------------------------------------- 1 | # Server Settings 2 | server.port = 5000 3 | server.context-path=/ 4 | 5 | # H2 Console Enabled 6 | spring.h2.console.enabled=true 7 | 8 | # JPA & Hibernate Settings 9 | spring.jpa.show-sql=false 10 | spring.jpa.properties.hibernate.id.new_generator_mappings = false 11 | spring.jpa.properties.hibernate.format_sql = true 12 | spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext 13 | 14 | # Logging Settings 15 | logging.level.org.hibernate.SQL=ERROR 16 | logging.level.org.hibernate.type=ERROR 17 | logging.level.org.springframework=ERROR 18 | logging.level.com=ERROR 19 | logging.level.org.springframework.security=ERROR 20 | logging.level.org.springframework.cache=ERROR 21 | logging.level.com.stacksimplify.restservices=INFO 22 | 23 | #Actuator Endpoints 24 | management.endpoints.web.exposure.include=* 25 | 26 | #security.oauth2.resource.jwt.key-uri=http://localhost:8080/auth/oauth/token_key 27 | keystore.password=redhat 28 | 29 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-04-ALB-Ingress-SSL/kube-manifests/05-Nginx-App1-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app1-nginx-deployment 5 | labels: 6 | app: app1-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app1-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app1-nginx 16 | spec: 17 | containers: 18 | - name: app1-nginx 19 | image: stacksimplify/kube-nginxapp1:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app1-nginx-nodeport-service 27 | labels: 28 | app: app1-nginx 29 | annotations: 30 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 31 | alb.ingress.kubernetes.io/healthcheck-path: /app1/index.html 32 | spec: 33 | type: NodePort 34 | selector: 35 | app: app1-nginx 36 | ports: 37 | - port: 80 38 | targetPort: 80 39 | 40 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-04-ALB-Ingress-SSL/kube-manifests/06-Nginx-App2-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app2-nginx-deployment 5 | labels: 6 | app: app2-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app2-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app2-nginx 16 | spec: 17 | containers: 18 | - name: app2-nginx 19 | image: stacksimplify/kube-nginxapp2:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app2-nginx-nodeport-service 27 | labels: 28 | app: app2-nginx 29 | annotations: 30 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 31 | alb.ingress.kubernetes.io/healthcheck-path: /app2/index.html 32 | spec: 33 | type: NodePort 34 | selector: 35 | app: app2-nginx 36 | ports: 37 | - port: 80 38 | targetPort: 80 39 | 40 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Server Settings 2 | server.port = 8096 3 | server.servlet.context-path=/ 4 | 5 | # Logging Settings 6 | logging.level.org.hibernate.SQL=ERROR 7 | logging.level.org.hibernate.type=ERROR 8 | logging.level.org.springframework=ERROR 9 | logging.level.com=ERROR 10 | logging.level.com.stacksimplify.notifications=INFO 11 | 12 | # AWS SES - mail server properties 13 | mail.server.host=${AWS_MAIL_SERVER_HOST:replace-your-aws-details-for-local-dev-tests} 14 | mail.server.port=587 15 | mail.server.auth=true 16 | mail.server.enableTls=true 17 | mail.server.username=${AWS_MAIL_SERVER_USERNAME:replace-your-aws-details-for-local-dev-tests} 18 | mail.server.password=${AWS_MAIL_SERVER_PASSWORD:replace-your-aws-details-for-local-dev-tests} 19 | mail.server.from.address=${AWS_MAIL_SERVER_FROM_ADDRESS:replace-your-aws-details-for-local-dev-tests} 20 | 21 | #AWS SMTP Server Environment Variables 22 | #AWS_MAIL_SERVER_HOST 23 | #AWS_MAIL_SERVER_USERNAME 24 | #AWS_MAIL_SERVER_PASSWORD 25 | #AWS_MAIL_SERVER_FROM_ADDRESS 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-03-UserManagement-MicroService-with-MySQLDB/kube-manifests/06-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | containers: 18 | - name: usermgmt-restapp 19 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 20 | ports: 21 | - containerPort: 8095 22 | env: 23 | - name: DB_HOSTNAME 24 | value: "mysql" 25 | - name: DB_PORT 26 | value: "3306" 27 | - name: DB_NAME 28 | value: "usermgmt" 29 | - name: DB_USERNAME 30 | value: "root" 31 | - name: DB_PASSWORD 32 | value: "dbpassword11" 33 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-05-ALB-Ingress-SSL-Redirect/kube-manifests/05-Nginx-App1-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app1-nginx-deployment 5 | labels: 6 | app: app1-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app1-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app1-nginx 16 | spec: 17 | containers: 18 | - name: app1-nginx 19 | image: stacksimplify/kube-nginxapp1:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app1-nginx-nodeport-service 27 | labels: 28 | app: app1-nginx 29 | annotations: 30 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 31 | alb.ingress.kubernetes.io/healthcheck-path: /app1/index.html 32 | spec: 33 | type: NodePort 34 | selector: 35 | app: app1-nginx 36 | ports: 37 | - port: 80 38 | targetPort: 80 39 | 40 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-05-ALB-Ingress-SSL-Redirect/kube-manifests/06-Nginx-App2-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app2-nginx-deployment 5 | labels: 6 | app: app2-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app2-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app2-nginx 16 | spec: 17 | containers: 18 | - name: app2-nginx 19 | image: stacksimplify/kube-nginxapp2:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app2-nginx-nodeport-service 27 | labels: 28 | app: app2-nginx 29 | annotations: 30 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 31 | alb.ingress.kubernetes.io/healthcheck-path: /app2/index.html 32 | spec: 33 | type: NodePort 34 | selector: 35 | app: app2-nginx 36 | ports: 37 | - port: 80 38 | targetPort: 80 39 | 40 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/stacksimplify/notifications/entities/HelloMessage.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications.entities; 2 | 3 | public class HelloMessage { 4 | 5 | private String applicationname; 6 | private String appversion; 7 | private String message; 8 | 9 | 10 | 11 | public String getApplicationname() { 12 | return applicationname; 13 | } 14 | public void setApplicationname(String applicationname) { 15 | this.applicationname = applicationname; 16 | } 17 | public String getAppversion() { 18 | return appversion; 19 | } 20 | public void setAppversion(String appversion) { 21 | this.appversion = appversion; 22 | } 23 | public String getMessage() { 24 | return message; 25 | } 26 | public void setMessage(String message) { 27 | this.message = message; 28 | } 29 | public HelloMessage(String applicationname, String appversion, String message) { 30 | super(); 31 | this.applicationname = applicationname; 32 | this.appversion = appversion; 33 | this.message = message; 34 | } 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-03-ALB-Ingress-ContextPath-Based-Routing/kube-manifests/06-Nginx-App2-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app2-nginx-deployment 5 | labels: 6 | app: app2-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app2-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app2-nginx 16 | spec: 17 | containers: 18 | - name: app2-nginx 19 | image: stacksimplify/kube-nginxapp2:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app2-nginx-nodeport-service 27 | labels: 28 | app: app2-nginx 29 | annotations: 30 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 31 | alb.ingress.kubernetes.io/healthcheck-path: /app2/index.html 32 | spec: 33 | type: NodePort 34 | selector: 35 | app: app2-nginx 36 | ports: 37 | - port: 80 38 | targetPort: 80 39 | 40 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-03-ALB-Ingress-ContextPath-Based-Routing/kube-manifests/05-Nginx-App1-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app1-nginx-deployment 5 | labels: 6 | app: app1-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app1-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app1-nginx 16 | spec: 17 | containers: 18 | - name: app1-nginx 19 | image: stacksimplify/kube-nginxapp1:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app1-nginx-nodeport-service 27 | labels: 28 | app: app1-nginx 29 | annotations: 30 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 31 | alb.ingress.kubernetes.io/healthcheck-path: /app1/index.html 32 | spec: 33 | type: NodePort 34 | selector: 35 | app: app1-nginx 36 | ports: 37 | - port: 80 38 | targetPort: 80 39 | 40 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-06-ALB-Ingress-ExternalDNS/08-06-02-Use-ExternalDNS-for-Apps/kube-manifests/06-Nginx-App2-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app2-nginx-deployment 5 | labels: 6 | app: app2-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app2-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app2-nginx 16 | spec: 17 | containers: 18 | - name: app2-nginx 19 | image: stacksimplify/kube-nginxapp2:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app2-nginx-nodeport-service 27 | labels: 28 | app: app2-nginx 29 | annotations: 30 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 31 | alb.ingress.kubernetes.io/healthcheck-path: /app2/index.html 32 | spec: 33 | type: NodePort 34 | selector: 35 | app: app2-nginx 36 | ports: 37 | - port: 80 38 | targetPort: 80 39 | 40 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-06-ALB-Ingress-ExternalDNS/08-06-02-Use-ExternalDNS-for-Apps/kube-manifests/05-Nginx-App1-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app1-nginx-deployment 5 | labels: 6 | app: app1-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app1-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app1-nginx 16 | spec: 17 | containers: 18 | - name: app1-nginx 19 | image: stacksimplify/kube-nginxapp1:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app1-nginx-nodeport-service 27 | labels: 28 | app: app1-nginx 29 | annotations: 30 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 31 | alb.ingress.kubernetes.io/healthcheck-path: /app1/index.html 32 | spec: 33 | type: NodePort 34 | selector: 35 | app: app1-nginx 36 | ports: 37 | - port: 80 38 | targetPort: 80 39 | 40 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-01-Kubernetes-Secrets/kube-manifests/06-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | containers: 18 | - name: usermgmt-restapp 19 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 20 | ports: 21 | - containerPort: 8095 22 | env: 23 | - name: DB_HOSTNAME 24 | value: "mysql" 25 | - name: DB_PORT 26 | value: "3306" 27 | - name: DB_NAME 28 | value: "usermgmt" 29 | - name: DB_USERNAME 30 | value: "root" 31 | - name: DB_PASSWORD 32 | valueFrom: 33 | secretKeyRef: 34 | name: mysql-db-password 35 | key: db-password 36 | -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-02-SC-PVC-ConfigMap-MySQL/kube-manifests/04-mysql-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: mysql 10 | strategy: 11 | type: Recreate 12 | template: 13 | metadata: 14 | labels: 15 | app: mysql 16 | spec: 17 | containers: 18 | - name: mysql 19 | image: mysql:5.6 20 | env: 21 | - name: MYSQL_ROOT_PASSWORD 22 | value: dbpassword11 23 | ports: 24 | - containerPort: 3306 25 | name: mysql 26 | volumeMounts: 27 | - name: mysql-persistent-storage 28 | mountPath: /var/lib/mysql 29 | - name: usermanagement-dbcreation-script 30 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 31 | volumes: 32 | - name: mysql-persistent-storage 33 | persistentVolumeClaim: 34 | claimName: ebs-mysql-pv-claim 35 | - name: usermanagement-dbcreation-script 36 | configMap: 37 | name: usermanagement-dbcreation-script -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-02-ALB-Ingress-Basics/kube-manifests/05-ALB-Ingress-Basic.yml: -------------------------------------------------------------------------------- 1 | # Annotations Reference: https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/ 2 | apiVersion: extensions/v1beta1 3 | kind: Ingress 4 | metadata: 5 | name: ingress-usermgmt-restapp-service 6 | labels: 7 | app: usermgmt-restapp 8 | annotations: 9 | # Ingress Core Settings 10 | kubernetes.io/ingress.class: "alb" 11 | alb.ingress.kubernetes.io/scheme: internet-facing 12 | # Health Check Settings 13 | alb.ingress.kubernetes.io/healthcheck-protocol: HTTP 14 | alb.ingress.kubernetes.io/healthcheck-port: traffic-port 15 | alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 16 | alb.ingress.kubernetes.io/healthcheck-interval-seconds: '15' 17 | alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5' 18 | alb.ingress.kubernetes.io/success-codes: '200' 19 | alb.ingress.kubernetes.io/healthy-threshold-count: '2' 20 | alb.ingress.kubernetes.io/unhealthy-threshold-count: '2' 21 | spec: 22 | rules: 23 | - http: 24 | paths: 25 | - path: /* 26 | backend: 27 | serviceName: usermgmt-restapp-nodeport-service 28 | servicePort: 8095 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-03-Namespaces-ResourceQuota/kube-manifests/00-namespace-LimitRange-ResourceQuota.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: dev3 5 | --- 6 | apiVersion: v1 7 | kind: LimitRange 8 | metadata: 9 | name: default-cpu-mem-limit-range 10 | namespace: dev3 11 | spec: 12 | limits: 13 | - default: 14 | memory: "512Mi" # If not specified the Container's memory limit is set to 512Mi, which is the default memory limit for the namespace. 15 | cpu: "500m" # If not specified default limit is 1 vCPU per container 16 | defaultRequest: 17 | memory: "256Mi" # If not specified default it will take from whatever specified in limits.default.memory 18 | cpu: "300m" # If not specified default it will take from whatever specified in limits.default.cpu 19 | type: Container 20 | --- 21 | apiVersion: v1 22 | kind: ResourceQuota 23 | metadata: 24 | name: ns-resource-quota 25 | namespace: dev3 26 | spec: 27 | hard: 28 | requests.cpu: "1" 29 | requests.memory: 1Gi 30 | limits.cpu: "2" 31 | limits.memory: 2Gi 32 | pods: "5" 33 | configmaps: "5" 34 | persistentvolumeclaims: "5" 35 | secrets: "5" 36 | services: "5" -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/04-03-UserManagement-MicroService-with-MySQLDB/kube-manifests/04-mysql-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: mysql 10 | strategy: 11 | type: Recreate 12 | template: 13 | metadata: 14 | labels: 15 | app: mysql 16 | spec: 17 | containers: 18 | - name: mysql 19 | image: mysql:5.6 20 | env: 21 | - name: MYSQL_ROOT_PASSWORD 22 | value: dbpassword11 23 | ports: 24 | - containerPort: 3306 25 | name: mysql 26 | volumeMounts: 27 | - name: mysql-persistent-storage 28 | mountPath: /var/lib/mysql 29 | - name: usermanagement-dbcreation-script 30 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 31 | volumes: 32 | - name: mysql-persistent-storage 33 | persistentVolumeClaim: 34 | claimName: ebs-mysql-pv-claim 35 | - name: usermanagement-dbcreation-script 36 | configMap: 37 | name: usermanagement-dbcreation-script -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-01-Fargate-Profile-Basic/kube-manifests/02-Nginx-App1-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app1-nginx-deployment 5 | labels: 6 | app: app1-nginx 7 | namespace: fp-dev 8 | spec: 9 | replicas: 2 10 | selector: 11 | matchLabels: 12 | app: app1-nginx 13 | template: 14 | metadata: 15 | labels: 16 | app: app1-nginx 17 | spec: 18 | containers: 19 | - name: app1-nginx 20 | image: stacksimplify/kube-nginxapp1:1.0.0 21 | ports: 22 | - containerPort: 80 23 | resources: 24 | requests: 25 | memory: "128Mi" 26 | cpu: "500m" 27 | limits: 28 | memory: "500Mi" 29 | cpu: "1000m" 30 | --- 31 | apiVersion: v1 32 | kind: Service 33 | metadata: 34 | name: app1-nginx-nodeport-service 35 | labels: 36 | app: app1-nginx 37 | namespace: fp-dev 38 | annotations: 39 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 40 | alb.ingress.kubernetes.io/healthcheck-path: /app1/index.html 41 | spec: 42 | type: NodePort 43 | selector: 44 | app: app1-nginx 45 | ports: 46 | - port: 80 47 | targetPort: 80 48 | 49 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/xray/AwsXrayConfig.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.xray; 2 | import java.net.URL; 3 | 4 | import javax.servlet.Filter; 5 | 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | import com.amazonaws.xray.AWSXRay; 10 | import com.amazonaws.xray.AWSXRayRecorderBuilder; 11 | import com.amazonaws.xray.javax.servlet.AWSXRayServletFilter; 12 | import com.amazonaws.xray.plugins.EC2Plugin; 13 | import com.amazonaws.xray.plugins.EKSPlugin; 14 | import com.amazonaws.xray.plugins.ElasticBeanstalkPlugin; 15 | import com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy; 16 | 17 | @Configuration 18 | public class AwsXrayConfig { 19 | @Bean 20 | public Filter TracingFilter() { 21 | return new AWSXRayServletFilter("usermanagement-microservice"); 22 | } 23 | 24 | static { 25 | AWSXRayRecorderBuilder builder = AWSXRayRecorderBuilder.standard() 26 | .withPlugin(new EC2Plugin()) 27 | .withPlugin(new ElasticBeanstalkPlugin()) 28 | .withPlugin(new EKSPlugin()); 29 | 30 | URL ruleFile = AwsXrayConfig.class.getResource("/sampling-rules.json"); 31 | builder.withSamplingStrategy(new LocalizedSamplingStrategy(ruleFile)); 32 | 33 | AWSXRay.setGlobalRecorder(builder.build()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/stacksimplify/notifications/xray/AwsXrayConfig.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications.xray; 2 | import java.net.URL; 3 | 4 | import javax.servlet.Filter; 5 | 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | import com.amazonaws.xray.AWSXRay; 10 | import com.amazonaws.xray.AWSXRayRecorderBuilder; 11 | import com.amazonaws.xray.javax.servlet.AWSXRayServletFilter; 12 | import com.amazonaws.xray.plugins.EC2Plugin; 13 | import com.amazonaws.xray.plugins.EKSPlugin; 14 | import com.amazonaws.xray.plugins.ElasticBeanstalkPlugin; 15 | import com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy; 16 | 17 | @Configuration 18 | public class AwsXrayConfig { 19 | @Bean 20 | public Filter TracingFilter() { 21 | return new AWSXRayServletFilter("notification-microservice"); 22 | } 23 | 24 | static { 25 | AWSXRayRecorderBuilder builder = AWSXRayRecorderBuilder.standard() 26 | .withPlugin(new EC2Plugin()) 27 | .withPlugin(new ElasticBeanstalkPlugin()) 28 | .withPlugin(new EKSPlugin()); 29 | 30 | URL ruleFile = AwsXrayConfig.class.getResource("/sampling-rules.json"); 31 | builder.withSamplingStrategy(new LocalizedSamplingStrategy(ruleFile)); 32 | 33 | AWSXRay.setGlobalRecorder(builder.build()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-01-Kubernetes-Secrets/kube-manifests/04-mysql-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: mysql 10 | strategy: 11 | type: Recreate 12 | template: 13 | metadata: 14 | labels: 15 | app: mysql 16 | spec: 17 | containers: 18 | - name: mysql 19 | image: mysql:5.6 20 | env: 21 | - name: MYSQL_ROOT_PASSWORD 22 | valueFrom: 23 | secretKeyRef: 24 | name: mysql-db-password 25 | key: db-password 26 | ports: 27 | - containerPort: 3306 28 | name: mysql 29 | volumeMounts: 30 | - name: mysql-persistent-storage 31 | mountPath: /var/lib/mysql 32 | - name: usermanagement-dbcreation-script 33 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 34 | volumes: 35 | - name: mysql-persistent-storage 36 | persistentVolumeClaim: 37 | claimName: ebs-mysql-pv-claim 38 | - name: usermanagement-dbcreation-script 39 | configMap: 40 | name: usermanagement-dbcreation-script -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-02-Fargate-Profiles-Advanced-YAML/kube-manifests/02-Applications/01-ns-app1/02-Nginx-App1-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app1-nginx-deployment 5 | labels: 6 | app: app1-nginx 7 | namespace: ns-app1 8 | spec: 9 | replicas: 2 10 | selector: 11 | matchLabels: 12 | app: app1-nginx 13 | template: 14 | metadata: 15 | labels: 16 | app: app1-nginx 17 | spec: 18 | containers: 19 | - name: app1-nginx 20 | image: stacksimplify/kube-nginxapp1:1.0.0 21 | ports: 22 | - containerPort: 80 23 | resources: 24 | requests: 25 | memory: "128Mi" 26 | cpu: "500m" 27 | limits: 28 | memory: "500Mi" 29 | cpu: "1000m" 30 | --- 31 | apiVersion: v1 32 | kind: Service 33 | metadata: 34 | name: app1-nginx-nodeport-service 35 | labels: 36 | app: app1-nginx 37 | namespace: ns-app1 38 | annotations: 39 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 40 | alb.ingress.kubernetes.io/healthcheck-path: /app1/index.html 41 | spec: 42 | type: NodePort 43 | selector: 44 | app: app1-nginx 45 | ports: 46 | - port: 80 47 | targetPort: 80 48 | 49 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-02-Kubernetes-Init-Containers/kube-manifests/04-mysql-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: mysql 10 | strategy: 11 | type: Recreate 12 | template: 13 | metadata: 14 | labels: 15 | app: mysql 16 | spec: 17 | containers: 18 | - name: mysql 19 | image: mysql:5.6 20 | env: 21 | - name: MYSQL_ROOT_PASSWORD 22 | valueFrom: 23 | secretKeyRef: 24 | name: mysql-db-password 25 | key: db-password 26 | ports: 27 | - containerPort: 3306 28 | name: mysql 29 | volumeMounts: 30 | - name: mysql-persistent-storage 31 | mountPath: /var/lib/mysql 32 | - name: usermanagement-dbcreation-script 33 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 34 | volumes: 35 | - name: mysql-persistent-storage 36 | persistentVolumeClaim: 37 | claimName: ebs-mysql-pv-claim 38 | - name: usermanagement-dbcreation-script 39 | configMap: 40 | name: usermanagement-dbcreation-script -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-04-Kubernetes-Requests-Limits/kube-manifests/04-mysql-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: mysql 10 | strategy: 11 | type: Recreate 12 | template: 13 | metadata: 14 | labels: 15 | app: mysql 16 | spec: 17 | containers: 18 | - name: mysql 19 | image: mysql:5.6 20 | env: 21 | - name: MYSQL_ROOT_PASSWORD 22 | valueFrom: 23 | secretKeyRef: 24 | name: mysql-db-password 25 | key: db-password 26 | ports: 27 | - containerPort: 3306 28 | name: mysql 29 | volumeMounts: 30 | - name: mysql-persistent-storage 31 | mountPath: /var/lib/mysql 32 | - name: usermanagement-dbcreation-script 33 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 34 | volumes: 35 | - name: mysql-persistent-storage 36 | persistentVolumeClaim: 37 | claimName: ebs-mysql-pv-claim 38 | - name: usermanagement-dbcreation-script 39 | configMap: 40 | name: usermanagement-dbcreation-script -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-03-Kubernetes-Liveness-and-Readiness-Probes/kube-manifests/04-mysql-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: mysql 10 | strategy: 11 | type: Recreate 12 | template: 13 | metadata: 14 | labels: 15 | app: mysql 16 | spec: 17 | containers: 18 | - name: mysql 19 | image: mysql:5.6 20 | env: 21 | - name: MYSQL_ROOT_PASSWORD 22 | valueFrom: 23 | secretKeyRef: 24 | name: mysql-db-password 25 | key: db-password 26 | ports: 27 | - containerPort: 3306 28 | name: mysql 29 | volumeMounts: 30 | - name: mysql-persistent-storage 31 | mountPath: /var/lib/mysql 32 | - name: usermanagement-dbcreation-script 33 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 34 | volumes: 35 | - name: mysql-persistent-storage 36 | persistentVolumeClaim: 37 | claimName: ebs-mysql-pv-claim 38 | - name: usermanagement-dbcreation-script 39 | configMap: 40 | name: usermanagement-dbcreation-script -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-01-Namespaces-Imperative/kube-manifests/04-mysql-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: mysql 10 | strategy: 11 | type: Recreate 12 | template: 13 | metadata: 14 | labels: 15 | app: mysql 16 | spec: 17 | containers: 18 | - name: mysql 19 | image: mysql:5.6 20 | env: 21 | - name: MYSQL_ROOT_PASSWORD 22 | valueFrom: 23 | secretKeyRef: 24 | name: mysql-db-password 25 | key: db-password 26 | ports: 27 | - containerPort: 3306 28 | name: mysql 29 | volumeMounts: 30 | - name: mysql-persistent-storage 31 | mountPath: /var/lib/mysql 32 | - name: usermanagement-dbcreation-script 33 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 34 | volumes: 35 | - name: mysql-persistent-storage 36 | persistentVolumeClaim: 37 | claimName: ebs-mysql-pv-claim 38 | - name: usermanagement-dbcreation-script 39 | configMap: 40 | name: usermanagement-dbcreation-script -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/stacksimplify/notifications/core/dtos/EmailMessage.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications.core.dtos; 2 | 3 | import java.util.List; 4 | 5 | public class EmailMessage { 6 | 7 | private String subject; 8 | private String content; 9 | private String from; 10 | private List toEmails; 11 | private List ccEmails; 12 | private List bccEmails; 13 | 14 | public String getSubject() { 15 | return subject; 16 | } 17 | 18 | public void setSubject(String subject) { 19 | this.subject = subject; 20 | } 21 | 22 | public String getContent() { 23 | return content; 24 | } 25 | 26 | public void setContent(String content) { 27 | this.content = content; 28 | } 29 | 30 | public String getFrom() { 31 | return from; 32 | } 33 | 34 | public void setFrom(String from) { 35 | this.from = from; 36 | } 37 | 38 | public List getToEmails() { 39 | return toEmails; 40 | } 41 | 42 | public void setToEmails(List toEmails) { 43 | this.toEmails = toEmails; 44 | } 45 | 46 | public List getCcEmails() { 47 | return ccEmails; 48 | } 49 | 50 | public void setCcEmails(List ccEmails) { 51 | this.ccEmails = ccEmails; 52 | } 53 | 54 | public List getBccEmails() { 55 | return bccEmails; 56 | } 57 | 58 | public void setBccEmails(List bccEmails) { 59 | this.bccEmails = bccEmails; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/README.md: -------------------------------------------------------------------------------- 1 | # Load Balancing workloads on EKS using AWS Application Load Balancer 2 | 3 | ## Topics 4 | - We will be looking in to this topic very extensively in a step by step and module by module model. 5 | - The below will be the list of topics covered as part of AWS ALB Ingress Controller 6 | 7 | 8 | | S.No | Topic Name | 9 | | ------------- | ------------- | 10 | | 1. | ALB Ingress Controller Installation | 11 | | 2. | ALB Ingress Basics | 12 | | 3. | ALB Ingress Context Path based Routing | 13 | | 4. | ALB Ingress SSL | 14 | | 5. | ALB Ingress SSL Redirect (HTTP to HTTPS) | 15 | | 6. | ALB Ingress External DNS | 16 | 17 | 18 | ## References: 19 | - Good to refer all the below for additional understanding. 20 | 21 | ### ALB Pre-requisite Setup - References: 22 | - https://github.com/kubernetes-sigs/aws-alb-ingress-controller 23 | - Examples: 24 | - https://github.com/kubernetes-sigs/aws-alb-ingress-controller/tree/master/docs/examples/2048 25 | 26 | ### AWS ALB Ingress Annotations Reference 27 | - https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/ 28 | 29 | ### eksctl getting started 30 | - https://eksctl.io/introduction/#getting-started 31 | 32 | ### External DNS 33 | - https://github.com/kubernetes-sigs/external-dns 34 | - https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/alb-ingress.md 35 | - https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/authorizationserver/users/dtos/EmailMessage.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.authorizationserver.users.dtos; 2 | 3 | import java.util.List; 4 | 5 | public class EmailMessage { 6 | 7 | private String subject; 8 | private String content; 9 | private String from; 10 | private List toEmails; 11 | private List ccEmails; 12 | private List bccEmails; 13 | 14 | public String getSubject() { 15 | return subject; 16 | } 17 | 18 | public void setSubject(String subject) { 19 | this.subject = subject; 20 | } 21 | 22 | public String getContent() { 23 | return content; 24 | } 25 | 26 | public void setContent(String content) { 27 | this.content = content; 28 | } 29 | 30 | public String getFrom() { 31 | return from; 32 | } 33 | 34 | public void setFrom(String from) { 35 | this.from = from; 36 | } 37 | 38 | public List getToEmails() { 39 | return toEmails; 40 | } 41 | 42 | public void setToEmails(List toEmails) { 43 | this.toEmails = toEmails; 44 | } 45 | 46 | public List getCcEmails() { 47 | return ccEmails; 48 | } 49 | 50 | public void setCcEmails(List ccEmails) { 51 | this.ccEmails = ccEmails; 52 | } 53 | 54 | public List getBccEmails() { 55 | return bccEmails; 56 | } 57 | 58 | public void setBccEmails(List bccEmails) { 59 | this.bccEmails = bccEmails; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /09-EKS-Workloads-on-Fargate/09-02-Fargate-Profiles-Advanced-YAML/kube-manifests/02-Applications/02-ns-app2/02-Nginx-App2-Deployment-and-NodePortService.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app2-nginx-deployment 5 | labels: 6 | app: app2-nginx 7 | namespace: ns-app2 8 | spec: 9 | replicas: 2 10 | selector: 11 | matchLabels: 12 | app: app2-nginx 13 | template: 14 | metadata: 15 | labels: 16 | app: app2-nginx 17 | spec: 18 | containers: 19 | - name: app2-nginx 20 | image: stacksimplify/kube-nginxapp2:1.0.0 21 | ports: 22 | - containerPort: 80 23 | resources: 24 | requests: 25 | memory: "128Mi" 26 | cpu: "500m" 27 | limits: 28 | memory: "500Mi" 29 | cpu: "1000m" 30 | --- 31 | apiVersion: v1 32 | kind: Service 33 | metadata: 34 | name: app2-nginx-nodeport-service 35 | labels: 36 | app: app2-nginx 37 | namespace: ns-app2 38 | annotations: 39 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 40 | alb.ingress.kubernetes.io/healthcheck-path: /app2/index.html 41 | # For Fargate 42 | alb.ingress.kubernetes.io/target-type: ip 43 | spec: 44 | type: NodePort 45 | selector: 46 | app: app2-nginx 47 | ports: 48 | - port: 80 49 | targetPort: 80 50 | 51 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/authorizationserver/users/services/UserService.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.authorizationserver.users.services; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.userdetails.UserDetails; 5 | import org.springframework.security.core.userdetails.UserDetailsService; 6 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.util.Assert; 9 | 10 | import com.stacksimplify.restservices.authorizationserver.users.entities.User; 11 | import com.stacksimplify.restservices.authorizationserver.users.repositories.UserRepository; 12 | 13 | @Service("userDetailsService") 14 | public class UserService implements UserDetailsService { 15 | 16 | @Autowired 17 | private UserRepository userRepository; 18 | 19 | @Override 20 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 21 | Assert.hasLength(username, "Username cannot be empty."); 22 | User user = userRepository.findById(username) 23 | .orElseThrow(() -> new UsernameNotFoundException("User account can not be located!")); 24 | return user; 25 | } 26 | 27 | public Boolean matchesPolicy(String passwd) { 28 | String pattern = "(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])(?=\\S+$).{8,}"; 29 | return passwd.matches(pattern); 30 | } 31 | } -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-03-Namespaces-ResourceQuota/kube-manifests/04-mysql-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | namespace: dev3 6 | spec: 7 | replicas: 1 8 | selector: 9 | matchLabels: 10 | app: mysql 11 | strategy: 12 | type: Recreate 13 | template: 14 | metadata: 15 | labels: 16 | app: mysql 17 | spec: 18 | containers: 19 | - name: mysql 20 | image: mysql:5.6 21 | env: 22 | - name: MYSQL_ROOT_PASSWORD 23 | valueFrom: 24 | secretKeyRef: 25 | name: mysql-db-password 26 | key: db-password 27 | ports: 28 | - containerPort: 3306 29 | name: mysql 30 | volumeMounts: 31 | - name: mysql-persistent-storage 32 | mountPath: /var/lib/mysql 33 | - name: usermanagement-dbcreation-script 34 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 35 | volumes: 36 | - name: mysql-persistent-storage 37 | persistentVolumeClaim: 38 | claimName: ebs-mysql-pv-claim 39 | - name: usermanagement-dbcreation-script 40 | configMap: 41 | name: usermanagement-dbcreation-script 42 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-02-Namespaces-LimitRange-default/kube-manifests/04-mysql-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | namespace: dev3 6 | spec: 7 | replicas: 1 8 | selector: 9 | matchLabels: 10 | app: mysql 11 | strategy: 12 | type: Recreate 13 | template: 14 | metadata: 15 | labels: 16 | app: mysql 17 | spec: 18 | containers: 19 | - name: mysql 20 | image: mysql:5.6 21 | env: 22 | - name: MYSQL_ROOT_PASSWORD 23 | valueFrom: 24 | secretKeyRef: 25 | name: mysql-db-password 26 | key: db-password 27 | ports: 28 | - containerPort: 3306 29 | name: mysql 30 | volumeMounts: 31 | - name: mysql-persistent-storage 32 | mountPath: /var/lib/mysql 33 | - name: usermanagement-dbcreation-script 34 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 35 | volumes: 36 | - name: mysql-persistent-storage 37 | persistentVolumeClaim: 38 | claimName: ebs-mysql-pv-claim 39 | - name: usermanagement-dbcreation-script 40 | configMap: 41 | name: usermanagement-dbcreation-script 42 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-02-Kubernetes-Init-Containers/kube-manifests/06-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "root" 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-01-ALB-Ingress-Install/ALBIngress-rbac-role.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | labels: 6 | app.kubernetes.io/name: alb-ingress-controller 7 | name: alb-ingress-controller 8 | rules: 9 | - apiGroups: 10 | - "" 11 | - extensions 12 | resources: 13 | - configmaps 14 | - endpoints 15 | - events 16 | - ingresses 17 | - ingresses/status 18 | - services 19 | - pods/status 20 | verbs: 21 | - create 22 | - get 23 | - list 24 | - update 25 | - watch 26 | - patch 27 | - apiGroups: 28 | - "" 29 | - extensions 30 | resources: 31 | - nodes 32 | - pods 33 | - secrets 34 | - services 35 | - namespaces 36 | verbs: 37 | - get 38 | - list 39 | - watch 40 | --- 41 | apiVersion: rbac.authorization.k8s.io/v1 42 | kind: ClusterRoleBinding 43 | metadata: 44 | labels: 45 | app.kubernetes.io/name: alb-ingress-controller 46 | name: alb-ingress-controller 47 | roleRef: 48 | apiGroup: rbac.authorization.k8s.io 49 | kind: ClusterRole 50 | name: alb-ingress-controller 51 | subjects: 52 | - kind: ServiceAccount 53 | name: alb-ingress-controller 54 | namespace: kube-system 55 | --- 56 | apiVersion: v1 57 | kind: ServiceAccount 58 | metadata: 59 | labels: 60 | app.kubernetes.io/name: alb-ingress-controller 61 | name: alb-ingress-controller 62 | namespace: kube-system 63 | ... -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-02-Classic-LoadBalancer-CLB/README.md: -------------------------------------------------------------------------------- 1 | # AWS - Classic Load Balancer - CLB 2 | 3 | ## Step-01: Create AWS Classic Load Balancer Kubernetes Manifest & Deploy 4 | - **04-ClassicLoadBalancer.yml** 5 | ```yml 6 | apiVersion: v1 7 | kind: Service 8 | metadata: 9 | name: clb-usermgmt-restapp 10 | labels: 11 | app: usermgmt-restapp 12 | spec: 13 | type: LoadBalancer # Regular k8s Service manifest with type as LoadBalancer 14 | selector: 15 | app: usermgmt-restapp 16 | ports: 17 | - port: 80 18 | targetPort: 8095 19 | ``` 20 | - **Deploy all Manifest** 21 | ``` 22 | # Deploy all manifests 23 | kubectl apply -f kube-manifests/ 24 | 25 | # List Services (Verify newly created CLB Service) 26 | kubectl get svc 27 | 28 | # Verify Pods 29 | kubectl get pods 30 | ``` 31 | 32 | ## Step-02: Verify the deployment 33 | - Verify if new CLB got created 34 | - Go to Services -> EC2 -> Load Balancing -> Load Balancers 35 | - CLB should be created 36 | - Copy DNS Name (Example: a85ae6e4030aa4513bd200f08f1eb9cc-7f13b3acc1bcaaa2.elb.us-east-1.amazonaws.com) 37 | - Go to Services -> EC2 -> Load Balancing -> Target Groups 38 | - Verify the health status, we should see active. 39 | - **Access Application** 40 | ``` 41 | # Access Application 42 | http:///usermgmt/health-status 43 | ``` 44 | 45 | ## Step-03: Clean Up 46 | ``` 47 | # Delete all Objects created 48 | kubectl delete -f kube-manifests/ 49 | 50 | # Verify current Kubernetes Objects 51 | kubectl get all 52 | ``` -------------------------------------------------------------------------------- /14-Microservices-Canary-Deployments/kube-manifests/04-NotificationMicroservice-Deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: v1-notification-microservice 5 | labels: 6 | app: notification-restapp 7 | spec: 8 | replicas: 2 9 | selector: 10 | matchLabels: 11 | app: notification-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: notification-restapp 16 | spec: 17 | containers: 18 | - name: notification-service 19 | image: stacksimplify/kube-notifications-microservice:3.0.0-AWS-XRay 20 | ports: 21 | - containerPort: 8096 22 | imagePullPolicy: Always 23 | env: 24 | - name: AWS_MAIL_SERVER_HOST 25 | value: "smtp-service" 26 | - name: AWS_MAIL_SERVER_USERNAME 27 | value: "AKIASUF7HC7SQJ6BCLVS" 28 | - name: AWS_MAIL_SERVER_PASSWORD 29 | value: "BARcmLiC68wgmhTy/cQvz/E8vFzeizGqdeASNtCs6+Nv" 30 | - name: AWS_MAIL_SERVER_FROM_ADDRESS 31 | value: "stacksimplify@gmail.com" 32 | - name: AWS_XRAY_TRACING_NAME 33 | value: "V1-Notification-Microservice" 34 | - name: AWS_XRAY_DAEMON_ADDRESS 35 | value: "xray-service.default:2000" 36 | - name: AWS_XRAY_CONTEXT_MISSING 37 | value: "LOG_ERROR" # Log an error and continue, Ideally RUNTIME_ERROR – Throw a runtime exception which is default option if not configured 38 | 39 | -------------------------------------------------------------------------------- /14-Microservices-Canary-Deployments/kube-manifests/08-V2-NotificationMicroservice-Deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: v2-notification-microservice 5 | labels: 6 | app: notification-restapp 7 | spec: 8 | replicas: 2 9 | selector: 10 | matchLabels: 11 | app: notification-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: notification-restapp 16 | spec: 17 | containers: 18 | - name: notification-service 19 | image: stacksimplify/kube-notifications-microservice:4.0.0-AWS-XRay 20 | ports: 21 | - containerPort: 8096 22 | imagePullPolicy: Always 23 | env: 24 | - name: AWS_MAIL_SERVER_HOST 25 | value: "smtp-service" 26 | - name: AWS_MAIL_SERVER_USERNAME 27 | value: "AKIASUF7HC7SQJ6BCLVS" 28 | - name: AWS_MAIL_SERVER_PASSWORD 29 | value: "BARcmLiC68wgmhTy/cQvz/E8vFzeizGqdeASNtCs6+Nv" 30 | - name: AWS_MAIL_SERVER_FROM_ADDRESS 31 | value: "stacksimplify@gmail.com" 32 | - name: AWS_XRAY_TRACING_NAME 33 | value: "V2-Notification-Microservice" 34 | - name: AWS_XRAY_DAEMON_ADDRESS 35 | value: "xray-service.default:2000" 36 | - name: AWS_XRAY_CONTEXT_MISSING 37 | value: "LOG_ERROR" # Log an error and continue, Ideally RUNTIME_ERROR – Throw a runtime exception which is default option if not configured 38 | 39 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/stacksimplify/notifications/configurations/CorsFilter.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications.configurations; 2 | 3 | import org.springframework.core.Ordered; 4 | import org.springframework.core.annotation.Order; 5 | import org.springframework.stereotype.Component; 6 | 7 | import javax.servlet.*; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.io.IOException; 11 | 12 | @Component 13 | @Order(Ordered.HIGHEST_PRECEDENCE) 14 | public class CorsFilter implements Filter { 15 | 16 | public CorsFilter() { 17 | } 18 | 19 | @Override 20 | public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { 21 | HttpServletResponse response = (HttpServletResponse) res; 22 | HttpServletRequest request = (HttpServletRequest) req; 23 | response.setHeader("Access-Control-Allow-Origin", "*"); 24 | response.setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, OPTIONS, DELETE"); 25 | response.setHeader("Access-Control-Max-Age", "3600"); 26 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with, authorization, content-type, token"); 27 | 28 | if ("OPTIONS".equalsIgnoreCase(request.getMethod())) { 29 | response.setStatus(HttpServletResponse.SC_OK); 30 | } else { 31 | chain.doFilter(req, res); 32 | } 33 | } 34 | 35 | @Override 36 | public void init(FilterConfig filterConfig) { 37 | } 38 | 39 | @Override 40 | public void destroy() { 41 | } 42 | } -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-03-Network-LoadBalancer-NLB/README.md: -------------------------------------------------------------------------------- 1 | # AWS - Network Load Balancer - NLB 2 | 3 | ## Step-01: Create AWS Network Load Balancer Kubernetes Manifest & Deploy 4 | - **04-NetworkLoadBalancer.yml** 5 | ```yml 6 | apiVersion: v1 7 | kind: Service 8 | metadata: 9 | name: nlb-usermgmt-restapp 10 | labels: 11 | app: usermgmt-restapp 12 | annotations: 13 | service.beta.kubernetes.io/aws-load-balancer-type: nlb # To create Network Load Balancer 14 | spec: 15 | type: LoadBalancer # Regular k8s Service manifest with type as LoadBalancer 16 | selector: 17 | app: usermgmt-restapp 18 | ports: 19 | - port: 80 20 | targetPort: 8095 21 | ``` 22 | - **Deploy all Manifest** 23 | ``` 24 | # Deploy all manifests 25 | kubectl apply -f kube-manifests/ 26 | 27 | # List Services (Verify newly created NLB Service) 28 | kubectl get svc 29 | 30 | # Verify Pods 31 | kubectl get pods 32 | ``` 33 | 34 | ## Step-02: Verify the deployment 35 | - Verify if new CLB got created 36 | - Go to Services -> EC2 -> Load Balancing -> Load Balancers 37 | - CLB should be created 38 | - Copy DNS Name (Example: a85ae6e4030aa4513bd200f08f1eb9cc-7f13b3acc1bcaaa2.elb.us-east-1.amazonaws.com) 39 | - Go to Services -> EC2 -> Load Balancing -> Target Groups 40 | - Verify the health status, we should see active. 41 | - **Access Application** 42 | ``` 43 | # Access Application 44 | http:///usermgmt/health-status 45 | ``` 46 | 47 | ## Step-03: Clean Up 48 | ``` 49 | # Delete all Objects created 50 | kubectl delete -f kube-manifests/ 51 | 52 | # Verify current Kubernetes Objects 53 | kubectl get all 54 | ``` 55 | 56 | 57 | -------------------------------------------------------------------------------- /13-Microservices-Distributed-Tracing-using-AWS-XRay-on-EKS/kube-manifests/02-Applications/04-NotificationMicroservice-Deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: v1-notification-microservice 5 | labels: 6 | app: notification-restapp 7 | track: stable 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: notification-restapp 13 | template: 14 | metadata: 15 | labels: 16 | app: notification-restapp 17 | track: stable 18 | spec: 19 | containers: 20 | - name: notification-service 21 | image: stacksimplify/kube-notifications-microservice:3.0.0-AWS-XRay 22 | ports: 23 | - containerPort: 8096 24 | imagePullPolicy: Always 25 | env: 26 | - name: AWS_MAIL_SERVER_HOST 27 | value: "smtp-service" 28 | - name: AWS_MAIL_SERVER_USERNAME 29 | value: "AKIASUF7HC7SQJ6BCLVS" 30 | - name: AWS_MAIL_SERVER_PASSWORD 31 | value: "BARcmLiC68wgmhTy/cQvz/E8vFzeizGqdeASNtCs6+Nv" 32 | - name: AWS_MAIL_SERVER_FROM_ADDRESS 33 | value: "stacksimplify@gmail.com" 34 | - name: AWS_XRAY_TRACING_NAME 35 | value: "V1-Notification-Microservice" 36 | - name: AWS_XRAY_DAEMON_ADDRESS 37 | value: "xray-service.default:2000" 38 | - name: AWS_XRAY_CONTEXT_MISSING 39 | value: "LOG_ERROR" # Log an error and continue, Ideally RUNTIME_ERROR – Throw a runtime exception which is default option if not configured 40 | 41 | -------------------------------------------------------------------------------- /04-EKS-Storage-with-EBS-ElasticBlockStore/README.md: -------------------------------------------------------------------------------- 1 | # AWS EKS Storage 2 | 3 | ## AWS EBS CSI Driver 4 | - We are going to use EBS CSI Driver and use EBS Volumes for persistence storage to MySQL Database 5 | 6 | ## Topics 7 | 1. Install EBS CSI Driver 8 | 2. Create MySQL Database Deployment & ClusterIP Service 9 | 3. Create User Management Microservice Deployment & NodePort Service 10 | 11 | ## Concepts 12 | | Kubernetes Object | YAML File | 13 | | ------------- | ------------- | 14 | | Storage Class | 01-storage-class.yml | 15 | | Persistent Volume Claim | 02-persistent-volume-claim.yml | 16 | | Config Map | 03-UserManagement-ConfigMap.yml | 17 | | Deployment, Environment Variables, Volumes, VolumeMounts | 04-mysql-deployment.yml | 18 | | ClusterIP Service | 05-mysql-clusterip-service.yml | 19 | | Deployment, Environment Variables | 06-UserManagementMicroservice-Deployment.yml | 20 | | NodePort Service | 07-UserManagement-Service.yml | 21 | 22 | 23 | 24 | ## References: 25 | - **Dynamic Volume Provisioning:** https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/ 26 | - https://github.com/kubernetes-sigs/aws-ebs-csi-driver/tree/master/deploy/kubernetes/overlays/stable 27 | - https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html 28 | - https://github.com/kubernetes-sigs/aws-ebs-csi-driver 29 | - https://github.com/kubernetes-sigs/aws-ebs-csi-driver/tree/master/examples/kubernetes/dynamic-provisioning 30 | - https://github.com/kubernetes-sigs/aws-ebs-csi-driver/tree/master/deploy/kubernetes/overlays/stable 31 | - https://github.com/kubernetes-sigs/aws-ebs-csi-driver 32 | - **Legacy: Will be deprecated** 33 | - https://kubernetes.io/docs/concepts/storage/storage-classes/#aws-ebs 34 | - https://docs.aws.amazon.com/eks/latest/userguide/storage-classes.html -------------------------------------------------------------------------------- /01-EKS-Create-Cluster-using-eksctl/01-03-EKSCluster-Pricing/README.md: -------------------------------------------------------------------------------- 1 | # EKS Cluster Pricing 2 | 3 | ## Steo-01: Very Important EKS Pricing Note 4 | - EKS is not free (Unlike other AWS Services) 5 | - In short, no free-tier for EKS. 6 | ### EKS Cluster Pricing 7 | - We pay $0.10 per hour for each Amazon EKS cluster 8 | - Per Day: $2.4 9 | - For 30 days: $72 10 | ### EKS Worker Nodes Pricing - EC2 11 | - You pay for AWS resources (e.g. EC2 instances or EBS volumes) 12 | - T3 Medium Server in N.Virginia 13 | - $0.0416 per Hour 14 | - Per Day: $0.9984 - Approximately $1 15 | - Per Month: $30 per 1 t3.medium server 16 | - Reference: https://aws.amazon.com/ec2/pricing/on-demand/ 17 | - In short, if we run 1 EKS Cluster and 1 t3.medium worker node **continuously** for 1 month, our bill is going to be around $102 to $110 18 | - If we take 5 days to complete this course, and if we run 1 EKS Cluster and 2 t3.medium Worker nodes continuosly for 5 days it will cost us approximately around $25. 19 | ### EKS Fargate Profile 20 | - AWS Fargate pricing is calculated based on the **vCPU and memory** resources used from the time you start to download your container image until the EKS Pod terminates. 21 | - **Reference:** https://aws.amazon.com/fargate/pricing/ 22 | - Amazon EKS support for AWS Fargate is available in us-east-1, us-east-2, eu-west-1, and ap-northeast-1. 23 | 24 | ### Important Notes 25 | - **Important Note-1:** If you are using your personal AWS Account, then ensure you delete and recreate cluster and worker nodes as and when needed. 26 | - **Important Note-2:** We cant stop our EC2 Instances which are in Kubernetes cluster unlike regular EC2 Instances. So we need to delete the worker nodes (Node Group) if we are not using it during our learning process. 27 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-03-Kubernetes-Liveness-and-Readiness-Probes/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes - Liveness & Readiness Probes 2 | 3 | ## Step-01: Introduction 4 | - Refer `Probes` slide for additional details 5 | 6 | ## Step-02: Create Liveness Probe with Command 7 | ```yml 8 | livenessProbe: 9 | exec: 10 | command: 11 | - /bin/sh 12 | - -c 13 | - nc -z localhost 8095 14 | initialDelaySeconds: 60 15 | periodSeconds: 10 16 | ``` 17 | 18 | ## Step-03: Create Readiness Probe with HTTP GET 19 | ```yml 20 | readinessProbe: 21 | httpGet: 22 | path: /usermgmt/health-status 23 | port: 8095 24 | initialDelaySeconds: 60 25 | periodSeconds: 10 26 | ``` 27 | 28 | 29 | ## Step-04: Create k8s objects & Test 30 | ``` 31 | # Create All Objects 32 | kubectl apply -f kube-manifests/ 33 | 34 | # List Pods 35 | kubectl get pods 36 | 37 | # Watch List Pods screen 38 | kubectl get pods -w 39 | 40 | # Describe Pod & Discuss about init container 41 | kubectl describe pod 42 | 43 | # Access Application Health Status Page 44 | http://:31231/usermgmt/health-status 45 | ``` 46 | - **Observation:** User Management Microservice pod witll not be in READY state to accept traffic until it completes the `initialDelaySeconds=60seconds`. 47 | 48 | ## Step-05: Clean-Up 49 | - Delete all k8s objects created as part of this section 50 | ``` 51 | # Delete All 52 | kubectl delete -f kube-manifests/ 53 | 54 | # List Pods 55 | kubectl get pods 56 | 57 | # Verify sc, pvc, pv 58 | kubectl get sc,pvc,pv 59 | ``` 60 | 61 | 62 | ## References: 63 | - https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ 64 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/configuration/CorsFilter.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.configuration; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.Filter; 6 | import javax.servlet.FilterChain; 7 | import javax.servlet.FilterConfig; 8 | import javax.servlet.ServletException; 9 | import javax.servlet.ServletRequest; 10 | import javax.servlet.ServletResponse; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | 14 | import org.springframework.core.Ordered; 15 | import org.springframework.core.annotation.Order; 16 | import org.springframework.stereotype.Component; 17 | 18 | @Component 19 | @Order(Ordered.HIGHEST_PRECEDENCE) 20 | public class CorsFilter implements Filter { 21 | 22 | public CorsFilter() { 23 | } 24 | 25 | @Override 26 | public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { 27 | HttpServletResponse response = (HttpServletResponse) res; 28 | HttpServletRequest request = (HttpServletRequest) req; 29 | response.setHeader("Access-Control-Allow-Origin", "*"); 30 | response.setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, OPTIONS, DELETE"); 31 | response.setHeader("Access-Control-Max-Age", "3600"); 32 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with, authorization, content-type, token"); 33 | 34 | if ("OPTIONS".equalsIgnoreCase(request.getMethod())) { 35 | response.setStatus(HttpServletResponse.SC_OK); 36 | } else { 37 | chain.doFilter(req, res); 38 | } 39 | } 40 | 41 | @Override 42 | public void init(FilterConfig filterConfig) { 43 | } 44 | 45 | @Override 46 | public void destroy() { 47 | } 48 | } -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/src/main/java/com/stacksimplify/notifications/configurations/MailConfig.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.notifications.configurations; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.mail.javamail.JavaMailSender; 7 | import org.springframework.mail.javamail.JavaMailSenderImpl; 8 | 9 | import java.util.Properties; 10 | 11 | @Configuration 12 | public class MailConfig { 13 | 14 | @Value("${mail.server.host}") 15 | private String mailServerHost; 16 | 17 | @Value("${mail.server.port}") 18 | private int mailServerPort; 19 | 20 | @Value("${mail.server.auth}") 21 | private String mailServerAuth; 22 | 23 | @Value("${mail.server.username}") 24 | private String mailUserName; 25 | 26 | @Value("${mail.server.password}") 27 | private String mailUserPassword; 28 | 29 | @Value("${mail.server.enableTls}") 30 | private String mailServerEnableTls; 31 | 32 | @Bean 33 | public JavaMailSender getMailSender() { 34 | JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); 35 | 36 | if (mailServerAuth.equalsIgnoreCase("true")) { 37 | mailSender.setUsername(mailUserName); 38 | mailSender.setPassword(mailUserPassword); 39 | } 40 | 41 | mailSender.setHost(mailServerHost); 42 | mailSender.setPort(mailServerPort); 43 | 44 | Properties javaMailProperties = new Properties(); 45 | javaMailProperties.put("mail.smtp.starttls.enable", mailServerEnableTls); 46 | javaMailProperties.put("mail.smtp.auth", mailServerAuth); 47 | javaMailProperties.put("mail.transport.protocol", "smtp"); 48 | javaMailProperties.put("mail.debug", "false");// Prints out everything on screen 49 | 50 | mailSender.setJavaMailProperties(javaMailProperties); 51 | return mailSender; 52 | } 53 | } -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/resources/application-h2.properties: -------------------------------------------------------------------------------- 1 | # Server Settings 2 | server.port = 8095 3 | #server.context-path=/ 4 | server.servlet.context-path=/usermgmt 5 | 6 | # Application Name 7 | spring.application.name=usermanagement-microservice 8 | 9 | # AWS X-Ray property 10 | #AWS_XRAY_DAEMON_ADDRESS=xray-service.default.svc.cluster.local:2000 11 | 12 | #com.amazonaws.xray.emitters.daemonAddress=xray-service.default:2000 13 | 14 | # H2 Console Enabled 15 | spring.h2.console.enabled=true 16 | 17 | # JPA & Hibernate Settings 18 | spring.jpa.show-sql=false 19 | spring.jpa.properties.hibernate.id.new_generator_mappings = false 20 | spring.jpa.properties.hibernate.format_sql = true 21 | spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext 22 | 23 | # Logging Settings 24 | logging.level.org.hibernate.SQL=ERROR 25 | logging.level.org.hibernate.type=ERROR 26 | logging.level.org.springframework=ERROR 27 | logging.level.com=ERROR 28 | logging.level.org.springframework.security=ERROR 29 | logging.level.org.springframework.cache=ERROR 30 | logging.level.com.stacksimplify.restservices=INFO 31 | 32 | #Actuator Endpoints 33 | management.endpoints.web.exposure.include=* 34 | 35 | #security.oauth2.resource.jwt.key-uri=http://localhost:8080/auth/oauth/token_key 36 | keystore.password=redhat 37 | 38 | 39 | # Service URLs 40 | notification.service.url=http://${NOTIFICATION_SERVICE_HOST:localhost}:${NOTIFICATION_SERVICE_PORT:8096}/notification/send 41 | notification.service.info.url=http://${NOTIFICATION_SERVICE_HOST:localhost}:${NOTIFICATION_SERVICE_PORT:8096}/notification/info 42 | notification.service.health.url=http://${NOTIFICATION_SERVICE_HOST:localhost}:${NOTIFICATION_SERVICE_PORT:8096}/notification/health-status 43 | notification.service.xray.url=http://${NOTIFICATION_SERVICE_HOST:localhost}:${NOTIFICATION_SERVICE_PORT:8096}/notification/xray 44 | 45 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-03-ALB-Ingress-ContextPath-Based-Routing/kube-manifests/07-ALB-Ingress-ContextPath-Based-Routing.yml: -------------------------------------------------------------------------------- 1 | # Annotations Reference: https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/ 2 | apiVersion: extensions/v1beta1 3 | kind: Ingress 4 | metadata: 5 | name: ingress-usermgmt-restapp-service 6 | labels: 7 | app: usermgmt-restapp 8 | annotations: 9 | # Ingress Core Settings 10 | kubernetes.io/ingress.class: "alb" 11 | alb.ingress.kubernetes.io/scheme: internet-facing 12 | # Health Check Settings 13 | alb.ingress.kubernetes.io/healthcheck-protocol: HTTP 14 | alb.ingress.kubernetes.io/healthcheck-port: traffic-port 15 | #Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer 16 | #alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status 17 | alb.ingress.kubernetes.io/healthcheck-interval-seconds: '15' 18 | alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5' 19 | alb.ingress.kubernetes.io/success-codes: '200' 20 | alb.ingress.kubernetes.io/healthy-threshold-count: '2' 21 | alb.ingress.kubernetes.io/unhealthy-threshold-count: '2' 22 | spec: 23 | rules: 24 | - http: 25 | paths: 26 | - path: /app1/* 27 | backend: 28 | serviceName: app1-nginx-nodeport-service 29 | servicePort: 80 30 | - path: /app2/* 31 | backend: 32 | serviceName: app2-nginx-nodeport-service 33 | servicePort: 80 34 | - path: /* 35 | backend: 36 | serviceName: usermgmt-restapp-nodeport-service 37 | servicePort: 8095 38 | # Important Note-1: In path based routing order is very important, if we are going to use "/*", try to use it at the end of all rules. 39 | 40 | 41 | -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/src/main/java/com/stacksimplify/restservices/authorizationserver/users/dtos/UserModel.java: -------------------------------------------------------------------------------- 1 | package com.stacksimplify.restservices.authorizationserver.users.dtos; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class UserModel { 6 | 7 | @JsonProperty("username") 8 | private String username; 9 | 10 | @JsonProperty("email") 11 | private String email; 12 | 13 | @JsonProperty("role") 14 | private String role; 15 | 16 | @JsonProperty("enabled") 17 | private boolean enabled; 18 | 19 | 20 | @JsonProperty("firstname") 21 | private String firstname; 22 | 23 | 24 | @JsonProperty("lastname") 25 | private String lastname; 26 | 27 | @JsonProperty("appversion") 28 | private String appversion; 29 | 30 | 31 | public String getUsername() { 32 | return username; 33 | } 34 | 35 | public void setUsername(String username) { 36 | this.username = username; 37 | } 38 | 39 | public String getEmail() { 40 | return email; 41 | } 42 | 43 | public void setEmail(String email) { 44 | this.email = email; 45 | } 46 | 47 | public String getRole() { 48 | return role; 49 | } 50 | 51 | public void setRole(String role) { 52 | this.role = role; 53 | } 54 | 55 | public boolean isEnabled() { 56 | return enabled; 57 | } 58 | 59 | public void setEnabled(boolean enabled) { 60 | this.enabled = enabled; 61 | } 62 | 63 | public String getFirstname() { 64 | return firstname; 65 | } 66 | 67 | public void setFirstname(String firstname) { 68 | this.firstname = firstname; 69 | } 70 | 71 | public String getLastname() { 72 | return lastname; 73 | } 74 | 75 | public void setLastname(String lastname) { 76 | this.lastname = lastname; 77 | } 78 | 79 | public String getAppversion() { 80 | return appversion; 81 | } 82 | 83 | public void setAppversion(String appversion) { 84 | this.appversion = appversion; 85 | } 86 | 87 | 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /06-EKS-Storage-with-RDS-Database/kube-manifests/02-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "dbadmin" # RDS DB Username is dbadmin 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-04-ALB-Ingress-SSL/kube-manifests/02-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "dbadmin" # RDS DB Username is dbadmin 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/02-usermanagement-service/README.md: -------------------------------------------------------------------------------- 1 | # User Management Microservice 2 | 3 | ## X-Ray Enablement 4 | ### Change-1: pom.xml 5 | ```xml 6 | 7 | 8 | com.amazonaws 9 | aws-xray-recorder-sdk-spring 10 | 2.6.1 11 | 12 | ``` 13 | 14 | ### Change-2: AwsXrayConfig.java 15 | ```java 16 | package com.stacksimplify.restservices.xray; 17 | import javax.servlet.Filter; 18 | import org.springframework.context.annotation.Bean; 19 | import org.springframework.context.annotation.Configuration; 20 | import com.amazonaws.xray.javax.servlet.AWSXRayServletFilter; 21 | 22 | @Configuration 23 | public class AwsXrayConfig { 24 | @Bean 25 | public Filter TracingFilter() { 26 | return new AWSXRayServletFilter("usermanagement-microservice"); 27 | } 28 | 29 | } 30 | 31 | ``` 32 | 33 | ### Change-3: XRayInspector.java 34 | ```java 35 | import java.util.Map; 36 | 37 | import org.aspectj.lang.ProceedingJoinPoint; 38 | import org.aspectj.lang.annotation.Aspect; 39 | import org.aspectj.lang.annotation.Pointcut; 40 | import org.springframework.stereotype.Component; 41 | 42 | import com.amazonaws.xray.entities.Subsegment; 43 | import com.amazonaws.xray.spring.aop.AbstractXRayInterceptor; 44 | @Aspect 45 | @Component 46 | public class XRayInspector extends AbstractXRayInterceptor { 47 | 48 | @Override 49 | protected Map> generateMetadata(ProceedingJoinPoint proceedingJoinPoint, 50 | Subsegment subsegment) { 51 | return super.generateMetadata(proceedingJoinPoint, subsegment); 52 | } 53 | 54 | @Override 55 | @Pointcut("@within(com.amazonaws.xray.spring.aop.XRayEnabled) && bean(*)") 56 | public void xrayEnabledClasses() { 57 | } 58 | 59 | } 60 | 61 | ``` 62 | 63 | ### Change-4: Update @XRayEnabled in Controllers 64 | ```java 65 | @RestController 66 | @XRayEnabled 67 | public class UserController { 68 | } 69 | ``` 70 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-02-ALB-Ingress-Basics/kube-manifests/02-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "dbadmin" # RDS DB Username is dbadmin 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /others/code/springboot-kubernetes/03-notifications-service/README.md: -------------------------------------------------------------------------------- 1 | # User Management Microservice 2 | 3 | ## X-Ray Enablement 4 | ### Change-1: pom.xml 5 | ```xml 6 | 7 | 8 | com.amazonaws 9 | aws-xray-recorder-sdk-spring 10 | 2.6.1 11 | 12 | ``` 13 | 14 | ### Change-2: AwsXrayConfig.java 15 | ```java 16 | package com.stacksimplify.restservices.xray; 17 | import javax.servlet.Filter; 18 | import org.springframework.context.annotation.Bean; 19 | import org.springframework.context.annotation.Configuration; 20 | import com.amazonaws.xray.javax.servlet.AWSXRayServletFilter; 21 | 22 | @Configuration 23 | public class AwsXrayConfig { 24 | @Bean 25 | public Filter TracingFilter() { 26 | return new AWSXRayServletFilter("usermanagement-microservice"); 27 | } 28 | 29 | } 30 | 31 | ``` 32 | 33 | ### Change-3: XRayInspector.java 34 | ```java 35 | import java.util.Map; 36 | 37 | import org.aspectj.lang.ProceedingJoinPoint; 38 | import org.aspectj.lang.annotation.Aspect; 39 | import org.aspectj.lang.annotation.Pointcut; 40 | import org.springframework.stereotype.Component; 41 | 42 | import com.amazonaws.xray.entities.Subsegment; 43 | import com.amazonaws.xray.spring.aop.AbstractXRayInterceptor; 44 | @Aspect 45 | @Component 46 | public class XRayInspector extends AbstractXRayInterceptor { 47 | 48 | @Override 49 | protected Map> generateMetadata(ProceedingJoinPoint proceedingJoinPoint, 50 | Subsegment subsegment) { 51 | return super.generateMetadata(proceedingJoinPoint, subsegment); 52 | } 53 | 54 | @Override 55 | @Pointcut("@within(com.amazonaws.xray.spring.aop.XRayEnabled) && bean(*)") 56 | public void xrayEnabledClasses() { 57 | } 58 | 59 | } 60 | 61 | ``` 62 | 63 | ### Change-4: Update @XRayEnabled in Controllers 64 | ```java 65 | @RestController 66 | @XRayEnabled 67 | public class NotificationController { 68 | } 69 | ``` 70 | -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-05-ALB-Ingress-SSL-Redirect/kube-manifests/02-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "dbadmin" # RDS DB Username is dbadmin 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-02-Classic-LoadBalancer-CLB/kube-manifests/02-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "dbadmin" # RDS DB Username is dbadmin 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /07-ELB-Classic-and-Network-LoadBalancers/07-03-Network-LoadBalancer-NLB/kube-manifests/02-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "dbadmin" # RDS DB Username is dbadmin 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-03-ALB-Ingress-ContextPath-Based-Routing/kube-manifests/02-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "dbadmin" # RDS DB Username is dbadmin 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-01-Namespaces-Imperative/kube-manifests/06-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "root" 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-04-Kubernetes-Requests-Limits/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes - Requests and Limits 2 | 3 | ## Step-01: Introduction 4 | - We can specify how much each container a pod needs the resources like CPU & Memory. 5 | - When we provide this information in our pod, the scheduler uses this information to decide which node to place the Pod on. 6 | - When you specify a resource limit for a Container, the kubelet enforces those `limits` so that the running container is not allowed to use more of that resource than the limit you set. 7 | - The kubelet also reserves at least the `request` amount of that system resource specifically for that container to use. 8 | 9 | ## Step-02: Add Requests & Limits 10 | ```yml 11 | resources: 12 | requests: 13 | memory: "128Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 14 | cpu: "500m" # `m` means milliCPU 15 | limits: 16 | memory: "500Mi" 17 | cpu: "1000m" # 1000m is equal to 1 VCPU core 18 | ``` 19 | 20 | ## Step-03: Create k8s objects & Test 21 | ``` 22 | # Create All Objects 23 | kubectl apply -f kube-manifests/ 24 | 25 | # List Pods 26 | kubectl get pods 27 | 28 | # Watch List Pods screen 29 | kubectl get pods -w 30 | 31 | # Describe Pod & Discuss about init container 32 | kubectl describe pod 33 | 34 | # Access Application Health Status Page 35 | http://:31231/usermgmt/health-status 36 | 37 | # List Nodes & Describe Node 38 | kubectl get nodes 39 | kubectl describe node 40 | ``` 41 | ## Step-04: Clean-Up 42 | - Delete all k8s objects created as part of this section 43 | ``` 44 | # Delete All 45 | kubectl delete -f kube-manifests/ 46 | 47 | # List Pods 48 | kubectl get pods 49 | 50 | # Verify sc, pvc, pv 51 | kubectl get sc,pvc,pv 52 | ``` 53 | 54 | ## References: 55 | - https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ -------------------------------------------------------------------------------- /08-ELB-Application-LoadBalancers/08-06-ALB-Ingress-ExternalDNS/08-06-02-Use-ExternalDNS-for-Apps/kube-manifests/02-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "dbadmin" # RDS DB Username is dbadmin 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-03-Kubernetes-Liveness-and-Readiness-Probes/kube-manifests/06-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-restapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-restapp 16 | spec: 17 | initContainers: 18 | - name: init-db 19 | image: busybox:1.31 20 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 21 | containers: 22 | - name: usermgmt-restapp 23 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 24 | ports: 25 | - containerPort: 8095 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "usermgmt" 33 | - name: DB_USERNAME 34 | value: "root" 35 | - name: DB_PASSWORD 36 | valueFrom: 37 | secretKeyRef: 38 | name: mysql-db-password 39 | key: db-password 40 | livenessProbe: 41 | exec: 42 | command: 43 | - /bin/sh 44 | - -c 45 | - nc -z localhost 8095 46 | initialDelaySeconds: 60 47 | periodSeconds: 10 48 | readinessProbe: 49 | httpGet: 50 | path: /usermgmt/health-status 51 | port: 8095 52 | initialDelaySeconds: 60 53 | periodSeconds: 10 -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-03-Namespaces-ResourceQuota/kube-manifests/06-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | namespace: dev3 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: usermgmt-restapp 13 | template: 14 | metadata: 15 | labels: 16 | app: usermgmt-restapp 17 | spec: 18 | initContainers: 19 | - name: init-db 20 | image: busybox:1.31 21 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 22 | containers: 23 | - name: usermgmt-restapp 24 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 25 | ports: 26 | - containerPort: 8095 27 | env: 28 | - name: DB_HOSTNAME 29 | value: "mysql" 30 | - name: DB_PORT 31 | value: "3306" 32 | - name: DB_NAME 33 | value: "usermgmt" 34 | - name: DB_USERNAME 35 | value: "root" 36 | - name: DB_PASSWORD 37 | valueFrom: 38 | secretKeyRef: 39 | name: mysql-db-password 40 | key: db-password 41 | livenessProbe: 42 | exec: 43 | command: 44 | - /bin/sh 45 | - -c 46 | - nc -z localhost 8095 47 | initialDelaySeconds: 60 48 | periodSeconds: 10 49 | readinessProbe: 50 | httpGet: 51 | path: /usermgmt/health-status 52 | port: 8095 53 | initialDelaySeconds: 60 54 | periodSeconds: 10 -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-05-Kubernetes-Namespaces/05-05-02-Namespaces-LimitRange-default/kube-manifests/06-UserManagementMicroservice-Deployment-Service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-microservice 5 | labels: 6 | app: usermgmt-restapp 7 | namespace: dev3 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: usermgmt-restapp 13 | template: 14 | metadata: 15 | labels: 16 | app: usermgmt-restapp 17 | spec: 18 | initContainers: 19 | - name: init-db 20 | image: busybox:1.31 21 | command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] 22 | containers: 23 | - name: usermgmt-restapp 24 | image: stacksimplify/kube-usermanagement-microservice:1.0.0 25 | ports: 26 | - containerPort: 8095 27 | env: 28 | - name: DB_HOSTNAME 29 | value: "mysql" 30 | - name: DB_PORT 31 | value: "3306" 32 | - name: DB_NAME 33 | value: "usermgmt" 34 | - name: DB_USERNAME 35 | value: "root" 36 | - name: DB_PASSWORD 37 | valueFrom: 38 | secretKeyRef: 39 | name: mysql-db-password 40 | key: db-password 41 | livenessProbe: 42 | exec: 43 | command: 44 | - /bin/sh 45 | - -c 46 | - nc -z localhost 8095 47 | initialDelaySeconds: 60 48 | periodSeconds: 10 49 | readinessProbe: 50 | httpGet: 51 | path: /usermgmt/health-status 52 | port: 8095 53 | initialDelaySeconds: 60 54 | periodSeconds: 10 -------------------------------------------------------------------------------- /01-EKS-Create-Cluster-using-eksctl/01-04-Delete-EKSCluster-and-NodeGroups/README.md: -------------------------------------------------------------------------------- 1 | # Delete EKS Cluster & Node Groups 2 | 3 | ## Step-01: Delete Node Group 4 | - We can delete a nodegroup separately using below `eksctl delete nodegroup` 5 | ``` 6 | # List EKS Clusters 7 | eksctl get clusters 8 | 9 | # Capture Node Group name 10 | eksctl get nodegroup --cluster= 11 | eksctl get nodegroup --cluster=eksdemo1 12 | 13 | # Delete Node Group 14 | eksctl delete nodegroup --cluster= --name= 15 | eksctl delete nodegroup --cluster=eksdemo1 --name=eksdemo1-ng-public1 16 | ``` 17 | 18 | ## Step-02: Delete Cluster 19 | - We can delete cluster using `eksctl delete cluster` 20 | ``` 21 | # Delete Cluster 22 | eksctl delete cluster 23 | eksctl delete cluster eksdemo1 24 | ``` 25 | 26 | ## Important Notes 27 | 28 | ### Note-1: Rollback any Security Group Changes 29 | - When we create a EKS cluster using `eksctl` it creates the worker node security group with only port 22 access. 30 | - When we progress through the course, we will be creating many **NodePort Services** to access and test our applications via browser. 31 | - During this process, we need to add an additional rule to this automatically created security group, allowing access to our applications we have deployed. 32 | - So the point we need to understand here is when we are deleting the cluster using `eksctl`, its core components should be in same state which means roll back the change we have done to security group before deleting the cluster. 33 | - In this way, cluster will get deleted without any issues, else we might have issues and we need to refer cloudformation events and manually delete few things. In short, we need to go to many places for deletions. 34 | 35 | ### Note-2: Rollback any EC2 Worker Node Instance Role - Policy changes 36 | - When we are doing `EBS Storage Section with EBS CSI Driver` we will add a custom policy to worker node IAM role. 37 | - When you are deleting the cluster, first roll back that change and delete it. 38 | - This way we don't face any issues during cluster deletion. 39 | -------------------------------------------------------------------------------- /05-Kubernetes-Important-Concepts-for-Application-Deployments/05-01-Kubernetes-Secrets/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes - Secrets 2 | 3 | ## Step-01: Introduction 4 | - Kubernetes Secrets let you store and manage sensitive information, such as passwords, OAuth tokens, and ssh keys. 5 | - Storing confidential information in a Secret is safer and more flexible than putting it directly in a Pod definition or in a container image. 6 | 7 | ## Step-02: Create Secret for MySQL DB Password 8 | ### 9 | ``` 10 | # Mac 11 | echo -n 'dbpassword11' | base64 12 | 13 | # URL: https://www.base64encode.org 14 | ``` 15 | ### Create Kubernetes Secrets manifest 16 | ```yml 17 | apiVersion: v1 18 | kind: Secret 19 | metadata: 20 | name: mysql-db-password 21 | #type: Opaque means that from kubernetes's point of view the contents of this Secret is unstructured. 22 | #It can contain arbitrary key-value pairs. 23 | type: Opaque 24 | data: 25 | # Output of echo -n 'dbpassword11' | base64 26 | db-password: ZGJwYXNzd29yZDEx 27 | ``` 28 | ## Step-03: Update secret in MySQL Deployment for DB Password 29 | ```yml 30 | env: 31 | - name: MYSQL_ROOT_PASSWORD 32 | valueFrom: 33 | secretKeyRef: 34 | name: mysql-db-password 35 | key: db-password 36 | ``` 37 | 38 | ## Step-04: Update secret in UMS Deployment 39 | - UMS means User Management Microservice 40 | ```yml 41 | - name: DB_PASSWORD 42 | valueFrom: 43 | secretKeyRef: 44 | name: mysql-db-password 45 | key: db-password 46 | ``` 47 | 48 | ## Step-05: Create & Test 49 | ``` 50 | # Create All Objects 51 | kubectl apply -f kube-manifests/ 52 | 53 | # List Pods 54 | kubectl get pods 55 | 56 | # Access Application Health Status Page 57 | http://:31231/usermgmt/health-status 58 | ``` 59 | 60 | ## Step-06: Clean-Up 61 | - Delete all k8s objects created as part of this section 62 | ``` 63 | # Delete All 64 | kubectl delete -f kube-manifests/ 65 | 66 | # List Pods 67 | kubectl get pods 68 | 69 | # Verify sc, pvc, pv 70 | kubectl get sc,pvc,pv 71 | ``` --------------------------------------------------------------------------------