From dd1d9fe54a6f88950786e22583b0f203e3ef49b3 Mon Sep 17 00:00:00 2001 From: ludo8147 <ludo8147@bht-berlin.de> Date: Sun, 8 Sep 2024 21:42:01 +0200 Subject: [PATCH] corrected kubernetes cluster with verified application --- .../terminal.log | 20 +++- deploy_app_on_kubernetes/service.yaml | 3 +- deploy_app_on_kubernetes/terminal.log | 106 ++++++++++++++++++ 3 files changed, 122 insertions(+), 7 deletions(-) diff --git a/Spin_up_a_virtual_machine_locally/terminal.log b/Spin_up_a_virtual_machine_locally/terminal.log index 9c1f9d1..3a90ccb 100644 --- a/Spin_up_a_virtual_machine_locally/terminal.log +++ b/Spin_up_a_virtual_machine_locally/terminal.log @@ -55,8 +55,18 @@ Script started on 2024-09-07 16:46:02+02:00 [TERM="xterm-256color" TTY="/dev/pts [0;32m default: │ http://127.0.0.1:3000 │[0m [0;32m default: │ (bound on host 0.0.0.0 and port 3000) │[0m [0;32m default: │ │[0m -[0;32m default: │ Handlers ............ 31 Processes ... - - -lucad@lucad:~/Documents/webservice$ curl http://localhost:8080 -Hello, World!lucad@lucad:~/Documents/webservice$ \ No newline at end of file +[0;32m default: │ Handlers ............ 31 Processes........ 1 │[0m +[0;32m default: │ Prefork ....... Disabled PID .............. 2039 │[0m +[0;32m default: └───────────────────────────────────────────────────┘[0m +[0;32m default: [0m +[0;32m default: time=2024-09-07T14:47:36.240Z level=DEBUG msg="GET / mime:*/* agent:curl/8.5.0"[0m +^C[1;33m==> default: Waiting for cleanup before exiting...[0m +^C[1;31m==> default: Exiting immediately, without cleanup![0m +[?2004h]0;lucad@lucad: ~/Documents/webservice/Spin_up_a_virtual_machine_locally[01;32mlucad@lucad[00m:[01;34m~/Documents/webservice/Spin_up_a_virtual_machine_locally[00m$ vagrant r[Kdestroy +[?2004l [0m default: Are you sure you want to destroy the 'default' VM? [y/N] [0my +[1m==> default: Forcing shutdown of VM...[0m +[1m==> default: Destroying VM and associated drives...[0m +[?2004h]0;lucad@lucad: ~/Documents/webservice/Spin_up_a_virtual_machine_locally[01;32mlucad@lucad[00m:[01;34m~/Documents/webservice/Spin_up_a_virtual_machine_locally[00m$ [?2004l +exit + +Script done on 2024-09-07 16:55:08+02:00 [COMMAND_EXIT_CODE="0"] diff --git a/deploy_app_on_kubernetes/service.yaml b/deploy_app_on_kubernetes/service.yaml index f1124b4..a25adb4 100644 --- a/deploy_app_on_kubernetes/service.yaml +++ b/deploy_app_on_kubernetes/service.yaml @@ -11,5 +11,4 @@ spec: ports: - port: 80 targetPort: 3000 - protocol: TCP - type: 'ClusterIP' \ No newline at end of file + protocol: TCP \ No newline at end of file diff --git a/deploy_app_on_kubernetes/terminal.log b/deploy_app_on_kubernetes/terminal.log index ae405a0..bbc5a8f 100644 --- a/deploy_app_on_kubernetes/terminal.log +++ b/deploy_app_on_kubernetes/terminal.log @@ -2108,3 +2108,109 @@ service/webservice-service configured [?2004l service/webservice-service configured [?2004h]0;lucad@ +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ minikube start \ + --cpus=2 --memory=4096m \ + --container-runtime=cri-o \ + --driver=virtualbox \ + --addons=ingress \ + --profile=devops-tutorial +😄 [devops-tutorial] minikube v1.33.1 on Ubuntu 24.04 +✨ Using the virtualbox driver based on existing profile +👠Starting "devops-tutorial" primary control-plane node in "devops-tutorial" cluster +🔄 Restarting existing virtualbox VM for "devops-tutorial" ... +🎠Preparing Kubernetes v1.30.0 on CRI-O 1.29.1 ... +🔗 Configuring bridge CNI (Container Networking Interface) ... +🔎 Verifying Kubernetes components... + ▪ Using image registry.k8s.io/ingress-nginx/controller:v1.10.1 + ▪ Using image registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.4.1 + ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5 + ▪ Using image registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.4.1 +🔎 Verifying ingress addon... +🌟 Enabled addons: default-storageclass, storage-provisioner, ingress +🄠Done! kubectl is now configured to use "devops-tutorial" cluster and "default" namespace by default +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ kubectl api-resources +NAME SHORTNAMES APIVERSION NAMESPACED KIND +bindings v1 true Binding +componentstatuses cs v1 false ComponentStatus +configmaps cm v1 true ConfigMap +endpoints ep v1 true Endpoints +events ev v1 true Event +limitranges limits v1 true LimitRange +namespaces ns v1 false Namespace +nodes no v1 false Node +persistentvolumeclaims pvc v1 true PersistentVolumeClaim +persistentvolumes pv v1 false PersistentVolume +pods po v1 true Pod +podtemplates v1 true PodTemplate +replicationcontrollers rc v1 true ReplicationController +resourcequotas quota v1 true ResourceQuota +secrets v1 true Secret +serviceaccounts sa v1 true ServiceAccount +services svc v1 true Service +mutatingwebhookconfigurations admissionregistration.k8s.io/v1 false MutatingWebhookConfiguration +validatingadmissionpolicies admissionregistration.k8s.io/v1 false ValidatingAdmissionPolicy +validatingadmissionpolicybindings admissionregistration.k8s.io/v1 false ValidatingAdmissionPolicyBinding +validatingwebhookconfigurations admissionregistration.k8s.io/v1 false ValidatingWebhookConfiguration +customresourcedefinitions crd,crds apiextensions.k8s.io/v1 false CustomResourceDefinition +apiservices apiregistration.k8s.io/v1 false APIService +controllerrevisions apps/v1 true ControllerRevision +daemonsets ds apps/v1 true DaemonSet +deployments deploy apps/v1 true Deployment +replicasets rs apps/v1 true ReplicaSet +statefulsets sts apps/v1 true StatefulSet +selfsubjectreviews authentication.k8s.io/v1 false SelfSubjectReview +tokenreviews authentication.k8s.io/v1 false TokenReview +localsubjectaccessreviews authorization.k8s.io/v1 true LocalSubjectAccessReview +selfsubjectaccessreviews authorization.k8s.io/v1 false SelfSubjectAccessReview +selfsubjectrulesreviews authorization.k8s.io/v1 false SelfSubjectRulesReview +subjectaccessreviews authorization.k8s.io/v1 false SubjectAccessReview +horizontalpodautoscalers hpa autoscaling/v2 true HorizontalPodAutoscaler +cronjobs cj batch/v1 true CronJob +jobs batch/v1 true Job +certificatesigningrequests csr certificates.k8s.io/v1 false CertificateSigningRequest +leases coordination.k8s.io/v1 true Lease +endpointslices discovery.k8s.io/v1 true EndpointSlice +events ev events.k8s.io/v1 true Event +flowschemas flowcontrol.apiserver.k8s.io/v1 false FlowSchema +prioritylevelconfigurations flowcontrol.apiserver.k8s.io/v1 false PriorityLevelConfiguration +ingressclasses networking.k8s.io/v1 false IngressClass +ingresses ing networking.k8s.io/v1 true Ingress +networkpolicies netpol networking.k8s.io/v1 true NetworkPolicy +runtimeclasses node.k8s.io/v1 false RuntimeClass +poddisruptionbudgets pdb policy/v1 true PodDisruptionBudget +clusterrolebindings rbac.authorization.k8s.io/v1 false ClusterRoleBinding +clusterroles rbac.authorization.k8s.io/v1 false ClusterRole +rolebindings rbac.authorization.k8s.io/v1 true RoleBinding +roles rbac.authorization.k8s.io/v1 true Role +priorityclasses pc scheduling.k8s.io/v1 false PriorityClass +csidrivers storage.k8s.io/v1 false CSIDriver +csinodes storage.k8s.io/v1 false CSINode +csistoragecapacities storage.k8s.io/v1 true CSIStorageCapacity +storageclasses sc storage.k8s.io/v1 false StorageClass +volumeattachments storage.k8s.io/v1 false VolumeAttachment +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ kubectl get pods +No resources found in default namespace. +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ kubectl create namespace tutorial +Error from server (AlreadyExists): namespaces "tutorial" already exists +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ kubectl kubectl config set-context --current --namespace tutorial +error: unknown command "kubectl" for "kubectl" +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ kubectl config set-context --current --namespace tutorial +Context "devops-tutorial" modified. +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ kubectl getpods +error: unknown command "getpods" for "kubectl" +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ kubectl get pods +NAME READY STATUS RESTARTS AGE +webservice-deployment-7ffd578df-gtklr 1/1 Running 1 30h +webservice-deployment-7ffd578df-l6mbx 1/1 Running 1 30h +webservice-deployment-7ffd578df-nzzpd 1/1 Running 1 30h +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ curl http://webservice.local +Hello, World!lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ kubectl apply -f service.yaml +service/webservice-service configured +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ curl http://webservice.local +Hello, World!lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ curl http://webservice.local +Hello, World!lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ curl http://webservice.local +Hello, World!lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ kubectl get services +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +webservice-service LoadBalancer 10.106.249.66 <pending> 80:32629/TCP 31h +lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ curl http://webservice.local +Hello, World!lucad@lucad:~/Documents/webservice/deploy_app_on_kubernetes$ \ No newline at end of file -- GitLab