├── 1 - What are Container Orchestrators.md ├── 10 - ConfigMaps.md ├── 11 - Deploying and Scaling a Microservice.md ├── 12 - Monitor the Microservice.md ├── 2 - Why Kubernetes.md ├── 3 - Kubernetes Architecture.md ├── 4 - Setting up Kubernetes on Google Cloud.md ├── 5 - Kubernetes Resources.md ├── 6 - Creating a Deployment.md ├── 7 - Attaching a service to the Deployment.md ├── 8 - Kubernetes Volumes.md ├── 9 - Secrets.md ├── README.md ├── pv.yaml └── pvc.yaml /1 - What are Container Orchestrators.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /10 - ConfigMaps.md: -------------------------------------------------------------------------------- 1 | - Describe the [RSVP application](https://cloudyuga.gitbooks.io/container-orchestration/content/rsvp.html) 2 | 3 | - Clone the `rsvpapp` git repo and checkout `kubernetets` branch 4 | ``` 5 | $ git clone https://github.com/cloudyuga/rsvpapp.git 6 | $ git checkout kubernetes 7 | $ cd kubernetes 8 | ``` 9 | - Explore the deployment and service configuration files for back end frontend. 10 | 11 | - Deploy the backend 12 | ``` 13 | $ kubectl create -f rsvp-db.yaml 14 | $ kubectl create -f rsvp-db-service.yaml 15 | ``` 16 | 17 | - Change to `configmaps` folder 18 | ``` 19 | ❯ cd configmaps 20 | ``` 21 | 22 | - Deploy the `customer1-configmap.yaml` `ConfigMap` 23 | ``` 24 | ❯ cat customer1-configmap.yaml 25 | apiVersion: v1 26 | kind: ConfigMap 27 | metadata: 28 | name: customer1 29 | data: 30 | TEXT1: Customer1_Company 31 | TEXT2: Welcomes You 32 | COMPANY: Customer1 Company Technology Pvt. Ltd. 33 | 34 | rsvpapp/kubernetes/configmaps git/kubernetes 35 | ❯ kubectl create -f customer1-configmap.yaml 36 | configmap "customer1" created 37 | ``` 38 | 39 | - Delete the existing `rsvp` deployment if you have 40 | ``` 41 | ❯ kubectl delete deployment rsvp 42 | deployment "rsvp" deleted 43 | ``` 44 | 45 | - Create the `deployment` from the `configmaps` folder 46 | ``` 47 | ❯ kubectl create -f rsvp-web-customer1.yaml 48 | deployment "rsvp" created 49 | ``` 50 | 51 | - Create the service for `rsvp` frontend, if you don't have it already 52 | ``` 53 | ❯ kubectl create -f ../rsvp-web-service.yaml 54 | ``` 55 | 56 | - Are you able access the application ? Why not ? 57 | 58 | -------------------------------------------------------------------------------- /11 - Deploying and Scaling a Microservice.md: -------------------------------------------------------------------------------- 1 | 2 | - Describe the [RSVP application](https://cloudyuga.gitbooks.io/container-orchestration/content/rsvp.html) 3 | 4 | - Clone the `rsvpapp` git repo and checkout `kubernetets` branch 5 | ``` 6 | $ git clone https://github.com/cloudyuga/rsvpapp.git 7 | $ git checkout kubernetes 8 | $ cd kubernetes 9 | ``` 10 | - Explore the deployment and service configuration files for back end frontend. 11 | 12 | - Deploy the backend 13 | ``` 14 | $ kubectl create -f rsvp-db.yaml 15 | $ kubectl create -f rsvp-db-service.yaml 16 | ``` 17 | 18 | - Deploy the frontend 19 | ``` 20 | $ kubectl create -f rsvp-web.yaml 21 | $ kubectl create -f rsvp-web-service.yaml 22 | ``` 23 | 24 | - List `Deployments` and `Services` 25 | ``` 26 | ❯ kubectl get deployments 27 | NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE 28 | rsvp 2 2 2 2 20m 29 | rsvp-db 1 1 1 1 21m 30 | 31 | rsvpapp/kubernetes git/kubernetes 32 | ❯ kubectl get svc 33 | NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE 34 | mongodb 10.87.249.186 27017/TCP 21m 35 | rsvp 10.87.254.54 80:32505/TCP 17m 36 | ``` 37 | 38 | - Open the `NodePort` and access the application from any of node's IP address. 39 | ``` 40 | ❯ kubectl get nodes -o yaml | grep -B 1 External 41 | - address: 104.197.224.162 42 | type: ExternalIP 43 | -- 44 | - address: 104.197.110.50 45 | type: ExternalIP 46 | -- 47 | - address: 104.197.130.144 48 | type: ExternalIP 49 | ``` 50 | 51 | - Pick up any node's IP address and access it on `NodePort` 52 | ``` 53 | $ open http://104.197.110.50:32505 54 | ``` 55 | 56 | - Scale the frontend 57 | ``` 58 | $ kubectl scale --replicas=3 -f rsvp-web.yaml 59 | ``` 60 | 61 | - Refresh the frontend and look changes on `Serving from Host` line 62 | -------------------------------------------------------------------------------- /12 - Monitor the Microservice.md: -------------------------------------------------------------------------------- 1 | - Setup Prometheus 2 | ``` 3 | $ cd rsvpapp/kubernetes/prometheus 4 | $ kubectl create -f prometheus-configmap.yaml 5 | $ kubectl create -f prometheus-controller.yaml 6 | $ kubectl create -f prometheus-service.yaml 7 | ``` 8 | 9 | - List the services and get the extrnal IP address for the `prometheus` service 10 | ``` 11 | $ kubectl get svc 12 | NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE 13 | kubernetes 10.3.240.1 443/TCP 23h 14 | mongodb 10.3.247.36 27017/TCP 4h 15 | prometheus 10.3.253.103 104.154.199.189 80:30125/TCP 4h 16 | ``` 17 | 18 | - Access `prometheus` using external IP address. 19 | 20 | - Create the backed `rsvp-db` deployment and service if you don't have already 21 | ``` 22 | ❯ kubectl create -f ../rsvp-db.yaml 23 | ❯ kubectl create -f ../rsvp-db-service.yaml 24 | ``` 25 | 26 | - Create the deployment for frontend `rsvp` which exports it matrices to `Prometheus` 27 | 28 | ``` 29 | ❯ cat rsvp-web-prom.yaml 30 | apiVersion: extensions/v1beta1 31 | kind: Deployment 32 | metadata: 33 | name: rsvp 34 | spec: 35 | replicas: 2 36 | template: 37 | metadata: 38 | labels: 39 | app: rsvp 40 | name: rsvp 41 | annotations: 42 | prometheus.io/scrape: "true" 43 | prometheus.io/port: "8000" 44 | prometheus.io/path: "" 45 | spec: 46 | containers: 47 | - name: rsvp-app 48 | image: teamcloudyuga/rsvpapp:prometheus 49 | env: 50 | - name: MONGODB_HOST 51 | value: mongodb 52 | ports: 53 | - containerPort: 5000 54 | name: web-port 55 | - containerPort: 8000 56 | 57 | ❯ kubectl create -f rsvp-web-prom.yaml 58 | ``` 59 | 60 | - Deploy the `rsvp` service with `LoadBalancer` configuration 61 | 62 | - Access the `rsvp` application and perform some operations. 63 | 64 | - Open the `Prometheus` GUI and search for `flask_request_count` expression 65 | 66 | - Install `ab` tool on the workstation create a `json` file with following content :- 67 | 68 | ``` 69 | $ cat entry.json 70 | {"name": "test", "email": "test@example.com"} 71 | ``` 72 | 73 | - Get the external IP address of `rsvp` service 74 | 75 | - Run the `ab` tool with following option 76 | 77 | ``` 78 | $ ab -p entry.json -T application/json -c 10 -n 10 http:///api/rsvps 79 | ``` 80 | 81 | - Go the `Prometheus` GUI and search 82 | - `flask_request_count` 83 | - `flask_request_count{endpoint="/api/rsvps"}` 84 | -------------------------------------------------------------------------------- /2 - Why Kubernetes.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /3 - Kubernetes Architecture.md: -------------------------------------------------------------------------------- 1 | 2 | ![](https://github.com/kubernetes/kubernetes.github.io/blob/master/images/docs/architecture.png) 3 | -------------------------------------------------------------------------------- /4 - Setting up Kubernetes on Google Cloud.md: -------------------------------------------------------------------------------- 1 | - Setup an account on Google Cloud (cloud.google.com) 2 | - Create a project if you don't have it already 3 | - Setup [Google SDK on the laptop/workstation](https://cloud.google.com/sdk/downloads). 4 | ``` 5 | $ gcloud auth login 6 | $ gcloud init 7 | ``` 8 | - Redeem the coupon 9 | - Go to `cloud.google.com/redeem` to redeem the coupon, which is shared to you over email 10 | - On Google cloud select `Container Engine` 11 | - Click on `Create a container cluster` 12 | - Give a name to the container cluster (rootconf) 13 | - Change machine type to Micro 14 | - Click on `Create` 15 | 16 | - Click on `connect`, which would request to run command like following :- 17 | ``` 18 | $ gcloud container clusters get-credentials rootconf \ 19 | --zone us-central1-a --project cloudyuga-151310 20 | ``` 21 | 22 | which would spit out output like following:- 23 | ``` 24 | Fetching cluster endpoint and auth data. 25 | kubeconfig entry generated for rootconf. 26 | ``` 27 | 28 | - [Download `kubectl`](https://kubernetes.io/docs/tasks/kubectl/install/) if you have not already 29 | ``` 30 | $ gcloud components install kubectl 31 | ``` 32 | 33 | - Run following command to test your connection with the `container cluster` 34 | ``` 35 | $ kubectl cluster-info 36 | Kubernetes master is running at https://104.198.207.139 37 | GLBCDefaultBackend is running at https://104.198.207.139/api/v1/proxy/namespaces/kube-system/services/default-http-backend 38 | Heapster is running at https://104.198.207.139/api/v1/proxy/namespaces/kube-system/services/heapster 39 | KubeDNS is running at https://104.198.207.139/api/v1/proxy/namespaces/kube-system/services/kube-dns 40 | kubernetes-dashboard is running at https://104.198.207.139/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard 41 | ``` 42 | 43 | - Checkout the `~/.kube/config` file 44 | 45 | - Create a namespace 46 | ``` 47 | $ kubectl create namespace 48 | ``` 49 | 50 | - Get the current `context` 51 | ``` 52 | $ kubectl config view | awk '/current-context/ {print $2}' 53 | $ export CONTEXT=`kubectl config view | awk '/current-context/ {print $2}'` 54 | ``` 55 | 56 | - Update the default namespace for the current context 57 | ``` 58 | $ kubectl config set-context $CONTEXT --namespace= 59 | ``` 60 | 61 | where `ANYNAME` is the name of the `namespace`, you created earlier. 62 | 63 | - Access the dashboard 64 | ``` 65 | $ kubectl proxy 66 | Starting to serve on 127.0.0.1:8001 67 | ``` 68 | Open the browser with http://127.0.0.1:8001 URL. 69 | -------------------------------------------------------------------------------- /5 - Kubernetes Resources.md: -------------------------------------------------------------------------------- 1 | - Pods 2 | - Replication Controllers 3 | - Replica Sets 4 | - Deployments 5 | - Selectors 6 | - Labels 7 | - Services ...etc. 8 | 9 | Get the complete list of all supported resources type https://kubernetes.io/docs/user-guide/kubectl-cheatsheet/ (Resource types section) 10 | -------------------------------------------------------------------------------- /6 - Creating a Deployment.md: -------------------------------------------------------------------------------- 1 | 2 | ``` 3 | $ kubectl run my-nginx --image=nginx:alpine --replicas=2 --port=80 4 | 5 | ❯ kubectl get deployments 6 | NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE 7 | my-nginx 2 2 2 2 31s 8 | 9 | ❯ kubectl get replicasets 10 | NAME DESIRED CURRENT READY AGE 11 | my-nginx-64405743 2 2 2 51s 12 | 13 | ❯ kubectl get pods 14 | NAME READY STATUS RESTARTS AGE 15 | my-nginx-64405743-hffj1 1/1 Running 0 57s 16 | my-nginx-64405743-sf1mb 1/1 Running 0 57s 17 | 18 | ❯ kubectl get pods -L run 19 | NAME READY STATUS RESTARTS AGE RUN 20 | my-nginx-64405743-hffj1 1/1 Running 0 4m my-nginx 21 | my-nginx-64405743-sf1mb 1/1 Running 0 4m my-nginx 22 | 23 | ❯ kubectl get pods -L run,run1 24 | NAME READY STATUS RESTARTS AGE RUN RUN1 25 | my-nginx-64405743-hffj1 1/1 Running 0 4m my-nginx 26 | my-nginx-64405743-sf1mb 1/1 Running 0 4m my-nginx 27 | 28 | ❯ kubectl get pods --selector="run==my-nginx" 29 | NAME READY STATUS RESTARTS AGE 30 | my-nginx-64405743-hffj1 1/1 Running 0 2h 31 | my-nginx-64405743-sf1mb 1/1 Running 0 2h 32 | 33 | ❯ kubectl edit my-nginx-64405743-hffj1 34 | the server doesn't have a resource type "my-nginx-64405743-hffj1" 35 | 36 | ❯ kubectl get pods -l "env==dev" 37 | NAME READY STATUS RESTARTS AGE 38 | my-nginx-64405743-hffj1 1/1 Running 0 2h 39 | ``` 40 | 41 | 42 | - Equivalent Deployment configuration file. 43 | 44 | ``` 45 | ❯ cat my-nginx.yaml 46 | apiVersion: extensions/v1beta1 47 | kind: Deployment 48 | metadata: 49 | name: my-nginx 50 | spec: 51 | replicas: 2 52 | template: 53 | metadata: 54 | labels: 55 | run: my-nginx 56 | spec: 57 | containers: 58 | - name: my-nginx 59 | image: nginx 60 | ports: 61 | - containerPort: 80 62 | ``` 63 | -------------------------------------------------------------------------------- /7 - Attaching a service to the Deployment.md: -------------------------------------------------------------------------------- 1 | ## Services 2 | 3 | ![](https://kubernetes.io/images/docs/services-iptables-overview.svg) 4 | 5 | ### Accessing the application from external world 6 | 7 | - ExternalIP 8 | - NodePort 9 | - Load Balancer 10 | 11 | ``` 12 | ❯ kubectl expose deployment my-nginx --port=80 --type=NodePort 13 | service "my-nginx" exposed 14 | 15 | ❯ kubectl get svc 16 | NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE 17 | my-nginx 10.87.245.182 80:31581/TCP 6s 18 | 19 | ❯ kubectl describe svc my-nginx 20 | Name: my-nginx 21 | Namespace: nkhare 22 | Labels: run=my-nginx 23 | Annotations: 24 | Selector: run=my-nginx 25 | Type: NodePort 26 | IP: 10.87.245.182 27 | Port: 80/TCP 28 | NodePort: 31581/TCP 29 | Endpoints: 10.84.1.9:80,10.84.2.6:80 30 | Session Affinity: None 31 | Events: 32 | ``` 33 | 34 | - Goto the Google Cloud Console and create `Networking -> Firewall rules` to open up port mentioned in `NodePort`. In my case it is `31581`. 35 | - Create a firewall rule 36 | - Name -> 37 | - Source IP ranges -> 0.0.0.0/0 38 | - Protocols and ports -> Specified protocols and ports -> tcp:31581 39 | 40 | - Get the Node's external IP address. 41 | 42 | ``` 43 | ❯ kubectl get nodes -o yaml | grep -B 1 External 44 | - address: 104.197.224.162 45 | type: ExternalIP 46 | -- 47 | - address: 104.197.110.50 48 | type: ExternalIP 49 | -- 50 | - address: 104.197.130.144 51 | type: ExternalIP 52 | ``` 53 | 54 | - Pick up any node's IP address and access it on `NodePort` 55 | ``` 56 | $ open http://104.197.110.50:31581 57 | ``` 58 | 59 | - Equivalent Service configuration file. 60 | ``` 61 | ❯ cat my-nginx-svc.yaml 62 | apiVersion: v1 63 | kind: Service 64 | metadata: 65 | name: my-nginx 66 | labels: 67 | run: my-nginx 68 | spec: 69 | type: NodePort 70 | ports: 71 | - port: 80 72 | protocol: TCP 73 | selector: 74 | run: my-nginx 75 | ``` 76 | 77 | - Delete the service 78 | ``` 79 | ❯ kubectl delete svc my-nginx 80 | service "my-nginx" deleted 81 | ``` 82 | 83 | - create a service with following configuration file 84 | ``` 85 | ❯ cat my-nginx-sv-lb.yaml 86 | apiVersion: v1 87 | kind: Service 88 | metadata: 89 | name: my-nginx 90 | labels: 91 | run: my-nginx 92 | spec: 93 | type: NodePort 94 | ports: 95 | - port: 80 96 | protocol: TCP 97 | selector: 98 | run: my-nginx 99 | ``` 100 | 101 | ``` 102 | $ kubectl crate -f my-nginx-sv-lb.yaml 103 | ``` 104 | 105 | ``` 106 | ❯ kubectl get svc 107 | NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE 108 | my-nginx 10.87.249.111 104.154.252.253 80:30122/TCP 1m 109 | ``` 110 | 111 | Access the application with `EXTERNAL-IP` 112 | -------------------------------------------------------------------------------- /8 - Kubernetes Volumes.md: -------------------------------------------------------------------------------- 1 | 2 | - Create a disk on GCE 3 | ``` 4 | ❯ gcloud compute disks create --size=10GB mongodb-data 5 | WARNING: You have selected a disk size of under [200GB]. This may result in poor I/O performance. For more information, see: https://developers.google.com/compute/docs/disks#pdperformance. 6 | Created [https://www.googleapis.com/compute/v1/projects/cloudyuga-151310/zones/us-central1-a/disks/mongodb-data]. 7 | NAME ZONE SIZE_GB TYPE STATUS 8 | mongodb-data us-central1-a 10 pd-standard READY 9 | 10 | New disks are unformatted. You must format and mount a disk before it 11 | can be used. You can find instructions on how to do this at: 12 | 13 | https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting 14 | ``` 15 | 16 | Check it on Google cloud interface. 17 | 18 | - Get into `volumes` directory for `rsvpapp` 19 | ``` 20 | $ cd volumes 21 | ``` 22 | 23 | - Create a `PersistentVolume` using GCE disk we created earlier. Make sure the name of disk (mongodb-data) matches with `pdName` inside `volume.yaml`. 24 | 25 | ``` 26 | ❯ kubectl create -f volume.yaml 27 | persistentvolume "mongodb-pv" created 28 | 29 | ❯ kubectl get PersistentVolume 30 | NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE 31 | mongodb-pv 10Gi RWO Retain Available 13s 32 | 33 | ❯ kubectl describe PersistentVolume mongodb-pv 34 | Name: mongodb-pv 35 | Labels: 36 | Annotations: 37 | StorageClass: 38 | Status: Available 39 | Claim: 40 | Reclaim Policy: Retain 41 | Access Modes: RWO 42 | Capacity: 10Gi 43 | Message: 44 | Source: 45 | Type: GCEPersistentDisk (a Persistent Disk resource in Google Compute Engine) 46 | PDName: mongodb-data 47 | FSType: ext4 48 | Partition: 0 49 | ReadOnly: false 50 | Events: 51 | ``` 52 | 53 | - Claim the `PersistentVolume`, we created earlier 54 | 55 | ``` 56 | ❯ kubectl create -f rsvp-db_pv_claim.yaml 57 | persistentvolumeclaim "mongodb-pv-claim" created 58 | 59 | rsvpapp/kubernetes/volumes git/kubernetes* 60 | ❯ kubectl get PersistentVolumeClaim 61 | NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE 62 | mongodb-pv-claim Bound mongodb-pv 10Gi RWO 13s 63 | 64 | rsvpapp/kubernetes/volumes git/kubernetes* 65 | ❯ kubectl describe PersistentVolume mongodb-pv 66 | Name: mongodb-pv 67 | Labels: 68 | Annotations: pv.kubernetes.io/bound-by-controller=yes 69 | StorageClass: 70 | Status: Bound 71 | Claim: nkhare/mongodb-pv-claim 72 | Reclaim Policy: Retain 73 | Access Modes: RWO 74 | Capacity: 10Gi 75 | Message: 76 | Source: 77 | Type: GCEPersistentDisk (a Persistent Disk resource in Google Compute Engine) 78 | PDName: mongodb-data 79 | FSType: ext4 80 | Partition: 0 81 | ReadOnly: false 82 | Events: 83 | ``` 84 | 85 | - Delete the `rsvp-db` deployment, if you already have 86 | ``` 87 | ❯ kubectl delete deployment rsvp-db 88 | ``` 89 | 90 | - Use the `PersistentVolumeClaim` inside a deployment 91 | ``` 92 | ❯ kubectl create -f rsvp-db.yaml 93 | ``` 94 | 95 | - Create the service for `rsvp-db`, if you don't have it already 96 | ``` 97 | ❯ kubectl create -f ../rsvp-db-service.yaml 98 | ``` 99 | 100 | - Create the frontend `rsvp` deployment and service if you don't have already 101 | ``` 102 | ❯ kubectl create -f ../rsvp-web.yaml 103 | ❯ kubectl create -f ../rsvp-web-service.yaml 104 | ``` 105 | 106 | - Access the frontend and put some volues there 107 | 108 | - Scale the backend `rsvp-db` to zero replicas 109 | ``` 110 | ❯ kubectl scale --replicas=0 -f rsvp-db.yaml 111 | ``` 112 | 113 | - Scale the backend `rsvp-db` to one replicas 114 | ``` 115 | ❯ kubectl scale --replicas=0 -f rsvp-db.yaml 116 | ``` 117 | 118 | - Access the application and we should see the entries we did ealrier. 119 | 120 | - After destroying the application, you can remove the disk from GCE, using following command :- 121 | ``` 122 | ❯ gcloud compute disks delete mongodb-data 123 | ``` 124 | -------------------------------------------------------------------------------- /9 - Secrets.md: -------------------------------------------------------------------------------- 1 | 2 | - Create a file with a password and make sure there is no trailing new line 3 | 4 | ``` 5 | ❯ echo "rootconf" > password.txt 6 | ❯ tr -Ccsu '\n' .strippedpassword.txt && mv .strippedpassword.txt password.txt 7 | ``` 8 | 9 | - Create a secret 10 | ``` 11 | ❯ kubectl create secret generic my-password --from-file=password.txt 12 | ❯ kubectl get secret my-password 13 | NAME TYPE DATA AGE 14 | my-password Opaque 1 12s 15 | 16 | ❯ kubectl describe secret my-password 17 | Name: my-password 18 | Namespace: default 19 | Labels: 20 | Annotations: 21 | 22 | Type: Opaque 23 | 24 | Data 25 | ==== 26 | password.txt: 8 bytes 27 | ``` 28 | 29 | - Create a pod and access the secret from it. 30 | ``` 31 | ❯ cat pod.yam 32 | apiVersion: v1 33 | kind: Pod 34 | metadata: 35 | name: secret-env-pod 36 | spec: 37 | containers: 38 | - name: mycontainer 39 | image: nginx:alpine 40 | env: 41 | - name: SECRET_PASSWORD 42 | valueFrom: 43 | secretKeyRef: 44 | name: my-password 45 | key: password.txt 46 | restartPolicy: Never 47 | 48 | 49 | ❯ kubectl create -f pod.yaml 50 | ``` 51 | 52 | - Access the pod and check environment variable. 53 | 54 | ``` 55 | ❯ kubectl exec -it secret-env-pod sh 56 | / # env 57 | KUBERNETES_PORT=tcp://10.3.240.1:443 58 | KUBERNETES_SERVICE_PORT=443 59 | HOSTNAME=secret-env-pod 60 | SHLVL=1 61 | HOME=/root 62 | SECRET_PASSWORD=rotconf 63 | 64 | NGINX_VERSION=1.13.0 65 | KUBERNETES_PORT_443_TCP_ADDR=10.3.240.1 66 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 67 | KUBERNETES_PORT_443_TCP_PORT=443 68 | KUBERNETES_PORT_443_TCP_PROTO=tcp 69 | KUBERNETES_SERVICE_PORT_HTTPS=443 70 | KUBERNETES_PORT_443_TCP=tcp://10.3.240.1:443 71 | PWD=/ 72 | KUBERNETES_SERVICE_HOST=10.3.240.1 73 | ``` 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kubernetes101 2 | 3 | Kubernetes 101 Workshop 4 | -------------------------------------------------------------------------------- /pv.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolume 2 | apiVersion: v1 3 | metadata: 4 | name: pv0001 5 | labels: 6 | type: local 7 | spec: 8 | capacity: 9 | storage: 1Gi 10 | accessModes: 11 | - ReadWriteOnce 12 | hostPath: 13 | path: "/tmp/nkharevol" 14 | -------------------------------------------------------------------------------- /pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: myclaim-1 5 | annotations: 6 | volume.beta.kubernetes.io/storage-class: 7 | spec: 8 | accessModes: 9 | - ReadWriteOnce 10 | resources: 11 | requests: 12 | storage: 0.5Gi 13 | selector: 14 | matchLabels: 15 | type: local 16 | --------------------------------------------------------------------------------