June 2019
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

Categories

June 2019
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

How to create a TCP listener or open ports in unix os

You can create a port listener using Netcat .

yum install nc -y

root@rmohan:~# nc -l 5000 you can also check if port is open or not using netstat command .

root@vm-rmohan:~# netstat -tulpen | grep nc tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN 0 710327 17533/nc you can also check with nc :

[…]

INSTALLING KUBERNETES ON CENTOS7

[RUN ALL BELOW COMMADS on ALL NODES]

yum update yum install -y epel-release

yum install docker [v1.11 or 1.12 or 1.13]

setup kubernates respos

kubeadm kubectl kubelet

[root@kubmaster yum.repos.d]

# cat 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

setenforce 0

yum install -y kubelet kubeadm kubectl

Add host entry […]

k8s ansible install

Ansible role to setup 1 master +2 node kubernetes cluster (more nodes can be added)

setup centos VMs configure hostnames Update hosts file template in ../roles/kubernetes-deploy/files/hosts.template with host names and ipaddress setup password less auth between your Ansible host and Kubernetes nodes

$ ssh-copyid root@kube-nodes?

setup Ansible inventory

kube-master.rmohan.com hostrole=master kube-node1.rmohan.com hostrole=node kube-node2.rmohan.com […]

Get YAML for deployed Kubernetes

ombining other answers, this is what I came up with for bash:

for n in $(kubectl get -o=name pvc,configmap,serviceaccount,secret,ingress,service,deployment,statefulset,hpa,job,cronjob) do mkdir -p $(dirname $n) kubectl get -o=yaml –export $n > $n.yaml done kubectl get all –export=true -o yaml !/bin/env bash i=$((0)) for n in $(kubectl get -o=custom-columns=NAMESPACE:.metadata.namespace,KIND:.kind,NAME:.metadata.name pv,pvc,configmap,ingress,service,secret,deployment,statefulset,hpa,job,cronjob –all-namespaces | grep -v ‘secrets/default-token’) do […]