From 9bfe4da9569aca85322f8176a498fadfe1ccc7bc Mon Sep 17 00:00:00 2001 From: Mukund Date: Tue, 11 Jan 2022 12:14:22 -0500 Subject: [PATCH 1/4] added requirements file --- requirements.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..afbdd8f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +click==7.1.2 +Flask==1.1.2 +itsdangerous==1.1.0 +Jinja2==2.11.2 +MarkupSafe==1.1.1 +Werkzeug==1.0.1 +gunicorn==19.9.0 From 71edc18a00b4835dba1ea8ebbbc97fe952889ed4 Mon Sep 17 00:00:00 2001 From: Mukund Date: Tue, 11 Jan 2022 14:10:04 -0500 Subject: [PATCH 2/4] Dockerfile created and build image --- Dockerfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4e68f8a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.9.9 + +WORKDIR C:/Users/mukun/web + +COPY . . + +RUN pip install -r requirements.txt + +EXPOSE 5000 + +CMD ["python", "web.py"] + + + + From 6fd810245bdbd2e711785da0c965fa7ec4805223 Mon Sep 17 00:00:00 2001 From: Mukund Date: Tue, 11 Jan 2022 18:29:12 -0500 Subject: [PATCH 3/4] Added kubernetes.yml file --- kubernetes.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 kubernetes.yml diff --git a/kubernetes.yml b/kubernetes.yml new file mode 100644 index 0000000..7420325 --- /dev/null +++ b/kubernetes.yml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/name: load-balancer-sba-k8s + name: sba-k8s +spec: + replicas: 3 + selector: + matchLabels: + app.kubernetes.io/name: load-balancer-sba-k8s + template: + metadata: + labels: + app.kubernetes.io/name: load-balancer-sba-k8s + spec: + containers: + - image: sba-k8s:latest + name: sba-k8s + imagePullPolicy: Never + ports: + - containerPort: 8080 + env: + - name: KLAUS_PORT + value: "8080" From ff9b390beef34ef516a23da42555f8667f10e300 Mon Sep 17 00:00:00 2001 From: Mukund Date: Tue, 11 Jan 2022 21:28:36 -0500 Subject: [PATCH 4/4] kubernetes cluster script and status output file added --- kubernetes-cluster-information-output | 314 ++++++++++++++++++++++++++ kubernetes-cluster-information.sh | 5 + 2 files changed, 319 insertions(+) create mode 100644 kubernetes-cluster-information-output create mode 100644 kubernetes-cluster-information.sh diff --git a/kubernetes-cluster-information-output b/kubernetes-cluster-information-output new file mode 100644 index 0000000..488efaf --- /dev/null +++ b/kubernetes-cluster-information-output @@ -0,0 +1,314 @@ +Name: kubernetes +Namespace: default +Labels: component=apiserver + provider=kubernetes +Annotations: +Selector: +Type: ClusterIP +IP Family Policy: SingleStack +IP Families: IPv4 +IP: 10.96.0.1 +IPs: 10.96.0.1 +Port: https 443/TCP +TargetPort: 8443/TCP +Endpoints: 192.168.49.2:8443 +Session Affinity: None +Events: +Name: sba-k8s-97d847d68-nngmh +Namespace: default +Priority: 0 +Node: minikube/192.168.49.2 +Start Time: Tue, 11 Jan 2022 18:10:27 -0500 +Labels: app.kubernetes.io/name=load-balancer-sba-k8s + pod-template-hash=97d847d68 +Annotations: +Status: Running +IP: 172.17.0.2 +IPs: + IP: 172.17.0.2 +Controlled By: ReplicaSet/sba-k8s-97d847d68 +Containers: + sba-k8s: + Container ID: docker://13949314dddda74ebe0138075bb74274d9703ac01e2b2131d36f8145a571dc32 + Image: sba-k8s:latest + Image ID: docker://sha256:cf559561804bc956d09ca9d183196c6788733e169451511311d22647155fedb7 + Port: 8080/TCP + Host Port: 0/TCP + State: Running + Started: Tue, 11 Jan 2022 21:21:39 -0500 + Last State: Terminated + Reason: Error + Exit Code: 255 + Started: Tue, 11 Jan 2022 18:10:29 -0500 + Finished: Tue, 11 Jan 2022 21:21:16 -0500 + Ready: True + Restart Count: 1 + Environment: + KLAUS_PORT: 8080 + Mounts: + /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-qhvdh (ro) +Conditions: + Type Status + Initialized True + Ready True + ContainersReady True + PodScheduled True +Volumes: + kube-api-access-qhvdh: + Type: Projected (a volume that contains injected data from multiple sources) + TokenExpirationSeconds: 3607 + ConfigMapName: kube-root-ca.crt + ConfigMapOptional: + DownwardAPI: true +QoS Class: BestEffort +Node-Selectors: +Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s + node.kubernetes.io/unreachable:NoExecute op=Exists for 300s +Events: + Type Reason Age From Message + ---- ------ ---- ---- ------- + Normal SandboxChanged 2m19s kubelet Pod sandbox changed, it will be killed and re-created. + Normal Pulled 2m18s kubelet Container image "sba-k8s:latest" already present on machine + Normal Created 2m18s kubelet Created container sba-k8s + Normal Started 2m18s kubelet Started container sba-k8s + + +Name: sba-k8s-97d847d68-pffdn +Namespace: default +Priority: 0 +Node: minikube/192.168.49.2 +Start Time: Tue, 11 Jan 2022 18:10:27 -0500 +Labels: app.kubernetes.io/name=load-balancer-sba-k8s + pod-template-hash=97d847d68 +Annotations: +Status: Running +IP: 172.17.0.4 +IPs: + IP: 172.17.0.4 +Controlled By: ReplicaSet/sba-k8s-97d847d68 +Containers: + sba-k8s: + Container ID: docker://ece0e1304d344df215beb875367ef13669277820fc0c5151f0e4f270da76e0d8 + Image: sba-k8s:latest + Image ID: docker://sha256:cf559561804bc956d09ca9d183196c6788733e169451511311d22647155fedb7 + Port: 8080/TCP + Host Port: 0/TCP + State: Running + Started: Tue, 11 Jan 2022 21:21:41 -0500 + Last State: Terminated + Reason: Error + Exit Code: 255 + Started: Tue, 11 Jan 2022 18:10:29 -0500 + Finished: Tue, 11 Jan 2022 21:21:16 -0500 + Ready: True + Restart Count: 1 + Environment: + KLAUS_PORT: 8080 + Mounts: + /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-t5752 (ro) +Conditions: + Type Status + Initialized True + Ready True + ContainersReady True + PodScheduled True +Volumes: + kube-api-access-t5752: + Type: Projected (a volume that contains injected data from multiple sources) + TokenExpirationSeconds: 3607 + ConfigMapName: kube-root-ca.crt + ConfigMapOptional: + DownwardAPI: true +QoS Class: BestEffort +Node-Selectors: +Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s + node.kubernetes.io/unreachable:NoExecute op=Exists for 300s +Events: + Type Reason Age From Message + ---- ------ ---- ---- ------- + Normal SandboxChanged 2m19s kubelet Pod sandbox changed, it will be killed and re-created. + Normal Pulled 2m17s kubelet Container image "sba-k8s:latest" already present on machine + Normal Created 2m17s kubelet Created container sba-k8s + Normal Started 2m16s kubelet Started container sba-k8s + + +Name: sba-k8s-97d847d68-x5xrb +Namespace: default +Priority: 0 +Node: minikube/192.168.49.2 +Start Time: Tue, 11 Jan 2022 18:10:27 -0500 +Labels: app.kubernetes.io/name=load-balancer-sba-k8s + pod-template-hash=97d847d68 +Annotations: +Status: Running +IP: 172.17.0.3 +IPs: + IP: 172.17.0.3 +Controlled By: ReplicaSet/sba-k8s-97d847d68 +Containers: + sba-k8s: + Container ID: docker://1d01bbe5c61cf81302c4b232fdc216764d672b14965a8939012a5238c9154022 + Image: sba-k8s:latest + Image ID: docker://sha256:cf559561804bc956d09ca9d183196c6788733e169451511311d22647155fedb7 + Port: 8080/TCP + Host Port: 0/TCP + State: Running + Started: Tue, 11 Jan 2022 21:21:41 -0500 + Last State: Terminated + Reason: Error + Exit Code: 255 + Started: Tue, 11 Jan 2022 18:10:29 -0500 + Finished: Tue, 11 Jan 2022 21:21:16 -0500 + Ready: True + Restart Count: 1 + Environment: + KLAUS_PORT: 8080 + Mounts: + /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-5spts (ro) +Conditions: + Type Status + Initialized True + Ready True + ContainersReady True + PodScheduled True +Volumes: + kube-api-access-5spts: + Type: Projected (a volume that contains injected data from multiple sources) + TokenExpirationSeconds: 3607 + ConfigMapName: kube-root-ca.crt + ConfigMapOptional: + DownwardAPI: true +QoS Class: BestEffort +Node-Selectors: +Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s + node.kubernetes.io/unreachable:NoExecute op=Exists for 300s +Events: + Type Reason Age From Message + ---- ------ ---- ---- ------- + Normal SandboxChanged 2m19s kubelet Pod sandbox changed, it will be killed and re-created. + Normal Pulled 2m17s kubelet Container image "sba-k8s:latest" already present on machine + Normal Created 2m17s kubelet Created container sba-k8s + Normal Started 2m16s kubelet Started container sba-k8s +Name: minikube +Roles: control-plane,master +Labels: beta.kubernetes.io/arch=amd64 + beta.kubernetes.io/os=linux + kubernetes.io/arch=amd64 + kubernetes.io/hostname=minikube + kubernetes.io/os=linux + minikube.k8s.io/commit=76b94fb3c4e8ac5062daf70d60cf03ddcc0a741b + minikube.k8s.io/name=minikube + minikube.k8s.io/updated_at=2022_01_11T17_47_12_0700 + minikube.k8s.io/version=v1.24.0 + node-role.kubernetes.io/control-plane= + node-role.kubernetes.io/master= + node.kubernetes.io/exclude-from-external-load-balancers= +Annotations: kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock + node.alpha.kubernetes.io/ttl: 0 + volumes.kubernetes.io/controller-managed-attach-detach: true +CreationTimestamp: Tue, 11 Jan 2022 17:47:07 -0500 +Taints: +Unschedulable: false +Lease: + HolderIdentity: minikube + AcquireTime: + RenewTime: Tue, 11 Jan 2022 21:23:49 -0500 +Conditions: + Type Status LastHeartbeatTime LastTransitionTime Reason Message + ---- ------ ----------------- ------------------ ------ ------- + MemoryPressure False Tue, 11 Jan 2022 21:21:37 -0500 Tue, 11 Jan 2022 17:47:01 -0500 KubeletHasSufficientMemory kubelet has sufficient memory available + DiskPressure False Tue, 11 Jan 2022 21:21:37 -0500 Tue, 11 Jan 2022 17:47:01 -0500 KubeletHasNoDiskPressure kubelet has no disk pressure + PIDPressure False Tue, 11 Jan 2022 21:21:37 -0500 Tue, 11 Jan 2022 17:47:01 -0500 KubeletHasSufficientPID kubelet has sufficient PID available + Ready True Tue, 11 Jan 2022 21:21:37 -0500 Tue, 11 Jan 2022 17:47:23 -0500 KubeletReady kubelet is posting ready status +Addresses: + InternalIP: 192.168.49.2 + Hostname: minikube +Capacity: + cpu: 8 + ephemeral-storage: 263174212Ki + hugepages-1Gi: 0 + hugepages-2Mi: 0 + memory: 7817720Ki + pods: 110 +Allocatable: + cpu: 8 + ephemeral-storage: 263174212Ki + hugepages-1Gi: 0 + hugepages-2Mi: 0 + memory: 7817720Ki + pods: 110 +System Info: + Machine ID: bba0be70c47c400ea3cf7733f1c0b4c1 + System UUID: bba0be70c47c400ea3cf7733f1c0b4c1 + Boot ID: e3d98151-57e8-4307-afde-98237f987a04 + Kernel Version: 5.10.16.3-microsoft-standard-WSL2 + OS Image: Ubuntu 20.04.2 LTS + Operating System: linux + Architecture: amd64 + Container Runtime Version: docker://20.10.8 + Kubelet Version: v1.22.3 + Kube-Proxy Version: v1.22.3 +PodCIDR: 10.244.0.0/24 +PodCIDRs: 10.244.0.0/24 +Non-terminated Pods: (12 in total) + Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits Age + --------- ---- ------------ ---------- --------------- ------------- --- + default sba-k8s-97d847d68-nngmh 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3h13m + default sba-k8s-97d847d68-pffdn 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3h13m + default sba-k8s-97d847d68-x5xrb 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3h13m + kube-system coredns-78fcd69978-t9gws 100m (1%) 0 (0%) 70Mi (0%) 170Mi (2%) 3h36m + kube-system etcd-minikube 100m (1%) 0 (0%) 100Mi (1%) 0 (0%) 3h36m + kube-system kube-apiserver-minikube 250m (3%) 0 (0%) 0 (0%) 0 (0%) 3h36m + kube-system kube-controller-manager-minikube 200m (2%) 0 (0%) 0 (0%) 0 (0%) 3h36m + kube-system kube-proxy-7867k 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3h36m + kube-system kube-scheduler-minikube 100m (1%) 0 (0%) 0 (0%) 0 (0%) 3h36m + kube-system storage-provisioner 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3h36m + kubernetes-dashboard dashboard-metrics-scraper-5594458c94-fqdh7 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3h1m + kubernetes-dashboard kubernetes-dashboard-654cf69797-cng7x 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3h1m +Allocated resources: + (Total limits may be over 100 percent, i.e., overcommitted.) + Resource Requests Limits + -------- -------- ------ + cpu 750m (9%) 0 (0%) + memory 170Mi (2%) 170Mi (2%) + ephemeral-storage 0 (0%) 0 (0%) + hugepages-1Gi 0 (0%) 0 (0%) + hugepages-2Mi 0 (0%) 0 (0%) +Events: + Type Reason Age From Message + ---- ------ ---- ---- ------- + Normal Starting 2m14s kube-proxy + Normal Starting 2m28s kubelet Starting kubelet. + Normal NodeAllocatableEnforced 2m27s kubelet Updated Node Allocatable limit across pods + Normal NodeHasSufficientMemory 2m25s (x8 over 2m27s) kubelet Node minikube status is now: NodeHasSufficientMemory + Normal NodeHasNoDiskPressure 2m25s (x8 over 2m27s) kubelet Node minikube status is now: NodeHasNoDiskPressure + Normal NodeHasSufficientPID 2m25s (x7 over 2m27s) kubelet Node minikube status is now: NodeHasSufficientPID +Name: sba-k8s +Namespace: default +CreationTimestamp: Tue, 11 Jan 2022 18:10:27 -0500 +Labels: app.kubernetes.io/name=load-balancer-sba-k8s +Annotations: deployment.kubernetes.io/revision: 1 +Selector: app.kubernetes.io/name=load-balancer-sba-k8s +Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavailable +StrategyType: RollingUpdate +MinReadySeconds: 0 +RollingUpdateStrategy: 25% max unavailable, 25% max surge +Pod Template: + Labels: app.kubernetes.io/name=load-balancer-sba-k8s + Containers: + sba-k8s: + Image: sba-k8s:latest + Port: 8080/TCP + Host Port: 0/TCP + Environment: + KLAUS_PORT: 8080 + Mounts: + Volumes: +Conditions: + Type Status Reason + ---- ------ ------ + Available True MinimumReplicasAvailable + Progressing True NewReplicaSetAvailable +OldReplicaSets: +NewReplicaSet: sba-k8s-97d847d68 (3/3 replicas created) +Events: diff --git a/kubernetes-cluster-information.sh b/kubernetes-cluster-information.sh new file mode 100644 index 0000000..6c05044 --- /dev/null +++ b/kubernetes-cluster-information.sh @@ -0,0 +1,5 @@ +#!/bin/bash +kubectl describe svc > kubernetes-cluster-information-output +kubectl describe pod >> kubernetes-cluster-information-output +kubectl describe nodes >> kubernetes-cluster-information-output +kubectl describe deployments >> kubernetes-cluster-information-output