install kubernetes in OCI
install kubernetes in OCI
kubectl: OK
clientVersion:
buildDate: "2024-04-17T17:36:05Z"
compiler: gc
gitCommit: 7c48c2bd72b9bf5c44d21d7338cc7bea77d0ad2a
gitTreeState: clean
gitVersion: v1.30.0
goVersion: go1.22.2
major: "1"
minor: "30"
platform: linux/amd64
kustomizeVersion: v5.0.4-0.20230601165947-6ce0bf390ce3
[root@kubernetes opc]#
[root@kubernetes opc]# /usr/local/bin/kubectl version
The connection to the server localhost:8080 was refused - did you specify the right host or port?
[root@kubernetes opc]#
Install minikube:-
[root@kubernetes opc]#
X Exiting due to DRV_AS_ROOT: The "podman" driver should not be used with root
privileges.
Verify
[opc@kubernetes-cluster ~]$ minikube kubectl -- get pods -A
> kubectl.sha256: 64 B / 64 B [-------------------------] 100.00% ? p/s 0s
> kubectl: 49.07 MiB / 49.07 MiB [------------] 100.00% 1.15 GiB p/s 200ms
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-7db6d8ff4d-mrc5p 1/1 Running 0 19s
kube-system etcd-minikube 1/1 Running 0 32s
kube-system kube-apiserver-minikube 1/1 Running 0 34s
kube-system kube-controller-manager-minikube 1/1 Running 0 32s
kube-system kube-proxy-vc97q 1/1 Running 0 19s
kube-system kube-scheduler-minikube 1/1 Running 0 32s
kube-system storage-provisioner 1/1 Running 0 31s
[opc@kubernetes-cluster ~]$
[opc@kubernetes-cluster ~]$
Stop minikube
* 1 node stopped.
E0513 14:28:11.613557 100931 memcache.go:265] couldn't get current server API group list: Get
"http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0513 14:28:11.614150 100931 memcache.go:265] couldn't get current server API group list: Get
"http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0513 14:28:11.615836 100931 memcache.go:265] couldn't get current server API group list: Get
"http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0513 14:28:11.616331 100931 memcache.go:265] couldn't get current server API group list: Get
"http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0513 14:28:11.617955 100931 memcache.go:265] couldn't get current server API group list: Get
"http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?
[opc@kubernetes-cluster ~]$
https://kubernetes.io/docs/concepts/workloads/pods/
cat pod.yml
docker@minikube:~$ exit
logout
ssh: Process exited with status 130
[opc@kubernetes-cluster ~]$ kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED
NODE READINESS GATES
nginx 1/1 Running 0 4m49s 10.244.0.4 minikube <none>
<none>
[opc@kubernetes-cluster ~]$
Describe pod
Deployment
in a duplicate session
[opc@kubernetes-cluster ~]$ kubectl get pods -w
Now services.
It basically acts as an LB and the backend set which has the Ips, those are
being managed as labels/selectors(just like hostnames in Linux).
There are various ways on how external users can connect to Kubernetes
deployment.
Loadbalancer mode-external users from public can connect.
Nodeport mode- users who have access to VCNs/VPCs can connect to
Kubernetes application.
Workflow
Deployment>POD>Service>Load balancing or exposing it
[opc@kubernetes-cluster ~]$
[opc@kubernetes-cluster ~]$ kubectl get all
NAME READY STATUS RESTARTS AGE
pod/nginx-deployment-77d8468669-tp9t4 1/1 Running 1 (27h ago) 27h
pod/nginx-deployment-77d8468669-xzd7v 1/1 Running 1 (27h ago) 27h
As of now zero
[opc@kubernetes-cluster ~]$ kubectl get deploy
No resources found in default namespace.
[opc@kubernetes-cluster ~]$ kubectl get pods
No resources found in default namespace.
[opc@kubernetes-cluster ~]$
Ingress controller is the commercial one Load balancer which has features
such as sticky sessions, path based routing.
Ingress controller>>ingress