April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Deploying or upgrading Kubernetes

In this model, we deploy new changes to multiple services simultaneously. This approach is easy to implement. But since all the services are upgraded at the same time, it is hard to manage and test dependencies. It’s also hard to rollback safely.

With blue-green deployment, we have two identical environments: one is staging (blue) […]

How Kubernetes works

How Kubernetes works

Reference link How Kubernetes works | Cloud Native Computing Foundation (cncf.io)

Enter Kubernetes, a container orchestration system – a way to manage the lifecycle of containerized applications across an entire fleet. It’s a sort of meta-process that grants the ability to automate the deployment and scaling of several containers at […]

Installing Kubernetes 1.8.1 on centos 7 with flannel

Prerequisites:-

You should have at least two VMs (1 master and 1 slave) with you before creating cluster in order to test full functionality of k8s.

1] Master :-

Minimum of 1 Gb RAM, 1 CPU core and 50 Gb HDD ( suggested )

2] Slave :-

Minimum of 1 Gb RAM, 1 CPU […]

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 […]

Kubernetes install centos7

Kubeadm quickly builds a k8s cluster

surroundings

Master01: 192.168.1.110 (minimum 2 core CPU)

node01: 192.168.1.100

planning

Services network: 10.96.0.0/12

Pod network: 10.244.0.0/16

Configure hosts to resolve each host

vim /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.110 master01 192.168.1.100 node01

Synchronize each host time

yum install -y ntpdate ntpdate time.windows.com

[…]

kubernetes

two lines info my /etc/sysctl.conf

net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1

sysctl net.bridge.bridge-nf-call-iptables=1 swapoff -a firewall-cmd –reload modprobe br_netfilter echo ‘1’ > /proc/sys/net/bridge/bridge-nf-call-iptables

kubeadm reset

echo ‘Environment=”KUBELET_EXTRA_ARGS=–fail-swap-on=false”‘ >> /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

systemctl daemon-reload systemctl restart kubelet

kubeadm init

[root@k8s-master ~]# mkdir -p $HOME/.kube [root@k8s-master ~]# cp -i /etc/kubernetes/admin.conf $HOME/.kube/config [root@k8s-master ~]# chown $(id -u):$(id -g) $HOME/.kube/config

Step […]

Kubernetes basic concepts study notes

Kubernetes (often called K8s) is an open source system for automatically deploying, extending, and managing containerized applications, and is an “open source version” of Google’s internal tools, Borg.

Kubernetes is currently recognized as the most advanced container cluster management tool. After the release of version 1.0, Kubernetes has been developing at a faster speed and […]