├── .gitignore ├── 01-Create-GCP-Account └── README.md ├── 02-Create-GKE-Cluster ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadbalancer-service.yaml ├── 03-gcloud-cli-install-macos └── README.md ├── 04-gcloud-cli-install-windowsos └── README.md ├── 05-Docker-For-Beginners └── README.md ├── 06-kubectl-imperative-k8s-pods └── README.md ├── 07-kubectl-declarative-k8s-ReplicaSets ├── README.md └── replicaset-demo.yml ├── 08-kubectl-imperative-k8s-deployment-CREATE └── README.md ├── 09-kubectl-imperative-k8s-deployment-UPDATE └── README.md ├── 10-kubectl-imperative-k8s-deployment-ROLLBACK └── README.md ├── 11-kubectl-imperative-k8s-deployment-PAUSE-RESUME └── README.md ├── 12-kubectl-imperative-k8s-services └── README.md ├── 13-YAML-Basics ├── README.md ├── sample-file.yml └── yaml-demo.yaml ├── 14-yaml-declarative-k8s-pods ├── README.md ├── kube-base-definition.yml └── kube-manifests │ ├── 01-pod-definition.yml │ └── 02-pod-LoadBalancer-service.yml ├── 15-yaml-declarative-k8s-replicasets ├── README.md ├── kube-base-definition.yml └── kube-manifests │ ├── 01-replicaset-definition.yml │ └── 02-replicaset-LoadBalancer-servie.yml ├── 16-yaml-declarative-k8s-deployments ├── README.md ├── kube-base-definition.yml └── kube-manifests │ ├── 01-deployment-definition.yml │ └── 02-deployment-LoadBalancer-servie.yml ├── 17-yaml-declarative-k8s-services ├── README.md ├── kube-base-definition.yml └── kube-manifests │ ├── 01-backend-deployment.yml │ ├── 02-backend-clusterip-service.yml │ ├── 03-frontend-deployment.yml │ └── 04-frontend-LoadBalancer-service.yml ├── 18-GKE-NodePort-Service ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-nodeport-service.yaml ├── 19-GKE-Headless-Service ├── 01-kube-manifests │ ├── 01-kubernetes-deployment.yaml │ ├── 02-kubernetes-clusterip-service.yaml │ └── 03-kubernetes-headless-service.yaml ├── 02-kube-manifests-curl │ └── 01-curl-pod.yml └── README.md ├── 20-GKE-Private-Cluster ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadbalancer-service.yaml ├── 21-GKE-PD-existing-SC-standard-rwo ├── README.md └── kube-manifests │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 22-GKE-PD-existing-SC-premium-rwo ├── README.md └── kube-manifests │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 23-GKE-PD-Custom-StorageClass ├── README.md └── kube-manifests │ ├── 00-storage-class.yaml │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 24-GKE-PD-preexisting-PD ├── README.md └── kube-manifests │ ├── 00-persistent-volume.yaml │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 25-GKE-PD-Regional-PD ├── README.md └── kube-manifests │ ├── 00-storage-class.yaml │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 26-GKE-PD-Volume-Snapshots-and-Restore ├── 01-kube-manifests │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 02-Volume-Snapshot │ ├── 01-VolumeSnapshotClass.yaml │ └── 02-VolumeSnapshot.yaml ├── 03-Volume-Restore │ ├── 01-restore-pvc.yaml │ └── 02-mysql-deployment.yaml └── README.md ├── 27-GKE-PD-Volume-Clone ├── 01-kube-manifests │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 02-Use-Cloned-Volume-kube-manifests │ ├── 01-podpvc-clone.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 03-With-NodeSelectors │ ├── 01-kube-manifests │ │ ├── 01-persistent-volume-claim.yaml │ │ ├── 02-UserManagement-ConfigMap.yaml │ │ ├── 03-mysql-deployment.yaml │ │ ├── 04-mysql-clusterip-service.yaml │ │ ├── 05-UserMgmtWebApp-Deployment.yaml │ │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml │ └── 02-Use-Cloned-Volume-kube-manifests │ │ ├── 01-podpvc-clone.yaml │ │ ├── 02-UserManagement-ConfigMap.yaml │ │ ├── 03-mysql-deployment.yaml │ │ ├── 04-mysql-clusterip-service.yaml │ │ ├── 05-UserMgmtWebApp-Deployment.yaml │ │ └── 06-UserMgmtWebApp-LoadBalancer-Service.yaml └── README.md ├── 28-GKE-Storage-with-GCP-CloudSQL-Public ├── README.md └── kube-manifests │ ├── 01-MySQL-externalName-Service.yaml │ ├── 02-Kubernetes-Secrets.yaml │ ├── 03-UserMgmtWebApp-Deployment.yaml │ └── 04-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 29-GKE-Storage-with-GCP-CloudSQL-Private ├── README.md └── kube-manifests │ ├── 01-MySQL-externalName-Service.yaml │ ├── 02-Kubernetes-Secrets.yaml │ ├── 03-UserMgmtWebApp-Deployment.yaml │ └── 04-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 30-GCP-CloudSQL-Private-NO-ExternalNameService ├── README.md └── kube-manifests │ ├── 01-Kubernetes-Secrets.yaml │ ├── 02-UserMgmtWebApp-Deployment.yaml │ └── 03-UserMgmtWebApp-LoadBalancer-Service.yaml ├── 31-GKE-FileStore-default-StorageClass ├── README.md └── kube-manifests │ ├── 01-filestore-pvc.yaml │ ├── 02-write-to-filestore-pod.yaml │ ├── 03-myapp1-deployment.yaml │ └── 04-loadBalancer-service.yaml ├── 32-GKE-FileStore-custom-StorageClass ├── README.md └── kube-manifests │ ├── 00-filestore-storage-class.yaml │ ├── 01-filestore-pvc.yaml │ ├── 02-write-to-filestore-pod.yaml │ ├── 03-myapp1-deployment.yaml │ └── 04-loadBalancer-service.yaml ├── 33-GKE-FileStore-Backup-and-Restore ├── 01-myapp1-kube-manifests │ ├── 01-filestore-pvc.yaml │ ├── 02-write-to-filestore-pod.yaml │ ├── 03-myapp1-deployment.yaml │ └── 04-loadBalancer-service.yaml ├── 02-volume-backup-kube-manifests │ ├── 01-VolumeSnapshotClass.yaml │ └── 02-VolumeSnapshot.yaml ├── 03-volume-restore-myapp2-kube-manifests │ ├── 01-filestore-pvc.yaml │ ├── 02-myapp2-deployment.yaml │ └── 03-myapp2-loadBalancer-service.yaml └── README.md ├── 34-GKE-Ingress-Basics ├── README.md └── kube-manifests │ ├── 01-Nginx-App3-Deployment-and-NodePortService.yaml │ └── 02-ingress-basic.yaml ├── 35-GKE-Ingress-Context-Path-Routing ├── README.md └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ └── 04-Ingress-ContextPath-Based-Routing.yaml ├── 36-GKE-Ingress-Custom-Health-Check ├── README.md └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ └── 04-Ingress-Custom-Healthcheck.yaml ├── 37-Google-Cloud-Domains └── README.md ├── 38-GKE-Ingress-ExternalIP ├── README.md └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ └── 04-Ingress-external-ip.yaml ├── 39-GKE-Ingress-Google-Managed-SSL ├── README.md └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ ├── 04-Ingress-SSL.yaml │ └── 05-Managed-Certificate.yaml ├── 40-GKE-Ingress-Google-Managed-SSL-Redirect ├── README.md └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ ├── 04-Ingress-SSL.yaml │ ├── 05-Managed-Certificate.yaml │ └── 06-frontendconfig.yaml ├── 41-GKE-Workload-Identity ├── README.md └── kube-manifests │ ├── 01-wid-demo-pod-without-sa.yaml │ └── 02-wid-demo-pod-with-sa.yaml ├── 42-GKE-ExternalDNS-Install └── README.md ├── 43-GKE-ExternalDNS-Ingress-Demo ├── README.md └── kube-manifests │ ├── 01-Nginx-App3-Deployment-and-NodePortService.yaml │ └── 02-ingress-external-dns.yaml ├── 44-GKE-ExternalDNS-Service-Demo ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadbalancer-service.yaml ├── 45-GKE-Ingress-NameBasedVhost-Routing ├── README.md └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ ├── 04-Ingress-NameBasedVHost-Routing.yaml │ ├── 05-Managed-Certificate.yaml │ └── 06-frontendconfig.yaml ├── 46-GKE-Ingress-SSL-Policy ├── README.md └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ ├── 04-Ingress-NameBasedVHost-Routing.yaml │ ├── 05-Managed-Certificate.yaml │ └── 06-frontendconfig.yaml ├── 47-GKE-Ingress-with-Identity-Aware-Proxy ├── README.md └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ ├── 04-Ingress-NameBasedVHost-Routing.yaml │ ├── 05-Managed-Certificate.yaml │ ├── 06-frontendconfig.yaml │ └── 07-backendconfig.yaml ├── 48-GKE-Ingress-SelfSigned-SSL ├── README.md ├── SSL-SelfSigned-Certs │ ├── app1-ingress.crt │ ├── app1-ingress.csr │ ├── app1-ingress.key │ ├── app2-ingress.crt │ ├── app2-ingress.csr │ ├── app2-ingress.key │ ├── app3-ingress.crt │ ├── app3-ingress.csr │ └── app3-ingress.key └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ ├── 04-ingress-self-signed-ssl.yaml │ └── 05-frontendconfig.yaml ├── 49-GKE-Ingress-Preshared-SSL ├── README.md ├── SSL-SelfSigned-Certs │ ├── app1-ingress.crt │ ├── app1-ingress.csr │ ├── app1-ingress.key │ ├── app2-ingress.crt │ ├── app2-ingress.csr │ ├── app2-ingress.key │ ├── app3-ingress.crt │ ├── app3-ingress.csr │ └── app3-ingress.key └── kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ ├── 04-ingress-preshared-ssl.yaml │ └── 05-frontendconfig.yaml ├── 50-GKE-Ingress-Cloud-CDN ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ ├── 02-kubernetes-NodePort-service.yaml │ ├── 03-ingress.yaml │ └── 04-backendconfig.yaml ├── 51-GKE-Ingress-ClientIP-Affinity ├── 01-kube-manifests-with-clientip-affinity │ ├── 01-kubernetes-deployment.yaml │ ├── 02-kubernetes-NodePort-service.yaml │ ├── 03-ingress.yaml │ └── 04-backendconfig.yaml ├── 02-kube-manifests-without-clientip-affinity │ ├── 01-kubernetes-deployment.yaml │ ├── 02-kubernetes-NodePort-service.yaml │ ├── 03-ingress.yaml │ └── 04-backendconfig.yaml └── README.md ├── 52-GKE-Ingress-Cookie-Affinity ├── 01-kube-manifests-with-cookie-affinity │ ├── 01-kubernetes-deployment.yaml │ ├── 02-kubernetes-NodePort-service.yaml │ ├── 03-ingress.yaml │ └── 04-backendconfig.yaml ├── 02-kube-manifests-without-cookie-affinity │ ├── 01-kubernetes-deployment.yaml │ ├── 02-kubernetes-NodePort-service.yaml │ ├── 03-ingress.yaml │ └── 04-backendconfig.yaml └── README.md ├── 53-GKE-Ingress-HealthCheck-with-backendConfig ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ ├── 02-kubernetes-NodePort-service.yaml │ ├── 03-ingress.yaml │ └── 04-backendconfig.yaml ├── 54-GKE-Ingress-InternalLB ├── 01-kube-manifests │ ├── 01-Nginx-App1-Deployment-and-NodePortService.yaml │ ├── 02-Nginx-App2-Deployment-and-NodePortService.yaml │ ├── 03-Nginx-App3-Deployment-and-NodePortService.yaml │ └── 04-Ingress-internal-lb.yaml ├── 02-kube-manifests-curl │ └── 01-curl-pod.yml └── README.md ├── 55-GKE-Ingress-Cloud-Armor ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ ├── 02-kubernetes-NodePort-service.yaml │ ├── 03-ingress.yaml │ └── 04-backendconfig.yaml ├── 56-GKE-Artifact-Registry ├── 01-Docker-Image │ ├── Dockerfile │ └── index.html ├── 02-kube-manifests │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadBalancer-service.yaml └── README.md ├── 57-GKE-Continuous-Integration ├── 01-SSH-Keys │ ├── id_gcp_cloud_source │ └── id_gcp_cloud_source.pub ├── 02-Docker-Image │ ├── Dockerfile │ └── index.html ├── 03-cloudbuild-yaml │ └── cloudbuild.yaml ├── 04-kube-manifests │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadBalancer-service.yaml └── README.md ├── 58-GKE-Continuous-Delivery-with-CloudBuild ├── 01-myapp1-k8s-repo │ └── cloudbuild-delivery.yaml ├── 02-Source-Writer-IAM-Role │ └── myapp1-k8s-repo-policy.yaml ├── 03-myapp1-app-repo │ ├── Dockerfile │ ├── README.md │ ├── cloudbuild-trigger-cd.yaml │ ├── cloudbuild.yaml │ ├── index.html │ └── kubernetes.yaml.tpl └── README.md ├── 59-Kubernetes-liveness-probe ├── 01-liveness-probe-linux-command │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ ├── 06-UserMgmtWebApp-LoadBalancer-Service.yaml │ └── 07-kubernetes-secret.yaml ├── 02-liveness-probe-HTTP-Request │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ ├── 06-UserMgmtWebApp-LoadBalancer-Service.yaml │ └── 07-kubernetes-secret.yaml ├── 03-liveness-probe-TCP-Request │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ ├── 06-UserMgmtWebApp-LoadBalancer-Service.yaml │ └── 07-kubernetes-secret.yaml └── README.md ├── 60-Kubernetes-Startup-Probe ├── README.md └── kube-manifests-startup-probe │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ ├── 06-UserMgmtWebApp-LoadBalancer-Service.yaml │ └── 07-kubernetes-secret.yaml ├── 61-Kubernetes-Readiness-Probe ├── README.md └── kube-manifests-readiness-probe │ ├── 01-persistent-volume-claim.yaml │ ├── 02-UserManagement-ConfigMap.yaml │ ├── 03-mysql-deployment.yaml │ ├── 04-mysql-clusterip-service.yaml │ ├── 05-UserMgmtWebApp-Deployment.yaml │ ├── 06-UserMgmtWebApp-LoadBalancer-Service.yaml │ └── 07-kubernetes-secret.yaml ├── 62-Kubernetes-Requests-and-Limits ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadbalancer-service.yaml ├── 63-GKE-Cluster-Autoscaling ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadbalancer-service.yaml ├── 64-Kubernetes-Namespaces ├── 01-kube-manifests-imperative │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadbalancer-service.yaml ├── 02-kube-manifests-declarative │ ├── 00-kubernetes-namespace.yaml │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadbalancer-service.yaml └── README.md ├── 65-Kubernetes-Namespaces-ResourceQuota ├── README.md └── kube-manifests │ ├── 01-kubernetes-namespace.yaml │ ├── 02-kubernetes-resourcequota.yaml │ ├── 03-kubernetes-deployment.yaml │ └── 04-kubernetes-loadbalancer-service.yaml ├── 66-Kubernetes-Namespaces-LimitRange ├── 01-kube-manifests-LimitRange-defaults │ ├── 01-kubernetes-namespace.yaml │ ├── 02-kubernetes-resourcequota-limitrange.yaml │ ├── 03-kubernetes-deployment.yaml │ └── 04-kubernetes-loadbalancer-service.yaml ├── 02-kube-manifests-LimitRange-MinMax │ ├── 01-kubernetes-namespace.yaml │ ├── 02-kubernetes-resourcequota-limitrange.yaml │ ├── 03-kubernetes-deployment.yaml │ └── 04-kubernetes-loadbalancer-service.yaml └── README.md ├── 67-GKE-Horizontal-Pod-Autoscaler ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ ├── 02-kubernetes-cip-service.yaml │ └── 03-kubernetes-hpa.yaml ├── 68-GKE-AutoPilot-Cluster ├── README.md └── kube-manifests │ ├── 01-kubernetes-deployment.yaml │ └── 02-kubernetes-loadbalancer-service.yaml ├── 69-Access-To-Multiple-Clusters └── README.md ├── README.md ├── course-presentation └── Google-Kubernetes-Engine-GKE-GCP-v3R.pptx ├── git-deploy.sh └── images └── course-title.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | .DS_Store 4 | 5 | # .tfstate files 6 | *.tfstate 7 | *.tfstate.* 8 | 9 | # Crash log files 10 | crash.log 11 | 12 | # Ignore any .tfvars files that are generated automatically for each Terraform run. Most 13 | # .tfvars files are managed as part of configuration and so should be included in 14 | # version control. 15 | # 16 | # example.tfvars 17 | 18 | # Ignore override files as they are usually used to override resources locally and so 19 | # are not checked in 20 | override.tf 21 | override.tf.json 22 | *_override.tf 23 | *_override.tf.json 24 | 25 | # Include override files you do wish to add to version control using negated pattern 26 | # 27 | # !example_override.tf 28 | 29 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan 30 | # example: *tfplan* 31 | -------------------------------------------------------------------------------- /01-Create-GCP-Account/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Create GCP Cloud Account 3 | description: Learn to create GCP Cloud Account 4 | --- 5 | 6 | ## Step-01: Introduction 7 | - Create GCP Cloud Account 8 | 9 | ## Step-02: Create a Google Account 10 | - We should have a google account (gmail account) before creating GCP cloud Account 11 | - Create one Google Account if not having one. 12 | 13 | ## Step-03: Create GCP Account 14 | - Go to https://cloud.google.com 15 | - Follow presentation slides to create the GCP Account 16 | 17 | ## Step-04: Create Budget Alerts 18 | - Go to Billing and Create Budget Alerts 19 | -------------------------------------------------------------------------------- /02-Create-GKE-Cluster/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0 19 | ports: 20 | - containerPort: 8080 21 | -------------------------------------------------------------------------------- /02-Create-GKE-Cluster/kube-manifests/02-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 8080 # Container Port 13 | -------------------------------------------------------------------------------- /05-Docker-For-Beginners/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Docker Fundamentals 3 | description: Learn Docker Fundamentals 4 | --- 5 | 6 | ## Docker Fundamentals 7 | - For Docker Fundamentals github repository, please click on below link 8 | - https://github.com/stacksimplify/docker-fundamentals 9 | 10 | -------------------------------------------------------------------------------- /07-kubectl-declarative-k8s-ReplicaSets/replicaset-demo.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: ReplicaSet 3 | metadata: 4 | name: my-helloworld-rs 5 | labels: 6 | app: my-helloworld 7 | spec: 8 | replicas: 3 9 | selector: 10 | matchLabels: 11 | app: my-helloworld 12 | template: 13 | metadata: 14 | labels: 15 | app: my-helloworld 16 | spec: 17 | containers: 18 | - name: my-helloworld-app 19 | image: stacksimplify/kube-helloworld:1.0.0 20 | -------------------------------------------------------------------------------- /13-YAML-Basics/sample-file.yml: -------------------------------------------------------------------------------- 1 | # Simple Key value Pairs 2 | person: # Dictionary 3 | name: kalyan 4 | age: 23 5 | city: Hyderabd 6 | hobbies: # List 7 | - cooking 8 | - cycling 9 | friends: # Multiple lists 10 | - name: friend1 11 | age: 23 12 | - name: friend2 13 | age: 22 14 | --- # YAML Document Separator 15 | apiVersion: v1 # String 16 | kind: Pod # String 17 | metadata: # Dictionary 18 | name: myapp-pod 19 | labels: # Dictionary 20 | app: myapp 21 | tier: frontend 22 | spec: 23 | containers: # List 24 | - name: myapp 25 | image: stacksimplify/kubenginx:1.0.0 26 | ports: # Multiple Lists 27 | - containerPort: 80 28 | protocol: "TCP" 29 | - containerPort: 81 30 | protocol: "TCP" 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /13-YAML-Basics/yaml-demo.yaml: -------------------------------------------------------------------------------- 1 | # Simple Key Value Pairs 2 | person: # Dictionary 3 | name: kalyan 4 | age: 23 5 | city: Hyderabad 6 | hobbies: # List 7 | - cooking 8 | - cycling 9 | hobbies: [cooking, cycling] # Another Notation for Lists 10 | friends: # Multiple Lists 11 | - name: friend1 12 | age: 23 13 | - name: friend2 14 | age: 22 15 | --- # YAML Document Separator 16 | apiVersion: v1 # String 17 | kind: Pod # String 18 | metadata: # Dictionary 19 | name: myapp-pod 20 | labels: # Dictionary 21 | app: myapp 22 | spec: 23 | containers: # List 24 | - name: myapp 25 | image: stacksimplify/kubenginx:1.0.0 26 | ports: # Multiple Lists 27 | - containerPort: 80 28 | protocol: "TCP" 29 | - containerPort: 81 30 | protocol: "TCP" -------------------------------------------------------------------------------- /14-yaml-declarative-k8s-pods/kube-base-definition.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 2 | kind: 3 | metadata: 4 | 5 | spec: 6 | 7 | # Types of Kubernetes Objects 8 | # Pod, ReplicaSet, Deployment, Service and many more 9 | 10 | # apiVersion: version of k8s objects 11 | # kind: k8s objects 12 | # metadata: define name and labels for k8s objects 13 | # spec: specification or real definition for k8s objects 14 | -------------------------------------------------------------------------------- /14-yaml-declarative-k8s-pods/kube-manifests/01-pod-definition.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 # String 2 | kind: Pod # String 3 | metadata: # Dictionary 4 | name: myapp-pod 5 | labels: # Dictionary 6 | app: myapp # Key Value Pairs 7 | spec: 8 | containers: # List 9 | - name: myapp 10 | image: stacksimplify/kubenginx:1.0.0 11 | ports: # List 12 | - containerPort: 80 13 | 14 | 15 | -------------------------------------------------------------------------------- /14-yaml-declarative-k8s-pods/kube-manifests/02-pod-LoadBalancer-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp-pod-loadbalancer-service 5 | spec: 6 | type: LoadBalancer 7 | # Loadbalance traffic across Pods matching this label selector 8 | selector: 9 | app: myapp 10 | ports: 11 | - name: http 12 | port: 80 # Service Port 13 | targetPort: 80 # Container Port -------------------------------------------------------------------------------- /15-yaml-declarative-k8s-replicasets/kube-base-definition.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 2 | kind: 3 | metadata: 4 | 5 | spec: 6 | -------------------------------------------------------------------------------- /15-yaml-declarative-k8s-replicasets/kube-manifests/01-replicaset-definition.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: ReplicaSet 3 | metadata: # Dictionary 4 | name: myapp2-rs 5 | spec: # Dictionary 6 | replicas: 3 7 | selector: 8 | matchLabels: 9 | app: myapp2 10 | template: 11 | metadata: # Dictionary 12 | name: myapp2-pod 13 | labels: 14 | app: myapp2 # Key Value Pairs 15 | spec: 16 | containers: # List 17 | - name: myapp2-container 18 | image: stacksimplify/kubenginx:2.0.0 19 | ports: 20 | - containerPort: 80 -------------------------------------------------------------------------------- /15-yaml-declarative-k8s-replicasets/kube-manifests/02-replicaset-LoadBalancer-servie.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: replicaset-loadbalancer-service 5 | spec: 6 | type: LoadBalancer 7 | # Loadbalance traffic across Pods matching this label selector 8 | selector: 9 | app: myapp2 10 | ports: 11 | - name: http 12 | port: 80 # Service Port 13 | targetPort: 80 # Container Port -------------------------------------------------------------------------------- /16-yaml-declarative-k8s-deployments/kube-base-definition.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 2 | kind: 3 | metadata: 4 | 5 | spec: 6 | -------------------------------------------------------------------------------- /16-yaml-declarative-k8s-deployments/kube-manifests/01-deployment-definition.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: # Dictionary 4 | name: myapp3-deployment 5 | spec: # Dictionary 6 | replicas: 3 7 | selector: 8 | matchLabels: 9 | app: myapp3 10 | template: 11 | metadata: # Dictionary 12 | name: myapp3-pod 13 | labels: 14 | app: myapp3 # Key Value Pairs 15 | spec: 16 | containers: # List 17 | - name: myapp3-container 18 | image: stacksimplify/kubenginx:3.0.0 19 | ports: 20 | - containerPort: 80 -------------------------------------------------------------------------------- /16-yaml-declarative-k8s-deployments/kube-manifests/02-deployment-LoadBalancer-servie.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: deployment-loadbalancer-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp3 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port -------------------------------------------------------------------------------- /17-yaml-declarative-k8s-services/kube-base-definition.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 2 | kind: 3 | metadata: 4 | 5 | spec: 6 | -------------------------------------------------------------------------------- /17-yaml-declarative-k8s-services/kube-manifests/01-backend-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: backend-restapp 5 | labels: 6 | app: backend-restapp 7 | tier: backend 8 | spec: 9 | replicas: 3 10 | selector: 11 | matchLabels: 12 | app: backend-restapp 13 | template: 14 | metadata: 15 | labels: 16 | app: backend-restapp 17 | tier: backend 18 | spec: 19 | containers: 20 | - name: backend-restapp 21 | image: stacksimplify/kube-helloworld:1.0.0 22 | ports: 23 | - containerPort: 8080 -------------------------------------------------------------------------------- /17-yaml-declarative-k8s-services/kube-manifests/02-backend-clusterip-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: my-backend-service ## VERY VERY IMPORTANT - NGINX PROXYPASS needs this name 5 | labels: 6 | app: backend-restapp 7 | tier: backend 8 | spec: 9 | #type: ClusterIP is a default service in k8s 10 | selector: 11 | app: backend-restapp 12 | ports: 13 | - name: http 14 | port: 8080 # ClusterIP Service Port 15 | targetPort: 8080 # Container Port 16 | -------------------------------------------------------------------------------- /17-yaml-declarative-k8s-services/kube-manifests/03-frontend-deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: frontend-nginxapp 5 | labels: 6 | app: frontend-nginxapp 7 | tier: frontend 8 | spec: 9 | replicas: 3 10 | selector: 11 | matchLabels: 12 | app: frontend-nginxapp 13 | template: 14 | metadata: 15 | labels: 16 | app: frontend-nginxapp 17 | tier: frontend 18 | spec: 19 | containers: 20 | - name: frontend-nginxapp 21 | image: stacksimplify/kube-frontend-nginx:1.0.0 22 | ports: 23 | - containerPort: 80 -------------------------------------------------------------------------------- /17-yaml-declarative-k8s-services/kube-manifests/04-frontend-LoadBalancer-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: frontend-nginxapp-loadbalancer-service 5 | labels: 6 | app: frontend-nginxapp 7 | tier: frontend 8 | spec: 9 | type: LoadBalancer # ClusterIp, # NodePort 10 | selector: 11 | app: frontend-nginxapp 12 | ports: 13 | - name: http 14 | port: 80 # Service Port 15 | targetPort: 80 # Container Port -------------------------------------------------------------------------------- /18-GKE-NodePort-Service/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | -------------------------------------------------------------------------------- /18-GKE-NodePort-Service/kube-manifests/02-kubernetes-nodeport-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-nodeport-service 5 | spec: 6 | type: NodePort # ClusterIP, # NodePort, # LoadBalancer, # ExternalName 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | nodePort: 30080 # NodePort (Optional)(Node Port Range: 30000-32768) 14 | -------------------------------------------------------------------------------- /19-GKE-Headless-Service/01-kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 4 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | #image: stacksimplify/kubenginx:1.0.0 19 | image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:2.0 20 | ports: 21 | - containerPort: 8080 22 | -------------------------------------------------------------------------------- /19-GKE-Headless-Service/01-kube-manifests/02-kubernetes-clusterip-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-cip-service 5 | spec: 6 | type: ClusterIP # ClusterIP, # NodePort, # LoadBalancer, # ExternalName 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 8080 # Container Port 13 | 14 | -------------------------------------------------------------------------------- /19-GKE-Headless-Service/01-kube-manifests/03-kubernetes-headless-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-headless-service 5 | spec: 6 | #type: ClusterIP # ClusterIP, # NodePort, # LoadBalancer, # ExternalName 7 | clusterIP: None 8 | selector: 9 | app: myapp1 10 | ports: 11 | - name: http 12 | port: 8080 # Service Port 13 | targetPort: 8080 # Container Port 14 | 15 | ## VERY IMPORTANT NODE 16 | # 1. When using Headless Service, we should use both the "Service Port and Target Port" same. 17 | # 2. Headless Service directly sends traffic to Pod with Pod IP and Container Port. 18 | # 3. DNS resolution directly happens from headless service to Pod IP. 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /19-GKE-Headless-Service/02-kube-manifests-curl/01-curl-pod.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: curl-pod 5 | spec: 6 | containers: 7 | - name: curl 8 | image: curlimages/curl 9 | command: [ "sleep", "600" ] -------------------------------------------------------------------------------- /20-GKE-Private-Cluster/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | imagePullPolicy: Always 22 | -------------------------------------------------------------------------------- /20-GKE-Private-Cluster/kube-manifests/02-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /21-GKE-PD-existing-SC-standard-rwo/kube-manifests/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /21-GKE-PD-existing-SC-standard-rwo/kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. 19 | ## We are going to use this in our MySQL k8s Deployment 20 | 21 | # 3. YAML Notation 22 | ## YAML Notation: |-: "strip": remove the line feed, remove the trailing blank lines. 23 | ## Additional YAML Notation Reference: https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-in-yaml-over-multiple-lines -------------------------------------------------------------------------------- /21-GKE-PD-existing-SC-standard-rwo/kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /21-GKE-PD-existing-SC-standard-rwo/kube-manifests/05-UserMgmtWebApp-Deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-webapp 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-webapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-webapp 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-webapp 23 | image: stacksimplify/kube-usermgmt-webapp:1.0.0-MySQLDB 24 | ports: 25 | - containerPort: 8080 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "webappdb" 33 | - name: DB_USERNAME 34 | value: "root" 35 | - name: DB_PASSWORD 36 | value: "dbpassword11" -------------------------------------------------------------------------------- /21-GKE-PD-existing-SC-standard-rwo/kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | app: usermgmt-webapp 9 | ports: 10 | - port: 80 # Service Port 11 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /22-GKE-PD-existing-SC-premium-rwo/kube-manifests/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: premium-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /22-GKE-PD-existing-SC-premium-rwo/kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. We are going to use this in our MySQL Deployment) 19 | -------------------------------------------------------------------------------- /22-GKE-PD-existing-SC-premium-rwo/kube-manifests/03-mysql-deployment.yaml: -------------------------------------------------------------------------------- 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:8.0 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: mysql-pv-claim 35 | - name: usermanagement-dbcreation-script 36 | configMap: 37 | name: usermanagement-dbcreation-script 38 | 39 | -------------------------------------------------------------------------------- /22-GKE-PD-existing-SC-premium-rwo/kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /22-GKE-PD-existing-SC-premium-rwo/kube-manifests/05-UserMgmtWebApp-Deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-webapp 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-webapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-webapp 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-webapp 23 | image: stacksimplify/kube-usermgmt-webapp:1.0.0-MySQLDB 24 | ports: 25 | - containerPort: 8080 26 | env: 27 | - name: DB_HOSTNAME 28 | value: "mysql" 29 | - name: DB_PORT 30 | value: "3306" 31 | - name: DB_NAME 32 | value: "webappdb" 33 | - name: DB_USERNAME 34 | value: "root" 35 | - name: DB_PASSWORD 36 | value: "dbpassword11" -------------------------------------------------------------------------------- /22-GKE-PD-existing-SC-premium-rwo/kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /23-GKE-PD-Custom-StorageClass/kube-manifests/00-storage-class.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: gke-pd-standard-rwo-sc 5 | provisioner: pd.csi.storage.gke.io 6 | volumeBindingMode: WaitForFirstConsumer 7 | allowVolumeExpansion: true 8 | reclaimPolicy: Retain 9 | parameters: 10 | type: pd-balanced # Other Options supported are pd-ssd, pd-standard 11 | 12 | # STORAGE CLASS 13 | # 1. A StorageClass provides a way for administrators 14 | # to describe the "classes" of storage they offer. 15 | # 2. Here we are offering GCP PD Storage for GKE Cluster -------------------------------------------------------------------------------- /23-GKE-PD-Custom-StorageClass/kube-manifests/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: gke-pd-standard-rwo-sc 9 | resources: 10 | requests: 11 | storage: 4Gi # Commment at Step-09 12 | #storage: 8Gi # UnCommment at Step-09 13 | 14 | # NEED FOR PVC 15 | # 1. Dynamic volume provisioning allows storage volumes to be created 16 | # on-demand. 17 | 18 | # 2. Without dynamic provisioning, cluster administrators have to manually 19 | # make calls to their cloud or storage provider to create new storage 20 | # volumes, and then create PersistentVolume objects to represent them in k8s 21 | 22 | # 3. The dynamic provisioning feature eliminates the need for cluster 23 | # administrators to pre-provision storage. Instead, it automatically 24 | # provisions storage when it is requested by users. 25 | 26 | # 4. PVC: Users request dynamically provisioned storage by including 27 | # a storage class in their PersistentVolumeClaim 28 | 29 | -------------------------------------------------------------------------------- /23-GKE-PD-Custom-StorageClass/kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. We are going to use this in our MySQL Deployment) 19 | -------------------------------------------------------------------------------- /23-GKE-PD-Custom-StorageClass/kube-manifests/03-mysql-deployment.yaml: -------------------------------------------------------------------------------- 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:8.0 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: mysql-pv-claim 35 | - name: usermanagement-dbcreation-script 36 | configMap: 37 | name: usermanagement-dbcreation-script 38 | 39 | -------------------------------------------------------------------------------- /23-GKE-PD-Custom-StorageClass/kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /23-GKE-PD-Custom-StorageClass/kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /24-GKE-PD-preexisting-PD/kube-manifests/00-persistent-volume.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: preexisting-pd 5 | spec: 6 | storageClassName: standard-rwo 7 | capacity: 8 | storage: 8Gi 9 | accessModes: 10 | - ReadWriteOnce 11 | claimRef: 12 | namespace: default 13 | name: mysql-pv-claim 14 | gcePersistentDisk: 15 | pdName: preexisting-pd 16 | fsType: ext4 -------------------------------------------------------------------------------- /24-GKE-PD-preexisting-PD/kube-manifests/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 8Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /24-GKE-PD-preexisting-PD/kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. We are going to use this in our MySQL Deployment) 19 | -------------------------------------------------------------------------------- /24-GKE-PD-preexisting-PD/kube-manifests/03-mysql-deployment.yaml: -------------------------------------------------------------------------------- 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:8.0 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: mysql-pv-claim 35 | - name: usermanagement-dbcreation-script 36 | configMap: 37 | name: usermanagement-dbcreation-script 38 | 39 | -------------------------------------------------------------------------------- /24-GKE-PD-preexisting-PD/kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /24-GKE-PD-preexisting-PD/kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /25-GKE-PD-Regional-PD/kube-manifests/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: regionalpd-storageclass 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /25-GKE-PD-Regional-PD/kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. We are going to use this in our MySQL Deployment) 19 | -------------------------------------------------------------------------------- /25-GKE-PD-Regional-PD/kube-manifests/03-mysql-deployment.yaml: -------------------------------------------------------------------------------- 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:8.0 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: mysql-pv-claim 35 | - name: usermanagement-dbcreation-script 36 | configMap: 37 | name: usermanagement-dbcreation-script 38 | 39 | -------------------------------------------------------------------------------- /25-GKE-PD-Regional-PD/kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /25-GKE-PD-Regional-PD/kube-manifests/05-UserMgmtWebApp-Deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: usermgmt-webapp 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: usermgmt-webapp 12 | template: 13 | metadata: 14 | labels: 15 | app: usermgmt-webapp 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-webapp 23 | image: stacksimplify/kube-usermgmt-webapp:1.0.0-MySQLDB 24 | imagePullPolicy: Always 25 | ports: 26 | - containerPort: 8080 27 | env: 28 | - name: DB_HOSTNAME 29 | value: "mysql" 30 | - name: DB_PORT 31 | value: "3306" 32 | - name: DB_NAME 33 | value: "webappdb" 34 | - name: DB_USERNAME 35 | value: "root" 36 | - name: DB_PASSWORD 37 | value: "dbpassword11" -------------------------------------------------------------------------------- /25-GKE-PD-Regional-PD/kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /26-GKE-PD-Volume-Snapshots-and-Restore/01-kube-manifests/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /26-GKE-PD-Volume-Snapshots-and-Restore/01-kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. We are going to use this in our MySQL Deployment) 19 | -------------------------------------------------------------------------------- /26-GKE-PD-Volume-Snapshots-and-Restore/01-kube-manifests/03-mysql-deployment.yaml: -------------------------------------------------------------------------------- 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:8.0 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: mysql-pv-claim 35 | - name: usermanagement-dbcreation-script 36 | configMap: 37 | name: usermanagement-dbcreation-script 38 | 39 | -------------------------------------------------------------------------------- /26-GKE-PD-Volume-Snapshots-and-Restore/01-kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /26-GKE-PD-Volume-Snapshots-and-Restore/01-kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /26-GKE-PD-Volume-Snapshots-and-Restore/02-Volume-Snapshot/01-VolumeSnapshotClass.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: snapshot.storage.k8s.io/v1 2 | kind: VolumeSnapshotClass 3 | metadata: 4 | name: my-snapshotclass 5 | driver: pd.csi.storage.gke.io 6 | deletionPolicy: Delete 7 | #parameters: 8 | # storage-locations: us-east2 9 | 10 | # Optional Note: 11 | # To use a custom storage location, add a storage-locations parameter to the snapshot class. 12 | # To use this parameter, your clusters must use version 1.21 or later. 13 | 14 | 15 | -------------------------------------------------------------------------------- /26-GKE-PD-Volume-Snapshots-and-Restore/02-Volume-Snapshot/02-VolumeSnapshot.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: snapshot.storage.k8s.io/v1 2 | kind: VolumeSnapshot 3 | metadata: 4 | name: my-snapshot1 5 | spec: 6 | volumeSnapshotClassName: my-snapshotclass 7 | source: 8 | persistentVolumeClaimName: mysql-pv-claim -------------------------------------------------------------------------------- /26-GKE-PD-Volume-Snapshots-and-Restore/03-Volume-Restore/01-restore-pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: pvc-restore 5 | spec: 6 | dataSource: 7 | name: my-snapshot1 8 | kind: VolumeSnapshot 9 | apiGroup: snapshot.storage.k8s.io 10 | storageClassName: standard-rwo 11 | accessModes: 12 | - ReadWriteOnce 13 | resources: 14 | requests: 15 | storage: 4Gi -------------------------------------------------------------------------------- /26-GKE-PD-Volume-Snapshots-and-Restore/03-Volume-Restore/02-mysql-deployment.yaml: -------------------------------------------------------------------------------- 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:8.0 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: mysql-pv-claim 35 | claimName: pvc-restore 36 | - name: usermanagement-dbcreation-script 37 | configMap: 38 | name: usermanagement-dbcreation-script 39 | 40 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/01-kube-manifests/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/01-kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. We are going to use this in our MySQL Deployment) 19 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/01-kube-manifests/03-mysql-deployment.yaml: -------------------------------------------------------------------------------- 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:8.0 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: mysql-pv-claim 35 | - name: usermanagement-dbcreation-script 36 | configMap: 37 | name: usermanagement-dbcreation-script 38 | 39 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/01-kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/01-kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/02-Use-Cloned-Volume-kube-manifests/01-podpvc-clone.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: podpvc-clone 5 | spec: 6 | dataSource: 7 | name: mysql-pv-claim # the name of the source PersistentVolumeClaim that you created as part of UMS Web App 8 | kind: PersistentVolumeClaim 9 | accessModes: 10 | - ReadWriteOnce 11 | storageClassName: standard-rwo # same as the StorageClass of the source PersistentVolumeClaim. 12 | resources: 13 | requests: 14 | storage: 4Gi # the amount of storage to request, which must be at least the size of the source PersistentVolumeClaim -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/02-Use-Cloned-Volume-kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script2 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. We are going to use this in our MySQL Deployment) 19 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/02-Use-Cloned-Volume-kube-manifests/03-mysql-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql2 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: mysql2 10 | strategy: 11 | type: Recreate 12 | template: 13 | metadata: 14 | labels: 15 | app: mysql2 16 | spec: 17 | containers: 18 | - name: mysql2 19 | image: mysql:8.0 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: mysql-pv-claim 35 | claimName: podpvc-clone 36 | - name: usermanagement-dbcreation-script 37 | configMap: 38 | name: usermanagement-dbcreation-script2 39 | 40 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/02-Use-Cloned-Volume-kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql2 5 | spec: 6 | selector: 7 | app: mysql2 8 | ports: 9 | - port: 3306 10 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/02-Use-Cloned-Volume-kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp2-lb-service 5 | labels: 6 | app: usermgmt-webapp2 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp2 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/03-With-NodeSelectors/01-kube-manifests/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/03-With-NodeSelectors/01-kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. We are going to use this in our MySQL Deployment) 19 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/03-With-NodeSelectors/01-kube-manifests/03-mysql-deployment.yaml: -------------------------------------------------------------------------------- 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 | nodeSelector: 18 | nodetype: db 19 | containers: 20 | - name: mysql 21 | image: mysql:8.0 22 | env: 23 | - name: MYSQL_ROOT_PASSWORD 24 | value: dbpassword11 25 | ports: 26 | - containerPort: 3306 27 | name: mysql 28 | volumeMounts: 29 | - name: mysql-persistent-storage 30 | mountPath: /var/lib/mysql 31 | - name: usermanagement-dbcreation-script 32 | mountPath: /docker-entrypoint-initdb.d #https://hub.docker.com/_/mysql Refer Initializing a fresh instance 33 | volumes: 34 | - name: mysql-persistent-storage 35 | persistentVolumeClaim: 36 | claimName: mysql-pv-claim 37 | - name: usermanagement-dbcreation-script 38 | configMap: 39 | name: usermanagement-dbcreation-script 40 | 41 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/03-With-NodeSelectors/01-kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/03-With-NodeSelectors/01-kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/03-With-NodeSelectors/02-Use-Cloned-Volume-kube-manifests/01-podpvc-clone.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: podpvc-clone 5 | spec: 6 | dataSource: 7 | name: mysql-pv-claim # the name of the source PersistentVolumeClaim that you created as part of UMS Web App 8 | kind: PersistentVolumeClaim 9 | accessModes: 10 | - ReadWriteOnce 11 | storageClassName: standard-rwo # same as the StorageClass of the source PersistentVolumeClaim. 12 | resources: 13 | requests: 14 | storage: 4Gi # the amount of storage to request, which must be at least the size of the source PersistentVolumeClaim -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/03-With-NodeSelectors/02-Use-Cloned-Volume-kube-manifests/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script2 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. We are going to use this in our MySQL Deployment) 19 | -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/03-With-NodeSelectors/02-Use-Cloned-Volume-kube-manifests/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql2 5 | spec: 6 | selector: 7 | app: mysql2 8 | ports: 9 | - port: 3306 10 | clusterIP: None # This means we are going to use Pod IP -------------------------------------------------------------------------------- /27-GKE-PD-Volume-Clone/03-With-NodeSelectors/02-Use-Cloned-Volume-kube-manifests/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp2-lb-service 5 | labels: 6 | app: usermgmt-webapp2 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp2 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /28-GKE-Storage-with-GCP-CloudSQL-Public/kube-manifests/01-MySQL-externalName-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql-externalname-service 5 | spec: 6 | type: ExternalName 7 | externalName: 35.226.81.153 -------------------------------------------------------------------------------- /28-GKE-Storage-with-GCP-CloudSQL-Public/kube-manifests/02-Kubernetes-Secrets.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: S2FseWFuUmVkZHkxMw== 8 | 9 | # Base64 of KalyanReddy13 10 | # https://www.base64encode.org/ 11 | # Base64 of KalyanReddy13 is S2FseWFuUmVkZHkxMw== -------------------------------------------------------------------------------- /28-GKE-Storage-with-GCP-CloudSQL-Public/kube-manifests/04-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /29-GKE-Storage-with-GCP-CloudSQL-Private/kube-manifests/01-MySQL-externalName-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql-externalname-service 5 | spec: 6 | type: ExternalName 7 | externalName: 10.80.0.3 -------------------------------------------------------------------------------- /29-GKE-Storage-with-GCP-CloudSQL-Private/kube-manifests/02-Kubernetes-Secrets.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: S2FseWFuUmVkZHkxMw== 8 | 9 | # Base64 of KalyanReddy13 10 | # https://www.base64encode.org/ 11 | # Base64 of KalyanReddy13 is S2FseWFuUmVkZHkxMw== -------------------------------------------------------------------------------- /29-GKE-Storage-with-GCP-CloudSQL-Private/kube-manifests/04-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /30-GCP-CloudSQL-Private-NO-ExternalNameService/kube-manifests/01-Kubernetes-Secrets.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | type: Opaque 6 | data: 7 | db-password: S2FseWFuUmVkZHkxMw== 8 | 9 | # Base64 of KalyanReddy13 10 | # https://www.base64encode.org/ 11 | # Base64 of KalyanReddy13 is S2FseWFuUmVkZHkxMw== -------------------------------------------------------------------------------- /30-GCP-CloudSQL-Private-NO-ExternalNameService/kube-manifests/03-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | labels: 6 | app: usermgmt-webapp 7 | spec: 8 | type: LoadBalancer 9 | selector: 10 | app: usermgmt-webapp 11 | ports: 12 | - port: 80 # Service Port 13 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /31-GKE-FileStore-default-StorageClass/kube-manifests/01-filestore-pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: gke-filestore-pvc 5 | spec: 6 | accessModes: 7 | - ReadWriteMany 8 | storageClassName: standard-rwx 9 | resources: 10 | requests: 11 | storage: 1Ti 12 | -------------------------------------------------------------------------------- /31-GKE-FileStore-default-StorageClass/kube-manifests/02-write-to-filestore-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: filestore-writer-app 5 | spec: 6 | containers: 7 | - name: app 8 | image: centos 9 | command: ["/bin/sh"] 10 | args: ["-c", "while true; do echo GCP Cloud FileStore used as PV in GKE $(date -u) >> /data/myapp1.txt; sleep 5; done"] 11 | volumeMounts: 12 | - name: persistent-storage 13 | mountPath: /data 14 | volumes: 15 | - name: persistent-storage 16 | persistentVolumeClaim: 17 | claimName: gke-filestore-pvc -------------------------------------------------------------------------------- /31-GKE-FileStore-default-StorageClass/kube-manifests/03-myapp1-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | volumeMounts: 22 | - name: persistent-storage 23 | mountPath: /usr/share/nginx/html/filestore 24 | volumes: 25 | - name: persistent-storage 26 | persistentVolumeClaim: 27 | claimName: gke-filestore-pvc 28 | -------------------------------------------------------------------------------- /31-GKE-FileStore-default-StorageClass/kube-manifests/04-loadBalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /32-GKE-FileStore-custom-StorageClass/kube-manifests/00-filestore-storage-class.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: filestore-storage-class 5 | provisioner: filestore.csi.storage.gke.io # File Store CSI Driver 6 | volumeBindingMode: WaitForFirstConsumer 7 | allowVolumeExpansion: true 8 | parameters: 9 | tier: standard # Allowed values standard, premium, or enterprise 10 | network: default # The network parameter can be used when provisioning Filestore instances on non-default VPCs. Non-default VPCs require special firewall rules to be set up. -------------------------------------------------------------------------------- /32-GKE-FileStore-custom-StorageClass/kube-manifests/01-filestore-pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: gke-filestore-pvc 5 | spec: 6 | accessModes: 7 | - ReadWriteMany 8 | storageClassName: filestore-storage-class 9 | resources: 10 | requests: 11 | storage: 1Ti 12 | -------------------------------------------------------------------------------- /32-GKE-FileStore-custom-StorageClass/kube-manifests/02-write-to-filestore-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: filestore-writer-app 5 | spec: 6 | containers: 7 | - name: app 8 | image: centos 9 | command: ["/bin/sh"] 10 | args: ["-c", "while true; do echo GCP Cloud FileStore used as PV in GKE $(date -u) >> /data/myapp1.txt; sleep 5; done"] 11 | volumeMounts: 12 | - name: persistent-storage 13 | mountPath: /data 14 | volumes: 15 | - name: persistent-storage 16 | persistentVolumeClaim: 17 | claimName: gke-filestore-pvc -------------------------------------------------------------------------------- /32-GKE-FileStore-custom-StorageClass/kube-manifests/03-myapp1-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | volumeMounts: 22 | - name: persistent-storage 23 | mountPath: /usr/share/nginx/html/filestore 24 | volumes: 25 | - name: persistent-storage 26 | persistentVolumeClaim: 27 | claimName: gke-filestore-pvc 28 | -------------------------------------------------------------------------------- /32-GKE-FileStore-custom-StorageClass/kube-manifests/04-loadBalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /33-GKE-FileStore-Backup-and-Restore/01-myapp1-kube-manifests/01-filestore-pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: gke-filestore-pvc 5 | spec: 6 | accessModes: 7 | - ReadWriteMany 8 | storageClassName: standard-rwx 9 | resources: 10 | requests: 11 | #storage: 1Ti 12 | storage: 100Gi -------------------------------------------------------------------------------- /33-GKE-FileStore-Backup-and-Restore/01-myapp1-kube-manifests/02-write-to-filestore-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: filestore-writer-app 5 | spec: 6 | containers: 7 | - name: app 8 | image: centos 9 | command: ["/bin/sh"] 10 | args: ["-c", "while true; do echo GCP Cloud FileStore used as PV in GKE $(date -u) >> /data/myapp1.txt; sleep 5; done"] 11 | volumeMounts: 12 | - name: persistent-storage 13 | mountPath: /data 14 | volumes: 15 | - name: persistent-storage 16 | persistentVolumeClaim: 17 | claimName: gke-filestore-pvc -------------------------------------------------------------------------------- /33-GKE-FileStore-Backup-and-Restore/01-myapp1-kube-manifests/03-myapp1-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | volumeMounts: 22 | - name: persistent-storage 23 | mountPath: /usr/share/nginx/html/filestore 24 | volumes: 25 | - name: persistent-storage 26 | persistentVolumeClaim: 27 | claimName: gke-filestore-pvc 28 | -------------------------------------------------------------------------------- /33-GKE-FileStore-Backup-and-Restore/01-myapp1-kube-manifests/04-loadBalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | 14 | # This will create a Classic Load Balancer 15 | # AWS will be retiring the EC2-Classic network on August 15, 2022. -------------------------------------------------------------------------------- /33-GKE-FileStore-Backup-and-Restore/02-volume-backup-kube-manifests/01-VolumeSnapshotClass.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: snapshot.storage.k8s.io/v1 2 | kind: VolumeSnapshotClass 3 | metadata: 4 | name: csi-gcp-filestore-backup-snap-class 5 | driver: filestore.csi.storage.gke.io 6 | parameters: 7 | type: backup 8 | deletionPolicy: Delete -------------------------------------------------------------------------------- /33-GKE-FileStore-Backup-and-Restore/02-volume-backup-kube-manifests/02-VolumeSnapshot.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: snapshot.storage.k8s.io/v1 2 | kind: VolumeSnapshot 3 | metadata: 4 | name: myapp1-volume-snapshot 5 | spec: 6 | volumeSnapshotClassName: csi-gcp-filestore-backup-snap-class 7 | source: 8 | persistentVolumeClaimName: gke-filestore-pvc -------------------------------------------------------------------------------- /33-GKE-FileStore-Backup-and-Restore/03-volume-restore-myapp2-kube-manifests/01-filestore-pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: restored-filestore-pvc 5 | spec: 6 | accessModes: 7 | - ReadWriteMany 8 | storageClassName: standard-rwx 9 | resources: 10 | requests: 11 | storage: 1Ti 12 | dataSource: 13 | kind: VolumeSnapshot 14 | name: myapp1-volume-snapshot 15 | apiGroup: snapshot.storage.k8s.io -------------------------------------------------------------------------------- /33-GKE-FileStore-Backup-and-Restore/03-volume-restore-myapp2-kube-manifests/02-myapp2-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp2-deployment 5 | spec: # Dictionary 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp2 10 | template: 11 | metadata: # Dictionary 12 | name: myapp2-pod 13 | labels: # Dictionary 14 | app: myapp2 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp2-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | volumeMounts: 22 | - name: persistent-storage 23 | mountPath: /usr/share/nginx/html/filestore 24 | volumes: 25 | - name: persistent-storage 26 | persistentVolumeClaim: 27 | claimName: restored-filestore-pvc 28 | -------------------------------------------------------------------------------- /33-GKE-FileStore-Backup-and-Restore/03-volume-restore-myapp2-kube-manifests/03-myapp2-loadBalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp2-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp2 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /34-GKE-Ingress-Basics/kube-manifests/01-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app3-nginx-nodeport-service 27 | labels: 28 | app: app3-nginx 29 | annotations: 30 | spec: 31 | type: NodePort 32 | selector: 33 | app: app3-nginx 34 | ports: 35 | - port: 80 36 | targetPort: 80 37 | 38 | -------------------------------------------------------------------------------- /34-GKE-Ingress-Basics/kube-manifests/02-ingress-basic.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-basics 5 | annotations: 6 | # If the class annotation is not specified it defaults to "gce". 7 | # gce: external load balancer 8 | # gce-internal: internal load balancer 9 | kubernetes.io/ingress.class: "gce" 10 | spec: 11 | defaultBackend: 12 | service: 13 | name: app3-nginx-nodeport-service 14 | port: 15 | number: 80 16 | 17 | -------------------------------------------------------------------------------- /35-GKE-Ingress-Context-Path-Routing/kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | spec: 31 | type: NodePort 32 | selector: 33 | app: app1-nginx 34 | ports: 35 | - port: 80 36 | targetPort: 80 -------------------------------------------------------------------------------- /35-GKE-Ingress-Context-Path-Routing/kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | spec: 31 | type: NodePort 32 | selector: 33 | app: app2-nginx 34 | ports: 35 | - port: 80 36 | targetPort: 80 37 | 38 | -------------------------------------------------------------------------------- /35-GKE-Ingress-Context-Path-Routing/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: app3-nginx-nodeport-service 27 | labels: 28 | app: app3-nginx 29 | annotations: 30 | spec: 31 | type: NodePort 32 | selector: 33 | app: app3-nginx 34 | ports: 35 | - port: 80 36 | targetPort: 80 -------------------------------------------------------------------------------- /35-GKE-Ingress-Context-Path-Routing/kube-manifests/04-Ingress-ContextPath-Based-Routing.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-cpr 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | spec: 9 | defaultBackend: 10 | service: 11 | name: app3-nginx-nodeport-service 12 | port: 13 | number: 80 14 | rules: 15 | - http: 16 | paths: 17 | - path: /app1 18 | pathType: Prefix 19 | backend: 20 | service: 21 | name: app1-nginx-nodeport-service 22 | port: 23 | number: 80 24 | - path: /app2 25 | pathType: Prefix 26 | backend: 27 | service: 28 | name: app2-nginx-nodeport-service 29 | port: 30 | number: 80 31 | # - path: / 32 | # pathType: Prefix 33 | # backend: 34 | # service: 35 | # name: app3-nginx-nodeport-service 36 | # port: 37 | # number: 80 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /36-GKE-Ingress-Custom-Health-Check/kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app1/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app1-nginx-nodeport-service 36 | labels: 37 | app: app1-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app1-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /36-GKE-Ingress-Custom-Health-Check/kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app2/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app2-nginx-nodeport-service 36 | labels: 37 | app: app2-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app2-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /36-GKE-Ingress-Custom-Health-Check/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | labels: 37 | app: app3-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app3-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 -------------------------------------------------------------------------------- /36-GKE-Ingress-Custom-Health-Check/kube-manifests/04-Ingress-Custom-Healthcheck.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-custom-healthcheck 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | spec: 9 | defaultBackend: 10 | service: 11 | name: app3-nginx-nodeport-service 12 | port: 13 | number: 80 14 | rules: 15 | - http: 16 | paths: 17 | - path: /app1 18 | pathType: Prefix 19 | backend: 20 | service: 21 | name: app1-nginx-nodeport-service 22 | port: 23 | number: 80 24 | - path: /app2 25 | pathType: Prefix 26 | backend: 27 | service: 28 | name: app2-nginx-nodeport-service 29 | port: 30 | number: 80 31 | # - path: / 32 | # pathType: Prefix 33 | # backend: 34 | # service: 35 | # name: app3-nginx-nodeport-service 36 | # port: 37 | # number: 80 38 | 39 | 40 | -------------------------------------------------------------------------------- /37-Google-Cloud-Domains/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Google Cloud Domains 3 | description: Register Domain Name using Google Cloud Domains 4 | --- 5 | 6 | ## Step-01: Introduction 7 | - Register Domain Name using Google Cloud Domains 8 | 9 | ## Step-02: Register Domain 10 | - Go to Networking Services -> Cloud Domains -> Click on **REGISTER DOMAIN** 11 | - **Search Domain:** kalyanreddydaida.com 12 | - Click on **SELECT** 13 | - Click on **CONTINUE** 14 | - **DNS CONFIGURATION** 15 | - **DNS Provider:** Use Cloud DNS (Recommended) 16 | - Click on **CONTINUE** 17 | - **Privacy protection** 18 | - **Privacy Protection:** Privacy Protection ON 19 | - **Contact details** 20 | - Fill Contact Details 21 | - Click on **REGISTER** 22 | 23 | ## Step-03: Review the new domain at Cloud Domains Page 24 | - Go to Networking Services -> Cloud Domains 25 | - Review all details populated correctly 26 | 27 | ## Step-04: Cloud DNS 28 | - Go to Networking Services -> Cloud DNS -> kalyanreddydaida-com 29 | - Review all details -------------------------------------------------------------------------------- /38-GKE-Ingress-ExternalIP/kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app1/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app1-nginx-nodeport-service 36 | labels: 37 | app: app1-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app1-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /38-GKE-Ingress-ExternalIP/kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app2/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app2-nginx-nodeport-service 36 | labels: 37 | app: app2-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app2-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /38-GKE-Ingress-ExternalIP/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | labels: 37 | app: app3-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app3-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 -------------------------------------------------------------------------------- /38-GKE-Ingress-ExternalIP/kube-manifests/04-Ingress-external-ip.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-external-ip 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | # Static IP for Ingress Service 9 | kubernetes.io/ingress.global-static-ip-name: "gke-ingress-extip1" 10 | spec: 11 | defaultBackend: 12 | service: 13 | name: app3-nginx-nodeport-service 14 | port: 15 | number: 80 16 | rules: 17 | - http: 18 | paths: 19 | - path: /app1 20 | pathType: Prefix 21 | backend: 22 | service: 23 | name: app1-nginx-nodeport-service 24 | port: 25 | number: 80 26 | - path: /app2 27 | pathType: Prefix 28 | backend: 29 | service: 30 | name: app2-nginx-nodeport-service 31 | port: 32 | number: 80 33 | -------------------------------------------------------------------------------- /39-GKE-Ingress-Google-Managed-SSL/kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app1/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app1-nginx-nodeport-service 36 | labels: 37 | app: app1-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app1-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /39-GKE-Ingress-Google-Managed-SSL/kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app2/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app2-nginx-nodeport-service 36 | labels: 37 | app: app2-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app2-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /39-GKE-Ingress-Google-Managed-SSL/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | labels: 37 | app: app3-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app3-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 -------------------------------------------------------------------------------- /39-GKE-Ingress-Google-Managed-SSL/kube-manifests/04-Ingress-SSL.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-ssl 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | # Static IP for Ingress Service 9 | kubernetes.io/ingress.global-static-ip-name: "gke-ingress-extip1" 10 | # Google Managed SSL Certificates 11 | networking.gke.io/managed-certificates: managed-cert-for-ingress 12 | spec: 13 | defaultBackend: 14 | service: 15 | name: app3-nginx-nodeport-service 16 | port: 17 | number: 80 18 | rules: 19 | - http: 20 | paths: 21 | - path: /app1 22 | pathType: Prefix 23 | backend: 24 | service: 25 | name: app1-nginx-nodeport-service 26 | port: 27 | number: 80 28 | - path: /app2 29 | pathType: Prefix 30 | backend: 31 | service: 32 | name: app2-nginx-nodeport-service 33 | port: 34 | number: 80 35 | 36 | -------------------------------------------------------------------------------- /39-GKE-Ingress-Google-Managed-SSL/kube-manifests/05-Managed-Certificate.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1 2 | kind: ManagedCertificate 3 | metadata: 4 | name: managed-cert-for-ingress 5 | spec: 6 | domains: 7 | - demo1.kalyanreddydaida.com 8 | -------------------------------------------------------------------------------- /40-GKE-Ingress-Google-Managed-SSL-Redirect/kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app1/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app1-nginx-nodeport-service 36 | labels: 37 | app: app1-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app1-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /40-GKE-Ingress-Google-Managed-SSL-Redirect/kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app2/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app2-nginx-nodeport-service 36 | labels: 37 | app: app2-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app2-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /40-GKE-Ingress-Google-Managed-SSL-Redirect/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | labels: 37 | app: app3-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app3-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 -------------------------------------------------------------------------------- /40-GKE-Ingress-Google-Managed-SSL-Redirect/kube-manifests/04-Ingress-SSL.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-ssl 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | # Static IP for Ingress Service 9 | kubernetes.io/ingress.global-static-ip-name: "gke-ingress-extip1" 10 | # Google Managed SSL Certificates 11 | networking.gke.io/managed-certificates: managed-cert-for-ingress 12 | # SSL Redirect HTTP to HTTPS 13 | networking.gke.io/v1beta1.FrontendConfig: "my-frontend-config" 14 | spec: 15 | defaultBackend: 16 | service: 17 | name: app3-nginx-nodeport-service 18 | port: 19 | number: 80 20 | rules: 21 | - http: 22 | paths: 23 | - path: /app1 24 | pathType: Prefix 25 | backend: 26 | service: 27 | name: app1-nginx-nodeport-service 28 | port: 29 | number: 80 30 | - path: /app2 31 | pathType: Prefix 32 | backend: 33 | service: 34 | name: app2-nginx-nodeport-service 35 | port: 36 | number: 80 37 | -------------------------------------------------------------------------------- /40-GKE-Ingress-Google-Managed-SSL-Redirect/kube-manifests/05-Managed-Certificate.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1 2 | kind: ManagedCertificate 3 | metadata: 4 | name: managed-cert-for-ingress 5 | spec: 6 | domains: 7 | - demo1.kalyanreddydaida.com -------------------------------------------------------------------------------- /40-GKE-Ingress-Google-Managed-SSL-Redirect/kube-manifests/06-frontendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1beta1 2 | kind: FrontendConfig 3 | metadata: 4 | name: my-frontend-config 5 | spec: 6 | redirectToHttps: 7 | enabled: true 8 | #responseCodeName: RESPONSE_CODE -------------------------------------------------------------------------------- /41-GKE-Workload-Identity/kube-manifests/01-wid-demo-pod-without-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: wid-demo-without-sa 5 | namespace: wid-kns 6 | spec: 7 | containers: 8 | - image: google/cloud-sdk:slim 9 | name: wid-demo-without-sa 10 | command: ["sleep","infinity"] 11 | #serviceAccountName: wid-ksa 12 | nodeSelector: 13 | iam.gke.io/gke-metadata-server-enabled: "true" -------------------------------------------------------------------------------- /41-GKE-Workload-Identity/kube-manifests/02-wid-demo-pod-with-sa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: wid-demo-with-sa 5 | namespace: wid-kns 6 | spec: 7 | containers: 8 | - image: google/cloud-sdk:slim 9 | name: wid-demo-with-sa 10 | command: ["sleep","infinity"] 11 | serviceAccountName: wid-ksa 12 | nodeSelector: 13 | iam.gke.io/gke-metadata-server-enabled: "true" -------------------------------------------------------------------------------- /43-GKE-ExternalDNS-Ingress-Demo/kube-manifests/01-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | spec: 37 | type: NodePort 38 | selector: 39 | app: app3-nginx 40 | ports: 41 | - port: 80 42 | targetPort: 80 43 | 44 | -------------------------------------------------------------------------------- /43-GKE-ExternalDNS-Ingress-Demo/kube-manifests/02-ingress-external-dns.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-externaldns-demo 5 | annotations: 6 | # If the class annotation is not specified it defaults to "gce". 7 | # gce: external load balancer 8 | # gce-internal: internal load balancer 9 | kubernetes.io/ingress.class: "gce" 10 | # External DNS - For creating a Record Set in Google Cloud - Cloud DNS 11 | external-dns.alpha.kubernetes.io/hostname: ingressextdns101.kalyanreddydaida.com 12 | spec: 13 | defaultBackend: 14 | service: 15 | name: app3-nginx-nodeport-service 16 | port: 17 | number: 80 18 | 19 | -------------------------------------------------------------------------------- /44-GKE-ExternalDNS-Service-Demo/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | -------------------------------------------------------------------------------- /44-GKE-ExternalDNS-Service-Demo/kube-manifests/02-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | annotations: 6 | # External DNS - For creating a Record Set in Google Cloud Cloud DNS 7 | external-dns.alpha.kubernetes.io/hostname: extdns-k8s-svc-demo.kalyanreddydaida.com 8 | spec: 9 | type: LoadBalancer # ClusterIp, # NodePort 10 | selector: 11 | app: myapp1 12 | ports: 13 | - name: http 14 | port: 80 # Service Port 15 | targetPort: 80 # Container Port 16 | -------------------------------------------------------------------------------- /45-GKE-Ingress-NameBasedVhost-Routing/kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app1/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app1-nginx-nodeport-service 36 | labels: 37 | app: app1-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app1-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /45-GKE-Ingress-NameBasedVhost-Routing/kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app2/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app2-nginx-nodeport-service 36 | labels: 37 | app: app2-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app2-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /45-GKE-Ingress-NameBasedVhost-Routing/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | labels: 37 | app: app3-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app3-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 -------------------------------------------------------------------------------- /45-GKE-Ingress-NameBasedVhost-Routing/kube-manifests/05-Managed-Certificate.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1 2 | kind: ManagedCertificate 3 | metadata: 4 | name: managed-cert-for-ingress 5 | spec: 6 | domains: 7 | - default-ingress.kalyanreddydaida.com 8 | - app1-ingress.kalyanreddydaida.com 9 | - app2-ingress.kalyanreddydaida.com -------------------------------------------------------------------------------- /45-GKE-Ingress-NameBasedVhost-Routing/kube-manifests/06-frontendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1beta1 2 | kind: FrontendConfig 3 | metadata: 4 | name: my-frontend-config 5 | spec: 6 | redirectToHttps: 7 | enabled: true 8 | #responseCodeName: RESPONSE_CODE -------------------------------------------------------------------------------- /46-GKE-Ingress-SSL-Policy/kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app1/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app1-nginx-nodeport-service 36 | labels: 37 | app: app1-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app1-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /46-GKE-Ingress-SSL-Policy/kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app2/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app2-nginx-nodeport-service 36 | labels: 37 | app: app2-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app2-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /46-GKE-Ingress-SSL-Policy/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | labels: 37 | app: app3-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app3-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 -------------------------------------------------------------------------------- /46-GKE-Ingress-SSL-Policy/kube-manifests/05-Managed-Certificate.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1 2 | kind: ManagedCertificate 3 | metadata: 4 | name: managed-cert-for-ingress 5 | spec: 6 | domains: 7 | - default-ingress.kalyanreddydaida.com 8 | - app1-ingress.kalyanreddydaida.com 9 | - app2-ingress.kalyanreddydaida.com -------------------------------------------------------------------------------- /46-GKE-Ingress-SSL-Policy/kube-manifests/06-frontendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1beta1 2 | kind: FrontendConfig 3 | metadata: 4 | name: my-frontend-config 5 | spec: 6 | # HTTP to HTTPS Redirect 7 | redirectToHttps: 8 | enabled: true 9 | #responseCodeName: RESPONSE_CODE 10 | # SSL Policy 11 | sslPolicy: gke-ingress-ssl-policy -------------------------------------------------------------------------------- /47-GKE-Ingress-with-Identity-Aware-Proxy/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | labels: 37 | app: app3-nginx 38 | annotations: 39 | cloud.google.com/backend-config: '{"default": "my-backendconfig"}' 40 | spec: 41 | type: NodePort 42 | selector: 43 | app: app3-nginx 44 | ports: 45 | - port: 80 46 | targetPort: 80 -------------------------------------------------------------------------------- /47-GKE-Ingress-with-Identity-Aware-Proxy/kube-manifests/05-Managed-Certificate.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1 2 | kind: ManagedCertificate 3 | metadata: 4 | name: managed-cert-for-ingress 5 | spec: 6 | domains: 7 | - default-ingress.kalyanreddydaida.com 8 | - app1-ingress.kalyanreddydaida.com 9 | - app2-ingress.kalyanreddydaida.com -------------------------------------------------------------------------------- /47-GKE-Ingress-with-Identity-Aware-Proxy/kube-manifests/06-frontendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1beta1 2 | kind: FrontendConfig 3 | metadata: 4 | name: my-frontend-config 5 | spec: 6 | redirectToHttps: 7 | enabled: true 8 | #responseCodeName: RESPONSE_CODE -------------------------------------------------------------------------------- /47-GKE-Ingress-with-Identity-Aware-Proxy/kube-manifests/07-backendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cloud.google.com/v1 2 | kind: BackendConfig 3 | metadata: 4 | name: my-backendconfig 5 | spec: 6 | iap: 7 | enabled: true 8 | oauthclientCredentials: 9 | secretName: my-secret 10 | 11 | # sampleRate: Specify a value from 0.0 through 1.0, where 0.0 means no packets are logged 12 | # and 1.0 means 100% of packets are logged. This field is only relevant if enable is set 13 | # to true. sampleRate is an optional field, but if it's configured then enable: true must 14 | # also be set or else it is interpreted as enable: false. -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/SSL-SelfSigned-Certs/app1-ingress.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICzzCCAbcCFDQiqvY0cwNLP1ljifVfveOZo7G4MA0GCSqGSIb3DQEBCwUAMCQx 3 | IjAgBgNVBAMMGWFwcDEua2FseWFucmVkZHlkYWlkYS5jb20wHhcNMjIxMTI1MDIx 4 | MDUyWhcNNDIxMTIwMDIxMDUyWjAkMSIwIAYDVQQDDBlhcHAxLmthbHlhbnJlZGR5 5 | ZGFpZGEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5Nt/2cBg 6 | HSkMXNo04h9tN8f8ioPkZkl5rFwNmgW+tGei4wa2QFRt0xCeOyd7+0GWmyH6602M 7 | i3WabHTruHKWsCAikx20KaOEjYF+cmDMpWQdrWADoAIIfov+BO9VTmFJUX9JUDiR 8 | f6CHxtCZIifL4VM0InSpMIy4OJGQgzOVrlWwLYVcYla529VUGU5qBJFAliKve3N+ 9 | SBYoNI5uX0rERm4hqCUHKrQnsIfA0OnNccPdAoi+KmC/oipfUOpL9URholj7spAT 10 | JczcTGw+s7gehCDXm6YU7cBHtD2hLx106otEzJGIwys4JtmuKXtDw+w2eOGRUIrT 11 | Q7YLX6N5LJ8IDwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQABileCf1mnee2r0cLD 12 | 3bHaYo68JZkl9BS6dJN6DuOSD1Sha/NArgsuQa6uX8ApnUhTt5DucRyp7o5pdhCi 13 | rNaJwR9zYQmjxdH+RGtb5sPEAo7D47kQqp4wlJtL5AUfCI1nGgpg5cJCEqTVlbmP 14 | PEAJYlaWi8LNe4h+qukECcAA3Nsgvvm3Ls1qmKIEKJr05ppCq7EbYCrXJrN75Pl1 15 | 31w8Q0tr80qgNlhz65EyvLrIe6RK72qyOe9+oRCp9wRIoCvs47vUuNMfzZRxZXGn 16 | dPSLWkQt4LrQ/5RZr0lyUWtzr/l7GWu9GYljWe6toxTQHSqSkV/WAch8P4g0zvRJ 17 | NdHO 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/SSL-SelfSigned-Certs/app1-ingress.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICaTCCAVECAQAwJDEiMCAGA1UEAwwZYXBwMS5rYWx5YW5yZWRkeWRhaWRhLmNv 3 | bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOTbf9nAYB0pDFzaNOIf 4 | bTfH/IqD5GZJeaxcDZoFvrRnouMGtkBUbdMQnjsne/tBlpsh+utNjIt1mmx067hy 5 | lrAgIpMdtCmjhI2BfnJgzKVkHa1gA6ACCH6L/gTvVU5hSVF/SVA4kX+gh8bQmSIn 6 | y+FTNCJ0qTCMuDiRkIMzla5VsC2FXGJWudvVVBlOagSRQJYir3tzfkgWKDSObl9K 7 | xEZuIaglByq0J7CHwNDpzXHD3QKIvipgv6IqX1DqS/VEYaJY+7KQEyXM3ExsPrO4 8 | HoQg15umFO3AR7Q9oS8ddOqLRMyRiMMrOCbZril7Q8PsNnjhkVCK00O2C1+jeSyf 9 | CA8CAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQBexWuraAJF+txKTKQM6w2/Hnur 10 | 9BobBC/OYqdsracfmSAJ1eGEKI/ISUSZHVtZJptygxTEVXCTsN+ZukXlETM7AI4a 11 | Z8KatvHNrzhnpFV84ONpnCiUrQmik0IWwKcDJCzl4f7KUDITDC3hh5WGVY67OvuK 12 | mx03qu54ZFmFJkM2vwVn/ODbvdScYI5tDRjFIbyrwkxxW/1q1otkotOk7Z3hLdMN 13 | HWJh7IeXfw06q7+llX3Qg1OkpfyY682A0S2G2K6vrGFJUKFJ2CrPDzmht5G5kUz4 14 | HANxZuSKeHcI7rlB3IVyjNa77oXOX0+ZQLYgCf/cA3Lu2zAkhEvtq9ui0Edl 15 | -----END CERTIFICATE REQUEST----- 16 | -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/SSL-SelfSigned-Certs/app2-ingress.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICzzCCAbcCFBIM4d2+RH+OQFbNyPH7vO7dj4aAMA0GCSqGSIb3DQEBCwUAMCQx 3 | IjAgBgNVBAMMGWFwcDIua2FseWFucmVkZHlkYWlkYS5jb20wHhcNMjIxMTI1MDIx 4 | MjMxWhcNNDIxMTIwMDIxMjMxWjAkMSIwIAYDVQQDDBlhcHAyLmthbHlhbnJlZGR5 5 | ZGFpZGEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuKahBefa 6 | kPNvnvaxLkxnShxg5sX4P9FYlL1yCYLgrdW0DQWqouZ4nac31r4/YXeTJgXUCyQq 7 | HYy+tXNCangblaGFZXT71FcyoLT9RYE7p0/AePqHvP4gywJ/CEdk23obQak2Cuc/ 8 | cHoo/tnUnArevmvGoNLgb6TkHWiHE85LB8LPi1ra9KABU7/xF9XpyJWfRtkG8A7G 9 | jdbvggHVYD7l9oJyQB0+AcR7ddTbOk8D6CFHnMJa65/HyplErFWnrrKHvkKKqW6c 10 | f88kbp9qKPddmniwNOHqIu1QUADgJq97Y7fH9E0IZneMFWmGFRaXYxyUn4WziXEH 11 | npnbFg73/8FoFwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAAFOCpdOVoREKR6S6u 12 | F10Jp4DpQQDXsfgCVAxA58MNMGForwNhK1E28w0GBDm4K02nyOqqQxDWiFp8Am/T 13 | r+vzF1BBwNsiZ1r5naQTA5Jh2XgGrjOQOJhRZbEE4RwOxWsTvEyUJn2S0bYtGfES 14 | 5HjzZfq/0Gpxh3Z+oq8cINwzRzoirgf3Kk9SESvluxejnZMehVK5YIQp0IoM1Q5A 15 | t+ApJNyb107UxYLAfy8DSe5aMGtON8DYE+WLidL4CC1zRTABUjcBGsa09inGhgiF 16 | F5O8Eyc6LzA8EasmeJbWsUUYxUoLvq0OPXKq8Drjlt0SnttB4zpE8agtwzKKCodL 17 | tEoU 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/SSL-SelfSigned-Certs/app2-ingress.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICaTCCAVECAQAwJDEiMCAGA1UEAwwZYXBwMi5rYWx5YW5yZWRkeWRhaWRhLmNv 3 | bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALimoQXn2pDzb572sS5M 4 | Z0ocYObF+D/RWJS9cgmC4K3VtA0FqqLmeJ2nN9a+P2F3kyYF1AskKh2MvrVzQmp4 5 | G5WhhWV0+9RXMqC0/UWBO6dPwHj6h7z+IMsCfwhHZNt6G0GpNgrnP3B6KP7Z1JwK 6 | 3r5rxqDS4G+k5B1ohxPOSwfCz4ta2vSgAVO/8RfV6ciVn0bZBvAOxo3W74IB1WA+ 7 | 5faCckAdPgHEe3XU2zpPA+ghR5zCWuufx8qZRKxVp66yh75CiqlunH/PJG6faij3 8 | XZp4sDTh6iLtUFAA4Cave2O3x/RNCGZ3jBVphhUWl2MclJ+Fs4lxB56Z2xYO9//B 9 | aBcCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQBL3moJBmkteEAExoskvJrKbmW6 10 | aMyMFZmHUhPYqe8IkFG2/QRwN0C3r9lU8+UX0Qt+XqVx8hzi2FFsQYyZ/gdhZ1NP 11 | Oq60qH9Z95evTdIzN5FbkQiT1kgb1dGFs7WgcDLJM10dIeaq4M7MQrF3R99tEtbj 12 | EGiHQaXogqkIU5dcwoD9tZFB+7i7ymv6C19SSGHE/amIMFVp1hBfcKH7wxQ6wlZF 13 | Ll5WRTtdrM7E685VYKmH8ccF5rB+oyAH9be3kO2NWYo48QyoSnqk82UvmzcL0H/P 14 | +DUD7EfXQvlK02HfpmJxpWjT9wKYuA/AUC21L0w/gZWhXwAUnQtsbDGKxfKj 15 | -----END CERTIFICATE REQUEST----- 16 | -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/SSL-SelfSigned-Certs/app3-ingress.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC3zCCAccCFE5YVEQSuVzTlSNeeNV8BZuR6aWMMA0GCSqGSIb3DQEBCwUAMCwx 3 | KjAoBgNVBAMMIWFwcDMtZGVmYXVsdC5rYWx5YW5yZWRkeWRhaWRhLmNvbTAeFw0y 4 | MjExMjUwMjEzMDVaFw00MjExMjAwMjEzMDVaMCwxKjAoBgNVBAMMIWFwcDMtZGVm 5 | YXVsdC5rYWx5YW5yZWRkeWRhaWRhLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP 6 | ADCCAQoCggEBAKI6FJgH3TJ5ejRd7H/AvY+7EN0Vft/BQDoEfcjEUwrc7VM5/wgM 7 | ExE5Uj1Z0aMvIAruEMq2Zxe+dDHmqircrLHzH5uPjni3iBQ7dxvOGZTcdIM6JIax 8 | rauZJ5XtyXWBDvWACag59LtmFNtLXQQjNJHOKHZpZgi3bG49t26Aw9F0EelUCNpX 9 | RhBMX8wzT+gz0B0RA+Lj5B2wwGm2z+GgcM8E0jScaTgBQfhQM/kHp8oSNifySO7S 10 | p0z7zLc4h6fvfZhjPw/g7PYCksSm6wS0DJxzloeaxfudc5GHejlk13EX9FCnTx8s 11 | lWwQBBbpjv8Ht/J4QY3WKXDFR8od2wcUjKcCAwEAATANBgkqhkiG9w0BAQsFAAOC 12 | AQEAJ4tl2RjaRciW5aemwS1cGkGwyEZOqrkBRRTxzBhKu/XYgMzzfFDRux/04QQR 13 | w214mPwTKhsO4laUQ0d0457AS+2dyFsqLT46lQynXqZilr8IrSYENdnnZV7qqw7h 14 | e5Js/EUw2sCjtnQiz5W3Ty/+TuDN6vhLDeU6e+68TEOjqyVEym6pISNJekw1IAL6 15 | tO1nvb+Pj1Gq6tXbf8lXgr5ys6NU65sc6CpZQwD/FWWy0A4sLFjyHSproeNFxaln 16 | qBvj/5I4At0M6eJ6RtNGx9fem/VpOUWhjprsiYIDXBBbEOHmPKrc9u0I3VdfwREy 17 | Mmm+XAsfEVITpRvcDwoUHVsgKw== 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/SSL-SelfSigned-Certs/app3-ingress.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICcTCCAVkCAQAwLDEqMCgGA1UEAwwhYXBwMy1kZWZhdWx0LmthbHlhbnJlZGR5 3 | ZGFpZGEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAojoUmAfd 4 | Mnl6NF3sf8C9j7sQ3RV+38FAOgR9yMRTCtztUzn/CAwTETlSPVnRoy8gCu4QyrZn 5 | F750MeaqKtyssfMfm4+OeLeIFDt3G84ZlNx0gzokhrGtq5knle3JdYEO9YAJqDn0 6 | u2YU20tdBCM0kc4odmlmCLdsbj23boDD0XQR6VQI2ldGEExfzDNP6DPQHRED4uPk 7 | HbDAabbP4aBwzwTSNJxpOAFB+FAz+QenyhI2J/JI7tKnTPvMtziHp+99mGM/D+Ds 8 | 9gKSxKbrBLQMnHOWh5rF+51zkYd6OWTXcRf0UKdPHyyVbBAEFumO/we38nhBjdYp 9 | cMVHyh3bBxSMpwIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAIYBvMVB+MMu3Imm 10 | 8T8yEcxc1zCGsuTRNLyAaBHwbGUeqdxOncfxnPWoLLxgic3sUWtPrOgAnSkE7d2P 11 | oIn9fkNojyfmHzgoH4WEjghSFVzqenq/ABqs/fcZBTIjHSXXSah+nuOjrc7W218/ 12 | 6RAszOj6+tyQOAxz4kDvK8W/Ykigk9+vlBSSnUGsTjmB4afCctJzo6k3YBiD9wFT 13 | ev9IRdRPH1b+WzBP/HxBfkHsTPg3YEEa9ldMySJ514tHlJRHk9URbDj+fOCD6QG1 14 | IY7/IfdIz040xiXaXVOh8bs8qBWqpBjChvxVeW3HxtGQE8koMppFspD0gw1KEe3g 15 | ddAOF+8= 16 | -----END CERTIFICATE REQUEST----- 17 | -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app1/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app1-nginx-nodeport-service 36 | spec: 37 | type: NodePort 38 | selector: 39 | app: app1-nginx 40 | ports: 41 | - port: 80 42 | targetPort: 80 43 | 44 | -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app2/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app2-nginx-nodeport-service 36 | spec: 37 | type: NodePort 38 | selector: 39 | app: app2-nginx 40 | ports: 41 | - port: 80 42 | targetPort: 80 43 | 44 | -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | spec: 37 | type: NodePort 38 | selector: 39 | app: app3-nginx 40 | ports: 41 | - port: 80 42 | targetPort: 80 -------------------------------------------------------------------------------- /48-GKE-Ingress-SelfSigned-SSL/kube-manifests/05-frontendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1beta1 2 | kind: FrontendConfig 3 | metadata: 4 | name: my-frontend-config 5 | spec: 6 | redirectToHttps: 7 | enabled: true 8 | #responseCodeName: RESPONSE_CODE -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/SSL-SelfSigned-Certs/app1-ingress.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICzzCCAbcCFDQiqvY0cwNLP1ljifVfveOZo7G4MA0GCSqGSIb3DQEBCwUAMCQx 3 | IjAgBgNVBAMMGWFwcDEua2FseWFucmVkZHlkYWlkYS5jb20wHhcNMjIxMTI1MDIx 4 | MDUyWhcNNDIxMTIwMDIxMDUyWjAkMSIwIAYDVQQDDBlhcHAxLmthbHlhbnJlZGR5 5 | ZGFpZGEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5Nt/2cBg 6 | HSkMXNo04h9tN8f8ioPkZkl5rFwNmgW+tGei4wa2QFRt0xCeOyd7+0GWmyH6602M 7 | i3WabHTruHKWsCAikx20KaOEjYF+cmDMpWQdrWADoAIIfov+BO9VTmFJUX9JUDiR 8 | f6CHxtCZIifL4VM0InSpMIy4OJGQgzOVrlWwLYVcYla529VUGU5qBJFAliKve3N+ 9 | SBYoNI5uX0rERm4hqCUHKrQnsIfA0OnNccPdAoi+KmC/oipfUOpL9URholj7spAT 10 | JczcTGw+s7gehCDXm6YU7cBHtD2hLx106otEzJGIwys4JtmuKXtDw+w2eOGRUIrT 11 | Q7YLX6N5LJ8IDwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQABileCf1mnee2r0cLD 12 | 3bHaYo68JZkl9BS6dJN6DuOSD1Sha/NArgsuQa6uX8ApnUhTt5DucRyp7o5pdhCi 13 | rNaJwR9zYQmjxdH+RGtb5sPEAo7D47kQqp4wlJtL5AUfCI1nGgpg5cJCEqTVlbmP 14 | PEAJYlaWi8LNe4h+qukECcAA3Nsgvvm3Ls1qmKIEKJr05ppCq7EbYCrXJrN75Pl1 15 | 31w8Q0tr80qgNlhz65EyvLrIe6RK72qyOe9+oRCp9wRIoCvs47vUuNMfzZRxZXGn 16 | dPSLWkQt4LrQ/5RZr0lyUWtzr/l7GWu9GYljWe6toxTQHSqSkV/WAch8P4g0zvRJ 17 | NdHO 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/SSL-SelfSigned-Certs/app1-ingress.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICaTCCAVECAQAwJDEiMCAGA1UEAwwZYXBwMS5rYWx5YW5yZWRkeWRhaWRhLmNv 3 | bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOTbf9nAYB0pDFzaNOIf 4 | bTfH/IqD5GZJeaxcDZoFvrRnouMGtkBUbdMQnjsne/tBlpsh+utNjIt1mmx067hy 5 | lrAgIpMdtCmjhI2BfnJgzKVkHa1gA6ACCH6L/gTvVU5hSVF/SVA4kX+gh8bQmSIn 6 | y+FTNCJ0qTCMuDiRkIMzla5VsC2FXGJWudvVVBlOagSRQJYir3tzfkgWKDSObl9K 7 | xEZuIaglByq0J7CHwNDpzXHD3QKIvipgv6IqX1DqS/VEYaJY+7KQEyXM3ExsPrO4 8 | HoQg15umFO3AR7Q9oS8ddOqLRMyRiMMrOCbZril7Q8PsNnjhkVCK00O2C1+jeSyf 9 | CA8CAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQBexWuraAJF+txKTKQM6w2/Hnur 10 | 9BobBC/OYqdsracfmSAJ1eGEKI/ISUSZHVtZJptygxTEVXCTsN+ZukXlETM7AI4a 11 | Z8KatvHNrzhnpFV84ONpnCiUrQmik0IWwKcDJCzl4f7KUDITDC3hh5WGVY67OvuK 12 | mx03qu54ZFmFJkM2vwVn/ODbvdScYI5tDRjFIbyrwkxxW/1q1otkotOk7Z3hLdMN 13 | HWJh7IeXfw06q7+llX3Qg1OkpfyY682A0S2G2K6vrGFJUKFJ2CrPDzmht5G5kUz4 14 | HANxZuSKeHcI7rlB3IVyjNa77oXOX0+ZQLYgCf/cA3Lu2zAkhEvtq9ui0Edl 15 | -----END CERTIFICATE REQUEST----- 16 | -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/SSL-SelfSigned-Certs/app2-ingress.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICzzCCAbcCFBIM4d2+RH+OQFbNyPH7vO7dj4aAMA0GCSqGSIb3DQEBCwUAMCQx 3 | IjAgBgNVBAMMGWFwcDIua2FseWFucmVkZHlkYWlkYS5jb20wHhcNMjIxMTI1MDIx 4 | MjMxWhcNNDIxMTIwMDIxMjMxWjAkMSIwIAYDVQQDDBlhcHAyLmthbHlhbnJlZGR5 5 | ZGFpZGEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuKahBefa 6 | kPNvnvaxLkxnShxg5sX4P9FYlL1yCYLgrdW0DQWqouZ4nac31r4/YXeTJgXUCyQq 7 | HYy+tXNCangblaGFZXT71FcyoLT9RYE7p0/AePqHvP4gywJ/CEdk23obQak2Cuc/ 8 | cHoo/tnUnArevmvGoNLgb6TkHWiHE85LB8LPi1ra9KABU7/xF9XpyJWfRtkG8A7G 9 | jdbvggHVYD7l9oJyQB0+AcR7ddTbOk8D6CFHnMJa65/HyplErFWnrrKHvkKKqW6c 10 | f88kbp9qKPddmniwNOHqIu1QUADgJq97Y7fH9E0IZneMFWmGFRaXYxyUn4WziXEH 11 | npnbFg73/8FoFwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAAFOCpdOVoREKR6S6u 12 | F10Jp4DpQQDXsfgCVAxA58MNMGForwNhK1E28w0GBDm4K02nyOqqQxDWiFp8Am/T 13 | r+vzF1BBwNsiZ1r5naQTA5Jh2XgGrjOQOJhRZbEE4RwOxWsTvEyUJn2S0bYtGfES 14 | 5HjzZfq/0Gpxh3Z+oq8cINwzRzoirgf3Kk9SESvluxejnZMehVK5YIQp0IoM1Q5A 15 | t+ApJNyb107UxYLAfy8DSe5aMGtON8DYE+WLidL4CC1zRTABUjcBGsa09inGhgiF 16 | F5O8Eyc6LzA8EasmeJbWsUUYxUoLvq0OPXKq8Drjlt0SnttB4zpE8agtwzKKCodL 17 | tEoU 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/SSL-SelfSigned-Certs/app2-ingress.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICaTCCAVECAQAwJDEiMCAGA1UEAwwZYXBwMi5rYWx5YW5yZWRkeWRhaWRhLmNv 3 | bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALimoQXn2pDzb572sS5M 4 | Z0ocYObF+D/RWJS9cgmC4K3VtA0FqqLmeJ2nN9a+P2F3kyYF1AskKh2MvrVzQmp4 5 | G5WhhWV0+9RXMqC0/UWBO6dPwHj6h7z+IMsCfwhHZNt6G0GpNgrnP3B6KP7Z1JwK 6 | 3r5rxqDS4G+k5B1ohxPOSwfCz4ta2vSgAVO/8RfV6ciVn0bZBvAOxo3W74IB1WA+ 7 | 5faCckAdPgHEe3XU2zpPA+ghR5zCWuufx8qZRKxVp66yh75CiqlunH/PJG6faij3 8 | XZp4sDTh6iLtUFAA4Cave2O3x/RNCGZ3jBVphhUWl2MclJ+Fs4lxB56Z2xYO9//B 9 | aBcCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQBL3moJBmkteEAExoskvJrKbmW6 10 | aMyMFZmHUhPYqe8IkFG2/QRwN0C3r9lU8+UX0Qt+XqVx8hzi2FFsQYyZ/gdhZ1NP 11 | Oq60qH9Z95evTdIzN5FbkQiT1kgb1dGFs7WgcDLJM10dIeaq4M7MQrF3R99tEtbj 12 | EGiHQaXogqkIU5dcwoD9tZFB+7i7ymv6C19SSGHE/amIMFVp1hBfcKH7wxQ6wlZF 13 | Ll5WRTtdrM7E685VYKmH8ccF5rB+oyAH9be3kO2NWYo48QyoSnqk82UvmzcL0H/P 14 | +DUD7EfXQvlK02HfpmJxpWjT9wKYuA/AUC21L0w/gZWhXwAUnQtsbDGKxfKj 15 | -----END CERTIFICATE REQUEST----- 16 | -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/SSL-SelfSigned-Certs/app3-ingress.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC3zCCAccCFE5YVEQSuVzTlSNeeNV8BZuR6aWMMA0GCSqGSIb3DQEBCwUAMCwx 3 | KjAoBgNVBAMMIWFwcDMtZGVmYXVsdC5rYWx5YW5yZWRkeWRhaWRhLmNvbTAeFw0y 4 | MjExMjUwMjEzMDVaFw00MjExMjAwMjEzMDVaMCwxKjAoBgNVBAMMIWFwcDMtZGVm 5 | YXVsdC5rYWx5YW5yZWRkeWRhaWRhLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP 6 | ADCCAQoCggEBAKI6FJgH3TJ5ejRd7H/AvY+7EN0Vft/BQDoEfcjEUwrc7VM5/wgM 7 | ExE5Uj1Z0aMvIAruEMq2Zxe+dDHmqircrLHzH5uPjni3iBQ7dxvOGZTcdIM6JIax 8 | rauZJ5XtyXWBDvWACag59LtmFNtLXQQjNJHOKHZpZgi3bG49t26Aw9F0EelUCNpX 9 | RhBMX8wzT+gz0B0RA+Lj5B2wwGm2z+GgcM8E0jScaTgBQfhQM/kHp8oSNifySO7S 10 | p0z7zLc4h6fvfZhjPw/g7PYCksSm6wS0DJxzloeaxfudc5GHejlk13EX9FCnTx8s 11 | lWwQBBbpjv8Ht/J4QY3WKXDFR8od2wcUjKcCAwEAATANBgkqhkiG9w0BAQsFAAOC 12 | AQEAJ4tl2RjaRciW5aemwS1cGkGwyEZOqrkBRRTxzBhKu/XYgMzzfFDRux/04QQR 13 | w214mPwTKhsO4laUQ0d0457AS+2dyFsqLT46lQynXqZilr8IrSYENdnnZV7qqw7h 14 | e5Js/EUw2sCjtnQiz5W3Ty/+TuDN6vhLDeU6e+68TEOjqyVEym6pISNJekw1IAL6 15 | tO1nvb+Pj1Gq6tXbf8lXgr5ys6NU65sc6CpZQwD/FWWy0A4sLFjyHSproeNFxaln 16 | qBvj/5I4At0M6eJ6RtNGx9fem/VpOUWhjprsiYIDXBBbEOHmPKrc9u0I3VdfwREy 17 | Mmm+XAsfEVITpRvcDwoUHVsgKw== 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/SSL-SelfSigned-Certs/app3-ingress.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICcTCCAVkCAQAwLDEqMCgGA1UEAwwhYXBwMy1kZWZhdWx0LmthbHlhbnJlZGR5 3 | ZGFpZGEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAojoUmAfd 4 | Mnl6NF3sf8C9j7sQ3RV+38FAOgR9yMRTCtztUzn/CAwTETlSPVnRoy8gCu4QyrZn 5 | F750MeaqKtyssfMfm4+OeLeIFDt3G84ZlNx0gzokhrGtq5knle3JdYEO9YAJqDn0 6 | u2YU20tdBCM0kc4odmlmCLdsbj23boDD0XQR6VQI2ldGEExfzDNP6DPQHRED4uPk 7 | HbDAabbP4aBwzwTSNJxpOAFB+FAz+QenyhI2J/JI7tKnTPvMtziHp+99mGM/D+Ds 8 | 9gKSxKbrBLQMnHOWh5rF+51zkYd6OWTXcRf0UKdPHyyVbBAEFumO/we38nhBjdYp 9 | cMVHyh3bBxSMpwIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAIYBvMVB+MMu3Imm 10 | 8T8yEcxc1zCGsuTRNLyAaBHwbGUeqdxOncfxnPWoLLxgic3sUWtPrOgAnSkE7d2P 11 | oIn9fkNojyfmHzgoH4WEjghSFVzqenq/ABqs/fcZBTIjHSXXSah+nuOjrc7W218/ 12 | 6RAszOj6+tyQOAxz4kDvK8W/Ykigk9+vlBSSnUGsTjmB4afCctJzo6k3YBiD9wFT 13 | ev9IRdRPH1b+WzBP/HxBfkHsTPg3YEEa9ldMySJ514tHlJRHk9URbDj+fOCD6QG1 14 | IY7/IfdIz040xiXaXVOh8bs8qBWqpBjChvxVeW3HxtGQE8koMppFspD0gw1KEe3g 15 | ddAOF+8= 16 | -----END CERTIFICATE REQUEST----- 17 | -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app1/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app1-nginx-nodeport-service 36 | spec: 37 | type: NodePort 38 | selector: 39 | app: app1-nginx 40 | ports: 41 | - port: 80 42 | targetPort: 80 43 | 44 | -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app2/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app2-nginx-nodeport-service 36 | spec: 37 | type: NodePort 38 | selector: 39 | app: app2-nginx 40 | ports: 41 | - port: 80 42 | targetPort: 80 43 | 44 | -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | spec: 37 | type: NodePort 38 | selector: 39 | app: app3-nginx 40 | ports: 41 | - port: 80 42 | targetPort: 80 -------------------------------------------------------------------------------- /49-GKE-Ingress-Preshared-SSL/kube-manifests/05-frontendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.gke.io/v1beta1 2 | kind: FrontendConfig 3 | metadata: 4 | name: my-frontend-config 5 | spec: 6 | redirectToHttps: 7 | enabled: true 8 | #responseCodeName: RESPONSE_CODE -------------------------------------------------------------------------------- /50-GKE-Ingress-Cloud-CDN/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cdn-demo-deployment 5 | spec: 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: cdn-demo 10 | template: 11 | metadata: 12 | labels: 13 | app: cdn-demo 14 | spec: 15 | containers: 16 | - name: cdn-demo 17 | image: us-docker.pkg.dev/google-samples/containers/gke/hello-app-cdn:1.0 18 | ports: 19 | - containerPort: 8080 20 | 21 | 22 | -------------------------------------------------------------------------------- /50-GKE-Ingress-Cloud-CDN/kube-manifests/02-kubernetes-NodePort-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cdn-demo-nodeport-service 5 | annotations: 6 | cloud.google.com/backend-config: '{"default": "my-backendconfig"}' 7 | spec: 8 | type: NodePort 9 | selector: 10 | app: cdn-demo 11 | ports: 12 | - port: 80 13 | targetPort: 8080 -------------------------------------------------------------------------------- /50-GKE-Ingress-Cloud-CDN/kube-manifests/03-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-cdn-demo 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | # Static IP for Ingress Service 9 | kubernetes.io/ingress.global-static-ip-name: "gke-ingress-extip1" 10 | # External DNS - For creating a Record Set in Google Cloud Cloud DNS 11 | external-dns.alpha.kubernetes.io/hostname: ingress-cdn-demo.kalyanreddydaida.com 12 | spec: 13 | defaultBackend: 14 | service: 15 | name: cdn-demo-nodeport-service 16 | port: 17 | number: 80 18 | -------------------------------------------------------------------------------- /50-GKE-Ingress-Cloud-CDN/kube-manifests/04-backendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cloud.google.com/v1 2 | kind: BackendConfig 3 | metadata: 4 | name: my-backendconfig 5 | spec: 6 | timeoutSec: 42 # Backend service timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#timeout 7 | connectionDraining: # Connection draining timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#draining_timeout 8 | drainingTimeoutSec: 62 9 | logging: # HTTP access logging: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#http_logging 10 | enable: true 11 | sampleRate: 1.0 12 | cdn: 13 | enabled: true 14 | cachePolicy: 15 | includeHost: true 16 | includeProtocol: true 17 | includeQueryString: false 18 | 19 | # sampleRate: Specify a value from 0.0 through 1.0, where 0.0 means no packets are logged 20 | # and 1.0 means 100% of packets are logged. This field is only relevant if enable is set 21 | # to true. sampleRate is an optional field, but if it's configured then enable: true must 22 | # also be set or else it is interpreted as enable: false. -------------------------------------------------------------------------------- /51-GKE-Ingress-ClientIP-Affinity/01-kube-manifests-with-clientip-affinity/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cdn-demo-deployment 5 | spec: 6 | replicas: 4 7 | selector: 8 | matchLabels: 9 | app: cdn-demo 10 | template: 11 | metadata: 12 | labels: 13 | app: cdn-demo 14 | spec: 15 | containers: 16 | - name: cdn-demo 17 | image: us-docker.pkg.dev/google-samples/containers/gke/hello-app-cdn:1.0 18 | ports: 19 | - containerPort: 8080 20 | 21 | 22 | -------------------------------------------------------------------------------- /51-GKE-Ingress-ClientIP-Affinity/01-kube-manifests-with-clientip-affinity/02-kubernetes-NodePort-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cdn-demo-nodeport-service 5 | annotations: 6 | #cloud.google.com/backend-config: '{"ports": {"80":"my-backendconfig"}}' 7 | cloud.google.com/backend-config: '{"default": "my-backendconfig"}' 8 | spec: 9 | type: NodePort 10 | selector: 11 | app: cdn-demo 12 | ports: 13 | - port: 80 14 | targetPort: 8080 -------------------------------------------------------------------------------- /51-GKE-Ingress-ClientIP-Affinity/01-kube-manifests-with-clientip-affinity/03-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-cdn-demo 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | # Static IP for Ingress Service 9 | kubernetes.io/ingress.global-static-ip-name: "gke-ingress-extip1" 10 | # External DNS - For creating a Record Set in Google Cloud Cloud DNS 11 | external-dns.alpha.kubernetes.io/hostname: ingress-with-clientip-affinity.kalyanreddydaida.com 12 | spec: 13 | defaultBackend: 14 | service: 15 | name: cdn-demo-nodeport-service 16 | port: 17 | number: 80 18 | -------------------------------------------------------------------------------- /51-GKE-Ingress-ClientIP-Affinity/01-kube-manifests-with-clientip-affinity/04-backendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cloud.google.com/v1 2 | kind: BackendConfig 3 | metadata: 4 | name: my-backendconfig 5 | spec: 6 | timeoutSec: 42 # Backend service timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#timeout 7 | connectionDraining: # Connection draining timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#draining_timeout 8 | drainingTimeoutSec: 62 9 | logging: # HTTP access logging: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#http_logging 10 | enable: true 11 | sampleRate: 1.0 12 | sessionAffinity: 13 | affinityType: "CLIENT_IP" # Disable at Step-07 14 | #affinityType: "" # Enable at Step-07 15 | -------------------------------------------------------------------------------- /51-GKE-Ingress-ClientIP-Affinity/02-kube-manifests-without-clientip-affinity/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cdn-demo-deployment2 5 | spec: 6 | replicas: 4 7 | selector: 8 | matchLabels: 9 | app: cdn-demo2 10 | template: 11 | metadata: 12 | labels: 13 | app: cdn-demo2 14 | spec: 15 | containers: 16 | - name: cdn-demo2 17 | image: us-docker.pkg.dev/google-samples/containers/gke/hello-app-cdn:1.0 18 | ports: 19 | - containerPort: 8080 20 | 21 | 22 | -------------------------------------------------------------------------------- /51-GKE-Ingress-ClientIP-Affinity/02-kube-manifests-without-clientip-affinity/02-kubernetes-NodePort-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cdn-demo-nodeport-service2 5 | annotations: 6 | #cloud.google.com/backend-config: '{"ports": {"80":"my-backendconfig2"}}' 7 | cloud.google.com/backend-config: '{"default": "my-backendconfig2"}' 8 | spec: 9 | type: NodePort 10 | selector: 11 | app: cdn-demo2 12 | ports: 13 | - port: 80 14 | targetPort: 8080 -------------------------------------------------------------------------------- /51-GKE-Ingress-ClientIP-Affinity/02-kube-manifests-without-clientip-affinity/03-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-cdn-demo2 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | # Static IP for Ingress Service 9 | kubernetes.io/ingress.global-static-ip-name: "gke-ingress-extip2" 10 | # External DNS - For creating a Record Set in Google Cloud Cloud DNS 11 | external-dns.alpha.kubernetes.io/hostname: ingress-without-clientip-affinity.kalyanreddydaida.com 12 | spec: 13 | defaultBackend: 14 | service: 15 | name: cdn-demo-nodeport-service2 16 | port: 17 | number: 80 18 | -------------------------------------------------------------------------------- /51-GKE-Ingress-ClientIP-Affinity/02-kube-manifests-without-clientip-affinity/04-backendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cloud.google.com/v1 2 | kind: BackendConfig 3 | metadata: 4 | name: my-backendconfig2 5 | spec: 6 | timeoutSec: 42 # Backend service timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#timeout 7 | connectionDraining: # Connection draining timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#draining_timeout 8 | drainingTimeoutSec: 62 9 | logging: # HTTP access logging: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#http_logging 10 | enable: true 11 | sampleRate: 1.0 12 | 13 | 14 | # sampleRate: Specify a value from 0.0 through 1.0, where 0.0 means no packets are logged 15 | # and 1.0 means 100% of packets are logged. This field is only relevant if enable is set 16 | # to true. sampleRate is an optional field, but if it's configured then enable: true must 17 | # also be set or else it is interpreted as enable: false. -------------------------------------------------------------------------------- /52-GKE-Ingress-Cookie-Affinity/01-kube-manifests-with-cookie-affinity/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cdn-demo-deployment 5 | spec: 6 | replicas: 4 7 | selector: 8 | matchLabels: 9 | app: cdn-demo 10 | template: 11 | metadata: 12 | labels: 13 | app: cdn-demo 14 | spec: 15 | containers: 16 | - name: cdn-demo 17 | image: us-docker.pkg.dev/google-samples/containers/gke/hello-app-cdn:1.0 18 | ports: 19 | - containerPort: 8080 20 | 21 | 22 | -------------------------------------------------------------------------------- /52-GKE-Ingress-Cookie-Affinity/01-kube-manifests-with-cookie-affinity/02-kubernetes-NodePort-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cdn-demo-nodeport-service 5 | annotations: 6 | #cloud.google.com/backend-config: '{"ports": {"80":"my-backendconfig"}}' 7 | cloud.google.com/backend-config: '{"default": "my-backendconfig"}' 8 | spec: 9 | type: NodePort 10 | selector: 11 | app: cdn-demo 12 | ports: 13 | - port: 80 14 | targetPort: 8080 -------------------------------------------------------------------------------- /52-GKE-Ingress-Cookie-Affinity/01-kube-manifests-with-cookie-affinity/03-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-cdn-demo 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | # Static IP for Ingress Service 9 | kubernetes.io/ingress.global-static-ip-name: "gke-ingress-extip1" 10 | # External DNS - For creating a Record Set in Google Cloud Cloud DNS 11 | external-dns.alpha.kubernetes.io/hostname: ingress-with-cookie-affinity.kalyanreddydaida.com 12 | spec: 13 | defaultBackend: 14 | service: 15 | name: cdn-demo-nodeport-service 16 | port: 17 | number: 80 18 | -------------------------------------------------------------------------------- /52-GKE-Ingress-Cookie-Affinity/01-kube-manifests-with-cookie-affinity/04-backendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cloud.google.com/v1 2 | kind: BackendConfig 3 | metadata: 4 | name: my-backendconfig 5 | spec: 6 | timeoutSec: 42 # Backend service timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#timeout 7 | connectionDraining: # Connection draining timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#draining_timeout 8 | drainingTimeoutSec: 62 9 | logging: # HTTP access logging: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#http_logging 10 | enable: true 11 | sampleRate: 1.0 12 | sessionAffinity: 13 | affinityType: "GENERATED_COOKIE" 14 | affinityCookieTtlSec: 50 # TTL of 50 seconds 15 | 16 | # sampleRate: Specify a value from 0.0 through 1.0, where 0.0 means no packets are logged 17 | # and 1.0 means 100% of packets are logged. This field is only relevant if enable is set 18 | # to true. sampleRate is an optional field, but if it's configured then enable: true must 19 | # also be set or else it is interpreted as enable: false. -------------------------------------------------------------------------------- /52-GKE-Ingress-Cookie-Affinity/02-kube-manifests-without-cookie-affinity/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cdn-demo-deployment2 5 | spec: 6 | replicas: 4 7 | selector: 8 | matchLabels: 9 | app: cdn-demo2 10 | template: 11 | metadata: 12 | labels: 13 | app: cdn-demo2 14 | spec: 15 | containers: 16 | - name: cdn-demo2 17 | image: us-docker.pkg.dev/google-samples/containers/gke/hello-app-cdn:1.0 18 | ports: 19 | - containerPort: 8080 20 | 21 | 22 | -------------------------------------------------------------------------------- /52-GKE-Ingress-Cookie-Affinity/02-kube-manifests-without-cookie-affinity/02-kubernetes-NodePort-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cdn-demo-nodeport-service2 5 | annotations: 6 | #cloud.google.com/backend-config: '{"ports": {"80":"my-backendconfig2"}}' 7 | cloud.google.com/backend-config: '{"default": "my-backendconfig2"}' 8 | spec: 9 | type: NodePort 10 | selector: 11 | app: cdn-demo2 12 | ports: 13 | - port: 80 14 | targetPort: 8080 -------------------------------------------------------------------------------- /52-GKE-Ingress-Cookie-Affinity/02-kube-manifests-without-cookie-affinity/03-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-cdn-demo2 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | # Static IP for Ingress Service 9 | kubernetes.io/ingress.global-static-ip-name: "gke-ingress-extip2" 10 | # External DNS - For creating a Record Set in Google Cloud Cloud DNS 11 | external-dns.alpha.kubernetes.io/hostname: ingress-without-cookie-affinity.kalyanreddydaida.com 12 | spec: 13 | defaultBackend: 14 | service: 15 | name: cdn-demo-nodeport-service2 16 | port: 17 | number: 80 18 | -------------------------------------------------------------------------------- /52-GKE-Ingress-Cookie-Affinity/02-kube-manifests-without-cookie-affinity/04-backendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cloud.google.com/v1 2 | kind: BackendConfig 3 | metadata: 4 | name: my-backendconfig2 5 | spec: 6 | timeoutSec: 42 # Backend service timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#timeout 7 | connectionDraining: # Connection draining timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#draining_timeout 8 | drainingTimeoutSec: 62 9 | logging: # HTTP access logging: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#http_logging 10 | enable: true 11 | sampleRate: 1.0 12 | 13 | 14 | # sampleRate: Specify a value from 0.0 through 1.0, where 0.0 means no packets are logged 15 | # and 1.0 means 100% of packets are logged. This field is only relevant if enable is set 16 | # to true. sampleRate is an optional field, but if it's configured then enable: true must 17 | # also be set or else it is interpreted as enable: false. -------------------------------------------------------------------------------- /53-GKE-Ingress-HealthCheck-with-backendConfig/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | #readinessProbe: 24 | # httpGet: 25 | # scheme: HTTP 26 | # path: /index.html 27 | # port: 80 28 | # initialDelaySeconds: 10 29 | # periodSeconds: 15 30 | # timeoutSeconds: 5 -------------------------------------------------------------------------------- /53-GKE-Ingress-HealthCheck-with-backendConfig/kube-manifests/02-kubernetes-NodePort-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: app3-nginx-nodeport-service 5 | labels: 6 | app: app3-nginx 7 | annotations: 8 | #cloud.google.com/backend-config: '{"ports": {"80":"my-backendconfig"}}' 9 | cloud.google.com/backend-config: '{"default": "my-backendconfig"}' 10 | spec: 11 | type: NodePort 12 | selector: 13 | app: app3-nginx 14 | ports: 15 | - port: 80 16 | targetPort: 80 -------------------------------------------------------------------------------- /53-GKE-Ingress-HealthCheck-with-backendConfig/kube-manifests/03-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-custom-healthcheck 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | spec: 9 | defaultBackend: 10 | service: 11 | name: app3-nginx-nodeport-service 12 | port: 13 | number: 80 14 | -------------------------------------------------------------------------------- /54-GKE-Ingress-InternalLB/01-kube-manifests/01-Nginx-App1-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app1/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app1-nginx-nodeport-service 36 | labels: 37 | app: app1-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app1-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /54-GKE-Ingress-InternalLB/01-kube-manifests/02-Nginx-App2-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 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 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /app2/index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app2-nginx-nodeport-service 36 | labels: 37 | app: app2-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app2-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 46 | 47 | -------------------------------------------------------------------------------- /54-GKE-Ingress-InternalLB/01-kube-manifests/03-Nginx-App3-Deployment-and-NodePortService.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: app3-nginx-deployment 5 | labels: 6 | app: app3-nginx 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: app3-nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: app3-nginx 16 | spec: 17 | containers: 18 | - name: app3-nginx 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 23 | readinessProbe: 24 | httpGet: 25 | scheme: HTTP 26 | path: /index.html 27 | port: 80 28 | initialDelaySeconds: 10 29 | periodSeconds: 15 30 | timeoutSeconds: 5 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: app3-nginx-nodeport-service 36 | labels: 37 | app: app3-nginx 38 | annotations: 39 | spec: 40 | type: NodePort 41 | selector: 42 | app: app3-nginx 43 | ports: 44 | - port: 80 45 | targetPort: 80 -------------------------------------------------------------------------------- /54-GKE-Ingress-InternalLB/01-kube-manifests/04-Ingress-internal-lb.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-internal-lb 5 | annotations: 6 | # If the class annotation is not specified it defaults to "gce". 7 | # gce: external load balancer 8 | # gce-internal: internal load balancer 9 | # Internal Load Balancer 10 | kubernetes.io/ingress.class: "gce-internal" 11 | spec: 12 | defaultBackend: 13 | service: 14 | name: app3-nginx-nodeport-service 15 | port: 16 | number: 80 17 | rules: 18 | - http: 19 | paths: 20 | - path: /app1 21 | pathType: Prefix 22 | backend: 23 | service: 24 | name: app1-nginx-nodeport-service 25 | port: 26 | number: 80 27 | - path: /app2 28 | pathType: Prefix 29 | backend: 30 | service: 31 | name: app2-nginx-nodeport-service 32 | port: 33 | number: 80 34 | 35 | 36 | -------------------------------------------------------------------------------- /54-GKE-Ingress-InternalLB/02-kube-manifests-curl/01-curl-pod.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: curl-pod 5 | spec: 6 | containers: 7 | - name: curl 8 | image: curlimages/curl 9 | command: [ "sleep", "600" ] -------------------------------------------------------------------------------- /55-GKE-Ingress-Cloud-Armor/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cloud-armor-demo-deployment 5 | spec: 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: cloud-armor-demo 10 | template: 11 | metadata: 12 | labels: 13 | app: cloud-armor-demo 14 | spec: 15 | containers: 16 | - name: cloud-armor-demo 17 | image: stacksimplify/kubenginx:1.0.0 18 | ports: 19 | - containerPort: 80 20 | # Readiness Probe (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#def_inf_hc) 21 | readinessProbe: 22 | httpGet: 23 | scheme: HTTP 24 | path: /index.html 25 | port: 80 26 | initialDelaySeconds: 10 27 | periodSeconds: 15 28 | timeoutSeconds: 5 29 | 30 | 31 | -------------------------------------------------------------------------------- /55-GKE-Ingress-Cloud-Armor/kube-manifests/02-kubernetes-NodePort-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cloud-armor-demo-nodeport-service 5 | annotations: 6 | #cloud.google.com/backend-config: '{"ports": {"80":"my-backendconfig"}}' 7 | cloud.google.com/backend-config: '{"default": "my-backendconfig"}' 8 | spec: 9 | type: NodePort 10 | selector: 11 | app: cloud-armor-demo 12 | ports: 13 | - port: 80 14 | targetPort: 80 -------------------------------------------------------------------------------- /55-GKE-Ingress-Cloud-Armor/kube-manifests/03-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: ingress-cloud-armor-demo 5 | annotations: 6 | # External Load Balancer 7 | kubernetes.io/ingress.class: "gce" 8 | # Static IP for Ingress Service 9 | kubernetes.io/ingress.global-static-ip-name: "gke-ingress-extip1" 10 | # External DNS - For creating a Record Set in Google Cloud Cloud DNS 11 | external-dns.alpha.kubernetes.io/hostname: cloudarmor-ingress.kalyanreddydaida.com 12 | spec: 13 | defaultBackend: 14 | service: 15 | name: cloud-armor-demo-nodeport-service 16 | port: 17 | number: 80 18 | -------------------------------------------------------------------------------- /55-GKE-Ingress-Cloud-Armor/kube-manifests/04-backendconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cloud.google.com/v1 2 | kind: BackendConfig 3 | metadata: 4 | name: my-backendconfig 5 | spec: 6 | timeoutSec: 42 # Backend service timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#timeout 7 | connectionDraining: # Connection draining timeout: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#draining_timeout 8 | drainingTimeoutSec: 62 9 | logging: # HTTP access logging: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#http_logging 10 | enable: true 11 | sampleRate: 1.0 12 | securityPolicy: 13 | name: "cloud-armor-policy-1" 14 | 15 | # sampleRate: Specify a value from 0.0 through 1.0, where 0.0 means no packets are logged 16 | # and 1.0 means 100% of packets are logged. This field is only relevant if enable is set 17 | # to true. sampleRate is an optional field, but if it's configured then enable: true must 18 | # also be set or else it is interpreted as enable: false. -------------------------------------------------------------------------------- /56-GKE-Artifact-Registry/01-Docker-Image/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | COPY index.html /usr/share/nginx/html -------------------------------------------------------------------------------- /56-GKE-Artifact-Registry/01-Docker-Image/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Google Kubernetes Engine
6 |Application Version: V1
7 | 8 | -------------------------------------------------------------------------------- /56-GKE-Artifact-Registry/02-kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: myapp1-deployment 5 | spec: 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: 12 | name: myapp1-pod 13 | labels: 14 | app: myapp1 15 | spec: 16 | containers: 17 | - name: myapp1-container 18 | #image: us-central1-docker.pkg.dev/Google Kubernetes Engine
6 |Application Version: V1
7 | 8 | -------------------------------------------------------------------------------- /57-GKE-Continuous-Integration/03-cloudbuild-yaml/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | # This step builds the container image. 3 | - name: 'gcr.io/cloud-builders/docker' 4 | id: Build 5 | args: 6 | - 'build' 7 | - '-t' 8 | - 'us-central1-docker.pkg.dev/$PROJECT_ID/myapps-repository/myapp1:$SHORT_SHA' 9 | - '.' 10 | 11 | # This step pushes the image to Artifact Registry 12 | # The PROJECT_ID and SHORT_SHA variables are automatically 13 | # replaced by Cloud Build. 14 | - name: 'gcr.io/cloud-builders/docker' 15 | id: Push 16 | args: 17 | - 'push' 18 | - 'us-central1-docker.pkg.dev/$PROJECT_ID/myapps-repository/myapp1:$SHORT_SHA' -------------------------------------------------------------------------------- /57-GKE-Continuous-Integration/04-kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | #image: us-central1-docker.pkg.dev/kdaida123/myapps-repository/myapp1:d1c3b88 19 | image: us-central1-docker.pkg.dev/kdaida123/myapps-repository/myapp1:3d5c45b 20 | ports: 21 | - containerPort: 80 22 | -------------------------------------------------------------------------------- /57-GKE-Continuous-Integration/04-kube-manifests/02-kubernetes-loadBalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /58-GKE-Continuous-Delivery-with-CloudBuild/02-Source-Writer-IAM-Role/myapp1-k8s-repo-policy.yaml: -------------------------------------------------------------------------------- 1 | bindings: 2 | - members: 3 | - serviceAccount:1057267725005@cloudbuild.gserviceaccount.com 4 | role: roles/source.writer 5 | -------------------------------------------------------------------------------- /58-GKE-Continuous-Delivery-with-CloudBuild/03-myapp1-app-repo/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | COPY index.html /usr/share/nginx/html -------------------------------------------------------------------------------- /58-GKE-Continuous-Delivery-with-CloudBuild/03-myapp1-app-repo/README.md: -------------------------------------------------------------------------------- 1 | # GKE CI Demo 2 | -------------------------------------------------------------------------------- /58-GKE-Continuous-Delivery-with-CloudBuild/03-myapp1-app-repo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Google Kubernetes Engine
6 |Application Version: V101
7 | 8 | -------------------------------------------------------------------------------- /58-GKE-Continuous-Delivery-with-CloudBuild/03-myapp1-app-repo/kubernetes.yaml.tpl: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: myapp1-deployment 5 | labels: 6 | app: myapp1 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: myapp1 12 | template: 13 | metadata: 14 | labels: 15 | app: myapp1 16 | spec: 17 | containers: 18 | - name: myapp1 19 | image: us-central1-docker.pkg.dev/GOOGLE_CLOUD_PROJECT/myapps-repository/myapp1:COMMIT_SHA 20 | ports: 21 | - containerPort: 80 22 | --- 23 | kind: Service 24 | apiVersion: v1 25 | metadata: 26 | name: myapp1-lb-service 27 | spec: 28 | type: LoadBalancer 29 | selector: 30 | app: myapp1 31 | ports: 32 | - protocol: TCP 33 | port: 80 34 | targetPort: 80 35 | -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/01-liveness-probe-linux-command/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/01-liveness-probe-linux-command/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. 19 | ## We are going to use this in our MySQL k8s Deployment 20 | 21 | # 3. YAML Notation 22 | ## YAML Notation: |-: "strip": remove the line feed, remove the trailing blank lines. 23 | ## Additional YAML Notation Reference: https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-in-yaml-over-multiple-lines -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/01-liveness-probe-linux-command/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/01-liveness-probe-linux-command/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | app: usermgmt-webapp 9 | ports: 10 | - port: 80 # Service Port 11 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/01-liveness-probe-linux-command/07-kubernetes-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | #type: Opaque means that from kubernetes's point of view the contents of this Secret is unstructured. 6 | #It can contain arbitrary key-value pairs. 7 | type: Opaque 8 | data: 9 | # Output of echo -n 'dbpassword11' | base64 10 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/02-liveness-probe-HTTP-Request/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/02-liveness-probe-HTTP-Request/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. 19 | ## We are going to use this in our MySQL k8s Deployment 20 | 21 | # 3. YAML Notation 22 | ## YAML Notation: |-: "strip": remove the line feed, remove the trailing blank lines. 23 | ## Additional YAML Notation Reference: https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-in-yaml-over-multiple-lines -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/02-liveness-probe-HTTP-Request/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/02-liveness-probe-HTTP-Request/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | app: usermgmt-webapp 9 | ports: 10 | - port: 80 # Service Port 11 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/02-liveness-probe-HTTP-Request/07-kubernetes-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | #type: Opaque means that from kubernetes's point of view the contents of this Secret is unstructured. 6 | #It can contain arbitrary key-value pairs. 7 | type: Opaque 8 | data: 9 | # Output of echo -n 'dbpassword11' | base64 10 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/03-liveness-probe-TCP-Request/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/03-liveness-probe-TCP-Request/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. 19 | ## We are going to use this in our MySQL k8s Deployment 20 | 21 | # 3. YAML Notation 22 | ## YAML Notation: |-: "strip": remove the line feed, remove the trailing blank lines. 23 | ## Additional YAML Notation Reference: https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-in-yaml-over-multiple-lines -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/03-liveness-probe-TCP-Request/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/03-liveness-probe-TCP-Request/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | app: usermgmt-webapp 9 | ports: 10 | - port: 80 # Service Port 11 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /59-Kubernetes-liveness-probe/03-liveness-probe-TCP-Request/07-kubernetes-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | #type: Opaque means that from kubernetes's point of view the contents of this Secret is unstructured. 6 | #It can contain arbitrary key-value pairs. 7 | type: Opaque 8 | data: 9 | # Output of echo -n 'dbpassword11' | base64 10 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /60-Kubernetes-Startup-Probe/kube-manifests-startup-probe/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /60-Kubernetes-Startup-Probe/kube-manifests-startup-probe/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. 19 | ## We are going to use this in our MySQL k8s Deployment 20 | 21 | # 3. YAML Notation 22 | ## YAML Notation: |-: "strip": remove the line feed, remove the trailing blank lines. 23 | ## Additional YAML Notation Reference: https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-in-yaml-over-multiple-lines -------------------------------------------------------------------------------- /60-Kubernetes-Startup-Probe/kube-manifests-startup-probe/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /60-Kubernetes-Startup-Probe/kube-manifests-startup-probe/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | app: usermgmt-webapp 9 | ports: 10 | - port: 80 # Service Port 11 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /60-Kubernetes-Startup-Probe/kube-manifests-startup-probe/07-kubernetes-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | #type: Opaque means that from kubernetes's point of view the contents of this Secret is unstructured. 6 | #It can contain arbitrary key-value pairs. 7 | type: Opaque 8 | data: 9 | # Output of echo -n 'dbpassword11' | base64 10 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /61-Kubernetes-Readiness-Probe/kube-manifests-readiness-probe/01-persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | storageClassName: standard-rwo 9 | resources: 10 | requests: 11 | storage: 4Gi 12 | 13 | # NEED FOR PVC 14 | # 1. Dynamic volume provisioning allows storage volumes to be created 15 | # on-demand. 16 | 17 | # 2. Without dynamic provisioning, cluster administrators have to manually 18 | # make calls to their cloud or storage provider to create new storage 19 | # volumes, and then create PersistentVolume objects to represent them in k8s 20 | 21 | # 3. The dynamic provisioning feature eliminates the need for cluster 22 | # administrators to pre-provision storage. Instead, it automatically 23 | # provisions storage when it is requested by users. 24 | 25 | # 4. PVC: Users request dynamically provisioned storage by including 26 | # a storage class in their PersistentVolumeClaim 27 | 28 | -------------------------------------------------------------------------------- /61-Kubernetes-Readiness-Probe/kube-manifests-readiness-probe/02-UserManagement-ConfigMap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: usermanagement-dbcreation-script 5 | data: 6 | mysql_usermgmt.sql: |- 7 | DROP DATABASE IF EXISTS webappdb; 8 | CREATE DATABASE webappdb; 9 | 10 | 11 | # CONFIG MAP 12 | # 1. A ConfigMap is an API object used to store non-confidential data in 13 | # key-value pairs. 14 | 15 | # 2. Pods can consume ConfigMaps as 16 | ## 2.1: environment variables, 17 | ## 2.2: command-line arguments, 18 | ## 2.3: or as configuration files in a volume. 19 | ## We are going to use this in our MySQL k8s Deployment 20 | 21 | # 3. YAML Notation 22 | ## YAML Notation: |-: "strip": remove the line feed, remove the trailing blank lines. 23 | ## Additional YAML Notation Reference: https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-in-yaml-over-multiple-lines -------------------------------------------------------------------------------- /61-Kubernetes-Readiness-Probe/kube-manifests-readiness-probe/04-mysql-clusterip-service.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /61-Kubernetes-Readiness-Probe/kube-manifests-readiness-probe/06-UserMgmtWebApp-LoadBalancer-Service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: usermgmt-webapp-lb-service 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | app: usermgmt-webapp 9 | ports: 10 | - port: 80 # Service Port 11 | targetPort: 8080 # Container Port -------------------------------------------------------------------------------- /61-Kubernetes-Readiness-Probe/kube-manifests-readiness-probe/07-kubernetes-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: mysql-db-password 5 | #type: Opaque means that from kubernetes's point of view the contents of this Secret is unstructured. 6 | #It can contain arbitrary key-value pairs. 7 | type: Opaque 8 | data: 9 | # Output of echo -n 'dbpassword11' | base64 10 | db-password: ZGJwYXNzd29yZDEx -------------------------------------------------------------------------------- /62-Kubernetes-Requests-and-Limits/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 5 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | resources: 22 | requests: 23 | memory: "128Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 24 | cpu: "200m" # `m` means milliCPU 25 | limits: 26 | memory: "256Mi" 27 | cpu: "400m" # 1000m is equal to 1 VCPU core 28 | -------------------------------------------------------------------------------- /62-Kubernetes-Requests-and-Limits/kube-manifests/02-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIP, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /63-GKE-Cluster-Autoscaling/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 5 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | resources: 22 | requests: 23 | memory: "128Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 24 | cpu: "200m" # `m` means milliCPU 25 | limits: 26 | memory: "256Mi" 27 | cpu: "400m" # 1000m is equal to 1 VCPU core 28 | -------------------------------------------------------------------------------- /63-GKE-Cluster-Autoscaling/kube-manifests/02-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /64-Kubernetes-Namespaces/01-kube-manifests-imperative/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | resources: 22 | requests: 23 | memory: "128Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 24 | cpu: "200m" # `m` means milliCPU 25 | limits: 26 | memory: "256Mi" 27 | cpu: "400m" # 1000m is equal to 1 VCPU core 28 | -------------------------------------------------------------------------------- /64-Kubernetes-Namespaces/01-kube-manifests-imperative/02-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /64-Kubernetes-Namespaces/02-kube-manifests-declarative/00-kubernetes-namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: qa -------------------------------------------------------------------------------- /64-Kubernetes-Namespaces/02-kube-manifests-declarative/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | namespace: qa 6 | spec: # Dictionary 7 | replicas: 2 8 | selector: 9 | matchLabels: 10 | app: myapp1 11 | template: 12 | metadata: # Dictionary 13 | name: myapp1-pod 14 | labels: # Dictionary 15 | app: myapp1 # Key value pairs 16 | spec: 17 | containers: # List 18 | - name: myapp1-container 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | resources: 23 | requests: 24 | memory: "128Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 25 | cpu: "200m" # `m` means milliCPU 26 | limits: 27 | memory: "256Mi" 28 | cpu: "400m" # 1000m is equal to 1 VCPU core 29 | -------------------------------------------------------------------------------- /64-Kubernetes-Namespaces/02-kube-manifests-declarative/02-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | namespace: qa 6 | spec: 7 | type: LoadBalancer # ClusterIp, # NodePort 8 | selector: 9 | app: myapp1 10 | ports: 11 | - name: http 12 | port: 80 # Service Port 13 | targetPort: 80 # Container Port 14 | -------------------------------------------------------------------------------- /65-Kubernetes-Namespaces-ResourceQuota/kube-manifests/01-kubernetes-namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: qa 5 | -------------------------------------------------------------------------------- /65-Kubernetes-Namespaces-ResourceQuota/kube-manifests/02-kubernetes-resourcequota.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ResourceQuota 3 | metadata: 4 | name: qa-namespace-resource-quota 5 | namespace: qa 6 | spec: 7 | hard: 8 | requests.cpu: "1" 9 | requests.memory: 1Gi 10 | limits.cpu: "2" 11 | limits.memory: 2Gi 12 | pods: "3" 13 | configmaps: "3" 14 | persistentvolumeclaims: "3" 15 | secrets: "3" 16 | services: "3" 17 | -------------------------------------------------------------------------------- /65-Kubernetes-Namespaces-ResourceQuota/kube-manifests/03-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | namespace: qa 6 | spec: # Dictionary 7 | replicas: 2 8 | selector: 9 | matchLabels: 10 | app: myapp1 11 | template: 12 | metadata: # Dictionary 13 | name: myapp1-pod 14 | labels: # Dictionary 15 | app: myapp1 # Key value pairs 16 | spec: 17 | containers: # List 18 | - name: myapp1-container 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | resources: 23 | requests: 24 | memory: "128Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 25 | cpu: "200m" # `m` means milliCPU 26 | limits: 27 | memory: "256Mi" 28 | cpu: "400m" # 1000m is equal to 1 VCPU core 29 | -------------------------------------------------------------------------------- /65-Kubernetes-Namespaces-ResourceQuota/kube-manifests/04-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | namespace: qa 6 | spec: 7 | type: LoadBalancer # ClusterIP, # NodePort 8 | selector: 9 | app: myapp1 10 | ports: 11 | - name: http 12 | port: 80 # Service Port 13 | targetPort: 80 # Container Port 14 | -------------------------------------------------------------------------------- /66-Kubernetes-Namespaces-LimitRange/01-kube-manifests-LimitRange-defaults/01-kubernetes-namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: qa 5 | -------------------------------------------------------------------------------- /66-Kubernetes-Namespaces-LimitRange/01-kube-manifests-LimitRange-defaults/02-kubernetes-resourcequota-limitrange.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ResourceQuota 3 | metadata: 4 | name: qa-namespace-resource-quota 5 | namespace: qa 6 | spec: 7 | hard: 8 | requests.cpu: "1" 9 | requests.memory: 1Gi 10 | limits.cpu: "2" 11 | limits.memory: 2Gi 12 | pods: "3" 13 | configmaps: "3" 14 | persistentvolumeclaims: "3" 15 | secrets: "3" 16 | services: "3" 17 | --- 18 | apiVersion: v1 19 | kind: LimitRange 20 | metadata: 21 | name: default-cpu-mem-limit-range 22 | namespace: qa 23 | spec: 24 | limits: 25 | - default: 26 | cpu: "400m" # If not specified default limit is 1 vCPU per container 27 | memory: "256Mi" # If not specified the Container's memory limit is set to 512Mi, which is the default memory limit for the namespace. 28 | defaultRequest: 29 | cpu: "200m" # If not specified default it will take from whatever specified in limits.default.cpu 30 | memory: "128Mi" # If not specified default it will take from whatever specified in limits.default.memory 31 | max: 32 | cpu: "500m" 33 | memory: "500Mi" 34 | min: 35 | cpu: "100m" 36 | memory: "100Mi" 37 | type: Container -------------------------------------------------------------------------------- /66-Kubernetes-Namespaces-LimitRange/01-kube-manifests-LimitRange-defaults/03-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | namespace: qa 6 | spec: # Dictionary 7 | replicas: 2 8 | selector: 9 | matchLabels: 10 | app: myapp1 11 | template: 12 | metadata: # Dictionary 13 | name: myapp1-pod 14 | labels: # Dictionary 15 | app: myapp1 # Key value pairs 16 | spec: 17 | containers: # List 18 | - name: myapp1-container 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | #resources: 23 | # requests: 24 | # memory: "128Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 25 | # cpu: "200m" # `m` means milliCPU 26 | # limits: 27 | # memory: "256Mi" 28 | # cpu: "400m" # 1000m is equal to 1 VCPU core 29 | -------------------------------------------------------------------------------- /66-Kubernetes-Namespaces-LimitRange/01-kube-manifests-LimitRange-defaults/04-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | namespace: qa 6 | spec: 7 | type: LoadBalancer # ClusterIp, # NodePort 8 | selector: 9 | app: myapp1 10 | ports: 11 | - name: http 12 | port: 80 # Service Port 13 | targetPort: 80 # Container Port 14 | -------------------------------------------------------------------------------- /66-Kubernetes-Namespaces-LimitRange/02-kube-manifests-LimitRange-MinMax/01-kubernetes-namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: qa 5 | -------------------------------------------------------------------------------- /66-Kubernetes-Namespaces-LimitRange/02-kube-manifests-LimitRange-MinMax/02-kubernetes-resourcequota-limitrange.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ResourceQuota 3 | metadata: 4 | name: qa-namespace-resource-quota 5 | namespace: qa 6 | spec: 7 | hard: 8 | requests.cpu: "1" 9 | requests.memory: 1Gi 10 | limits.cpu: "2" 11 | limits.memory: 2Gi 12 | pods: "3" 13 | configmaps: "3" 14 | persistentvolumeclaims: "3" 15 | secrets: "3" 16 | services: "3" 17 | --- 18 | apiVersion: v1 19 | kind: LimitRange 20 | metadata: 21 | name: default-cpu-mem-limit-range 22 | namespace: qa 23 | spec: 24 | limits: 25 | - default: 26 | cpu: "400m" # If not specified default limit is 1 vCPU per container 27 | memory: "256Mi" # If not specified the Container's memory limit is set to 512Mi, which is the default memory limit for the namespace. 28 | defaultRequest: 29 | cpu: "200m" # If not specified default it will take from whatever specified in limits.default.cpu 30 | memory: "128Mi" # If not specified default it will take from whatever specified in limits.default.memory 31 | max: 32 | cpu: "500m" 33 | memory: "500Mi" 34 | min: 35 | cpu: "100m" 36 | memory: "100Mi" 37 | type: Container -------------------------------------------------------------------------------- /66-Kubernetes-Namespaces-LimitRange/02-kube-manifests-LimitRange-MinMax/03-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | namespace: qa 6 | spec: # Dictionary 7 | replicas: 2 8 | selector: 9 | matchLabels: 10 | app: myapp1 11 | template: 12 | metadata: # Dictionary 13 | name: myapp1-pod 14 | labels: # Dictionary 15 | app: myapp1 # Key value pairs 16 | spec: 17 | containers: # List 18 | - name: myapp1-container 19 | image: stacksimplify/kubenginx:1.0.0 20 | ports: 21 | - containerPort: 80 22 | resources: 23 | requests: 24 | memory: "128Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 25 | cpu: "450m" # `m` means milliCPU 26 | limits: 27 | memory: "256Mi" 28 | #cpu: "600m" # This is above the max value defined in Limit Range, Pods will not be scheduled and error thrown when we refer ReplicaSet Events 29 | cpu: "500m" # This is equal to Max value defined in LimitRange, Pods will be scheduled. -------------------------------------------------------------------------------- /66-Kubernetes-Namespaces-LimitRange/02-kube-manifests-LimitRange-MinMax/04-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | namespace: qa 6 | spec: 7 | type: LoadBalancer # ClusterIp, # NodePort 8 | selector: 9 | app: myapp1 10 | ports: 11 | - name: http 12 | port: 80 # Service Port 13 | targetPort: 80 # Container Port 14 | -------------------------------------------------------------------------------- /67-GKE-Horizontal-Pod-Autoscaler/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: myapp1-deployment 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: 12 | name: myapp1-pod 13 | labels: 14 | app: myapp1 15 | spec: 16 | containers: 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | resources: 22 | requests: 23 | memory: "5Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 24 | cpu: "5m" # `m` means milliCPU 25 | limits: 26 | memory: "50Mi" 27 | cpu: "50m" # 1000m is equal to 1 VCPU core 28 | -------------------------------------------------------------------------------- /67-GKE-Horizontal-Pod-Autoscaler/kube-manifests/02-kubernetes-cip-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-cip-service 5 | spec: 6 | type: ClusterIP # ClusterIP, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /67-GKE-Horizontal-Pod-Autoscaler/kube-manifests/03-kubernetes-hpa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: autoscaling/v1 2 | kind: HorizontalPodAutoscaler 3 | metadata: 4 | name: hpa-myapp1 5 | spec: 6 | scaleTargetRef: 7 | apiVersion: apps/v1 8 | kind: Deployment 9 | name: myapp1-deployment 10 | minReplicas: 1 11 | maxReplicas: 10 12 | targetCPUUtilizationPercentage: 50 13 | -------------------------------------------------------------------------------- /68-GKE-AutoPilot-Cluster/kube-manifests/01-kubernetes-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: #Dictionary 4 | name: myapp1-deployment 5 | spec: # Dictionary 6 | replicas: 5 7 | selector: 8 | matchLabels: 9 | app: myapp1 10 | template: 11 | metadata: # Dictionary 12 | name: myapp1-pod 13 | labels: # Dictionary 14 | app: myapp1 # Key value pairs 15 | spec: 16 | containers: # List 17 | - name: myapp1-container 18 | image: stacksimplify/kubenginx:1.0.0 19 | ports: 20 | - containerPort: 80 21 | resources: 22 | requests: 23 | memory: "128Mi" # 128 MebiByte is equal to 135 Megabyte (MB) 24 | cpu: "200m" # `m` means milliCPU 25 | limits: 26 | memory: "256Mi" 27 | cpu: "400m" # 1000m is equal to 1 VCPU core 28 | -------------------------------------------------------------------------------- /68-GKE-AutoPilot-Cluster/kube-manifests/02-kubernetes-loadbalancer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: myapp1-lb-service 5 | spec: 6 | type: LoadBalancer # ClusterIp, # NodePort 7 | selector: 8 | app: myapp1 9 | ports: 10 | - name: http 11 | port: 80 # Service Port 12 | targetPort: 80 # Container Port 13 | -------------------------------------------------------------------------------- /course-presentation/Google-Kubernetes-Engine-GKE-GCP-v3R.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/google-kubernetes-engine/81b89ba0a7166bbb4ec802a4a31a4650bca213ac/course-presentation/Google-Kubernetes-Engine-GKE-GCP-v3R.pptx -------------------------------------------------------------------------------- /git-deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Add files and do local commit" 4 | git add . 5 | git commit -am "Welcome to StackSimplify" 6 | 7 | echo "Pushing to Github Repository" 8 | git push 9 | -------------------------------------------------------------------------------- /images/course-title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/google-kubernetes-engine/81b89ba0a7166bbb4ec802a4a31a4650bca213ac/images/course-title.png --------------------------------------------------------------------------------