Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vilasvarghese committed Mar 2, 2024
1 parent e9bd833 commit 2f3bad4
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 7 deletions.
6 changes: 6 additions & 0 deletions dockerfiles/tomcat-eg/Dockerfile1
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions dockerfiles/tomcat-eg/Dockerfile2
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions dockerfiles/tomcat-eg/context.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Context antiResourceLocking="false" privileged="true" >
<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> -->
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>
6 changes: 6 additions & 0 deletions dockerfiles/tomcat-eg/tomcat-users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<user username="admin" password="secret" roles="manager-gui"/>
</tomcat-users>
16 changes: 16 additions & 0 deletions kmaster/KubernetesUbuntuInstallation.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Get amazon linux 20.04


sudo su

hostnamectl set-hostname kmaster
hostnamectl set-hostname kworker

Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions yaml/etcdbackup/Notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
71 changes: 64 additions & 7 deletions yaml/troubleshooting/Notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,79 @@ Control plane failures
[email protected]

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 <name>
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 <name>
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

Expand Down Expand Up @@ -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.


Expand Down
12 changes: 12 additions & 0 deletions yaml/volumes/nfs/NFSWithKubernetes.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 2f3bad4

Please sign in to comment.