#2267
[How-To] Kubernetes
Install KubeCtl on windows : https://kubernetes.io/fr/docs/tasks/tools/install-kubectl/
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/windows/amd64/kubectl.exe
Install KubeCtl on CentOS/RHEL
cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOF yum install -y kubectl
Define config file :
export KUBECONFIG=/path/to/kubectl.cfg
Create a deployment:
kubectl create deployment hello-node --image=tutum/hello-world
Create a service to expose the deployment :
kubectl expose deployment hello-node --type=LoadBalancer --port 80 --name=hello-node-lb
Get service info (and LoadBalancer port) :
kubectl get services -o wide
Scale deployment
kubectl scale deployment DEPLOYMENT_NAME --replicas=1
Delete deployment(s)
kubectl delete deployments DEPLOYMENT_NAME
kubectl delete deployments -n NAMESPACE DEPLOYMENT_NAME
kubectl delete deployments -n NAMESPACE --all
Describe deployment(s)
kubectl describe deployments -n NAMESPACE DEPLOYMENT_NAME
Add private repo to container.d:
edit /etc/containerd/config.toml
[plugins] [plugins."io.containerd.grpc.v1.cri"] sandbox_image = "registry.k8s.io/pause:3.6" max_container_log_line_size = -1 [plugins."io.containerd.grpc.v1.cri".containerd] default_runtime_name = "runc" snapshotter = "overlayfs" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] runtime_type = "io.containerd.runc.v2" runtime_engine = "" runtime_root = "" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] systemdCgroup = true [plugins."io.containerd.grpc.v1.cri".registry] config_path = "" [plugins."io.containerd.grpc.v1.cri".registry.auths] [plugins."io.containerd.grpc.v1.cri".registry.configs] [plugins."io.containerd.grpc.v1.cri".registry.configs."MY_HTTPS_IP:MY_PORT".tls] insecure_skip_verify = true [plugins."io.containerd.grpc.v1.cri".registry.headers] [plugins."io.containerd.grpc.v1.cri".registry.mirrors] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."MY_HTTPS_IP:MY_PORT"] endpoint = ["https://MY_HTTPS_IP:MY_PORT"]
Restart container.d
systemctl restart containerd
Test a pull using crictl
crictl --debug pull MY_HTTPS_IP:MY_PORT/MY_IMAGE:latest
[How-To] ELK WebLogic & Docker
HellowWorl with k8s : https://kubernetes.io/fr/docs/tutorials/hello-minikube/
Kubernetes tutorial : https://kubernetes.io/docs/tutorials/kubernetes-basics
https://docker.djal.al/kube-fullday-fr.html#1
Kubernetes Dashboard :
https://github.com/kubernetes/dashboard
Go To :
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
Oracle WebLogic Server Kubernetes Operator Tutorial
https://github.com/oracle/weblogic-kubernetes-operator/blob/master/kubernetes/hands-on-lab/README.md
check k8s logs/events ordered by timestamps:
Install Nginx Ingress controller:
https://kubernetes.github.io/ingress-nginx/deploy/
Comparison of Kubernetes Ingress controllers:
https://docs.google.com/spreadsheets/d/191WWNpjJ2za6-nbG4ZoUMXMpUK8KlCIosvQB0f-oq3k/edit#gid=907731238
Install Octant as Dashboad UI: https://cloudificationzone.com/2020/05/27/setup-k8s-dashboard-ui/
Restart K8S node:
https://stackoverflow.com/questions/33671449/how-to-restart-kubernetes-nodes
Container.d containerd
Add internet proxy :
https://github.com/kubernetes-sigs/kind/issues/688#issuecomment-508782438
Remove a namespace “stuck” in “Terminating”
https://stackoverflow.com/questions/52369247/namespace-stuck-as-terminating-how-i-removed-it
Extract job logs:
create namespace: