diff --git a/dockerfiles/tomcat-eg/Dockerfile1 b/dockerfiles/tomcat-eg/Dockerfile1 new file mode 100644 index 0000000..f0fa9be --- /dev/null +++ b/dockerfiles/tomcat-eg/Dockerfile1 @@ -0,0 +1,6 @@ +FROM tomcat +RUN apt-get update && apt-get -y upgrade +WORKDIR /usr/local/tomcat +COPY tomcat-users.xml /usr/local/tomcat/conf/tomcat-users.xml +COPY context.xml /usr/local/tomcat/webapps/manager/META-INF/context.xml +EXPOSE 8080 diff --git a/dockerfiles/tomcat-eg/Dockerfile2 b/dockerfiles/tomcat-eg/Dockerfile2 new file mode 100644 index 0000000..d0a9360 --- /dev/null +++ b/dockerfiles/tomcat-eg/Dockerfile2 @@ -0,0 +1,5 @@ +FROM tomcat +RUN apt-get update && apt-get -y upgrade +WORKDIR /usr/local/tomcat +COPY ../target/HelloWorld-0.0.1-SNAPSHOT.war /usr/local/tomcat/webapps/ +EXPOSE 8080 diff --git a/dockerfiles/tomcat-eg/context.xml b/dockerfiles/tomcat-eg/context.xml new file mode 100644 index 0000000..e0e6873 --- /dev/null +++ b/dockerfiles/tomcat-eg/context.xml @@ -0,0 +1,5 @@ + + + + diff --git a/dockerfiles/tomcat-eg/tomcat-users.xml b/dockerfiles/tomcat-eg/tomcat-users.xml new file mode 100644 index 0000000..9f68319 --- /dev/null +++ b/dockerfiles/tomcat-eg/tomcat-users.xml @@ -0,0 +1,6 @@ + + + diff --git a/kmaster/KubernetesUbuntuInstallation.txt b/kmaster/KubernetesUbuntuInstallation.txt index e03c688..fb8b2e0 100644 --- a/kmaster/KubernetesUbuntuInstallation.txt +++ b/kmaster/KubernetesUbuntuInstallation.txt @@ -1,5 +1,8 @@ Get amazon linux 20.04 + +sudo su + hostnamectl set-hostname kmaster hostnamectl set-hostname kworker @@ -71,9 +74,22 @@ systemctl enable kubelet kubeadm init + +mkdir -p $HOME/.kube +sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config +sudo chown $(id -u):$(id -g) $HOME/.kube/config +exit +mkdir -p $HOME/.kube +sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config +sudo chown $(id -u):$(id -g) $HOME/.kube/config + +copy the join command and execute it on the worker node. + should be done in 24 hours. + watch -n 1 kubectl get nodes + Status: NotReady watch -n 1 kubectl get po -n kube-system kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s.yaml watch -n 1 kubectl get po -n kube-system diff --git a/yaml/etcdbackup/Notes.txt b/yaml/etcdbackup/Notes.txt index e9c323f..a4ede60 100644 --- a/yaml/etcdbackup/Notes.txt +++ b/yaml/etcdbackup/Notes.txt @@ -8,6 +8,7 @@ Instead copy it from the running container. sample commands used during backup/restore/update of nodes apt install etcd-client #This can get you trouble. if the version is not latest it will fail + etcdctl --version docker ps - get etcd container sudo docker cp etcd:/usr/local/bin/etcdctl /usr/local/bin diff --git a/yaml/troubleshooting/Notes.txt b/yaml/troubleshooting/Notes.txt index 09a7f95..8bfbec8 100644 --- a/yaml/troubleshooting/Notes.txt +++ b/yaml/troubleshooting/Notes.txt @@ -50,17 +50,79 @@ Control plane failures abhinava_s@yahoo.com Application debugging - 1. Application environment name can + 1. Application environment variable's name can mis match with database service name. mis match with dtabase port + 2. service lable can mismatch with pod's labels + service port can mismatch with target port + + 3. Front end port number mismatch with NodePort + 4. Confirm the environment variable defn. + e.g. db pwd is wrong than what is mentioned in quesstion + Important point: + k describe svc + is the endpoint reported. + +Troubleshooting Control Plane +----------------------------- +Some of the pods can be failing + Is the Node ready? + Describe the pod/deployment/replicaset + + Everything good - but still nothing is happening + Check control plane. + kubectl get pod -n kube-system + If any of the below is not working + scheduler + controller + etcd + api-server + for this you would get a diff. error. + + Check static pods + /etc/kubernetes/manifests/ + + ports where services listen + api-server: 6443 + etcd: + 2379: client communication + 2380: peer communication + controller: 10250 + scheduler: 10251 + +Troubleshoot worker node failures +---------------------------------- + + Worker node not ready. + kubectl describe node + kubectl get pod -n kube-system + check + proxy + network plugin + systemctl status kubelet + systemctl restart kubelet + journalctl -u kubelet + kubelet config files + /etc/kubernetes/kubelet.config + /var/lib/kubelet/config.yml Network Troubleshooting Network Plugin in kubernetes -------------------- + + -Kubernetes uses CNI plugins to setup network. The kubelet is responsible for executing plugins as we mention the following parameters in kubelet configuration. +References: + Debug Service issues: + https://kubernetes.io/docs/tasks/debug-application-cluster/debug-service/ + +DNS Troubleshooting: + https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ + +Kubernetes uses CNI plugins to setup network. +The kubelet is responsible for executing plugins as we mention the following parameters in kubelet configuration. - cni-bin-dir: Kubelet probes this directory for plugins on startup @@ -145,15 +207,10 @@ In large scale Kubernetes clusters, CoreDNS's memory usage is predominantly affe Kubernetes resources for coreDNS are: a service account named coredns, - cluster-roles named coredns and kube-dns - clusterrolebindings named coredns and kube-dns, - a deployment named coredns, - a configmap named coredns and a - service named kube-dns. diff --git a/yaml/volumes/nfs/NFSWithKubernetes.txt b/yaml/volumes/nfs/NFSWithKubernetes.txt index ad2479b..8e467ee 100644 --- a/yaml/volumes/nfs/NFSWithKubernetes.txt +++ b/yaml/volumes/nfs/NFSWithKubernetes.txt @@ -1,5 +1,17 @@ Install nfs server on ubuntu as mentioned in "NFSSetupNotes.txt" +On kubernetes worker node (if ubuntu) +------------------------------------- +apt update -y +sudo apt install nfs-common + + + +Rest all on kubernetes master node +---------------------------------- + + + Install kubernetes Install helm