kubernetes_install_debian
Differences
This shows you the differences between two versions of the page.
| kubernetes_install_debian [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadm | kubernetes_install_debian [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Instalação Kubernetes ====== | ||
| - | ==== Preparando o Sistema Operacional ==== | ||
| - | [[initial_config_deb|Configuração inicial]] | ||
| - | |||
| - | ===== Cenário ===== | ||
| - | ^Hostname^IPv4^IPv6^Data Center^ESXI^VLAN^ | ||
| - | |kube-ctrl-pl-1.juntotelecom.com.br|177.75.176.40|2804: | ||
| - | |kube-worker-01.juntotelecom.com.br|177.75.176.41|2804: | ||
| - | |kube-worker-02.juntotelecom.com.br|177.75.176.42|2804: | ||
| - | |||
| - | * **Rede nodes:** 177.75.176.32/ | ||
| - | * **Rede pods:** 10.244.0.0/ | ||
| - | * **Rede services:** 10.96.0.0/ | ||
| - | |||
| - | === Partição adicional === | ||
| - | * **/ | ||
| - | |||
| - | <code bash> | ||
| - | $ cat <<EOF | sudo tee -a /etc/hosts | ||
| - | 177.75.176.40 kube-ctrl-pl-01.juntotelecom.com.br kube-ctrl-pl-01 | ||
| - | 177.75.176.41 kube-worker-01.juntotelecom.com.br kube-worker-01 | ||
| - | 177.75.176.42 kube-worker-02.juntotelecom.com.br kube-worker-02 | ||
| - | 2804: | ||
| - | 2804: | ||
| - | 2804: | ||
| - | EOF | ||
| - | </ | ||
| - | |||
| - | Executar no control plane | ||
| - | <code bash> | ||
| - | $ sudo hostnamectl set-hostname kube-ctrl-pl.juntotelecom.com.br | ||
| - | </ | ||
| - | |||
| - | Executar no worker 01 | ||
| - | <code bash> | ||
| - | $ sudo hostnamectl set-hostname kube-worker-01.juntotelecom.com.br | ||
| - | </ | ||
| - | |||
| - | Executar no worker 02 | ||
| - | <code bash> | ||
| - | $ sudo hostnamectl set-hostname kube-worker-02.juntotelecom.com.br | ||
| - | </ | ||
| - | |||
| - | ===== Disco adicional ===== | ||
| - | FIXME Disco reservado para o pods - containers. | ||
| - | |||
| - | === Em ambos os servidores === | ||
| - | <code bash> | ||
| - | $ MOUNT_POINT=/ | ||
| - | $ DISK_DEVICE=/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ echo -e " | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo mkfs.ext4 ${DISK_DEVICE}1 | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ UUID=`sudo blkid -o export ${DISK_DEVICE}1 | grep UUID | grep -v PARTUUID` | ||
| - | $ sudo mkdir ${MOUNT_POINT} | ||
| - | $ sudo cp -p / | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ echo " | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo mount ${MOUNT_POINT} | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ df -hT | grep containers | ||
| - | </ | ||
| - | |||
| - | ===== Instalando o CRI-O ===== | ||
| - | Nessa instalação o CRI-O será usado como Container Runtime. | ||
| - | |||
| - | FIXME A partir da versão 1.23 do Kubernetes, o Docker não será mais compatível. | ||
| - | |||
| - | <code bash> | ||
| - | $ cat <<EOF | sudo tee / | ||
| - | overlay | ||
| - | br_netfilter | ||
| - | EOF | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo modprobe overlay | ||
| - | $ sudo modprobe br_netfilter | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ lsmod | grep br_netfilter | ||
| - | br_netfilter | ||
| - | bridge | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ lsmod | grep overlay | ||
| - | overlay | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | cat <<EOF | sudo tee / | ||
| - | net.ipv4.conf.all.forwarding | ||
| - | net.ipv6.conf.all.forwarding | ||
| - | net.bridge.bridge-nf-call-iptables | ||
| - | net.bridge.bridge-nf-call-ip6tables | ||
| - | EOF | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo sysctl --system | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ OS=Debian_11 | ||
| - | $ VERSION=1.23 | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ cat <<EOF | sudo tee / | ||
| - | deb https:// | ||
| - | EOF | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ cat <<EOF | sudo tee / | ||
| - | deb http:// | ||
| - | EOF | ||
| - | </ | ||
| - | |||
| - | <code bashs> | ||
| - | $ curl -L https:// | ||
| - | % Total % Received % Xferd Average Speed | ||
| - | | ||
| - | 0 | ||
| - | 100 | ||
| - | 100 | ||
| - | 100 | ||
| - | 100 | ||
| - | 100 | ||
| - | 100 1093 100 1093 0 | ||
| - | OK | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ curl -L https:// | ||
| - | % Total % Received % Xferd Average Speed | ||
| - | | ||
| - | 0 | ||
| - | 100 1093 100 1093 0 | ||
| - | OK | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo apt update | ||
| - | $ sudo apt install cri-o cri-o-runc | ||
| - | </ | ||
| - | |||
| - | ===== Instalando o Kubernets ===== | ||
| - | <code bashs> | ||
| - | $ sudo swapoff -a | ||
| - | $ sudo cp -fp / | ||
| - | $ sudo sed -i '/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | sudo curl -fsSLo / | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | echo "deb [signed-by=/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo apt update | ||
| - | $ sudo apt install kubelet kubeadm kubectl | ||
| - | $ sudo apt-mark hold kubelet kubeadm kubectl | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo systemctl daemon-reload | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo systemctl enable crio --now | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo systemctl status crio | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo systemctl enable kubelet --now | ||
| - | </ | ||
| - | |||
| - | ===== Configurando o Kubernets ===== | ||
| - | Executar no master - Control Plane. | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo kubeadm config images pull | ||
| - | [config/ | ||
| - | [config/ | ||
| - | [config/ | ||
| - | [config/ | ||
| - | [config/ | ||
| - | [config/ | ||
| - | [config/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ mkdir -p yamls/ | ||
| - | $ cd yamls/ | ||
| - | </ | ||
| - | |||
| - | <code yaml kubeadm-config.yaml> | ||
| - | # vim kubeadm-config.yaml | ||
| - | --- | ||
| - | apiVersion: kubeadm.k8s.io/ | ||
| - | kind: ClusterConfiguration | ||
| - | networking: | ||
| - | podSubnet: 10.244.0.0/ | ||
| - | serviceSubnet: | ||
| - | --- | ||
| - | apiVersion: kubeadm.k8s.io/ | ||
| - | kind: InitConfiguration | ||
| - | localAPIEndpoint: | ||
| - | advertiseAddress: | ||
| - | bindPort: 6443 | ||
| - | nodeRegistration: | ||
| - | kubeletExtraArgs: | ||
| - | node-ip: 177.75.176.40, | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ sudo kubeadm init --config=kubeadm-config.yaml | ||
| - | [init] Using Kubernetes version: v1.24.0 | ||
| - | [preflight] Running pre-flight checks | ||
| - | [WARNING SystemVerification]: | ||
| - | [preflight] Pulling images required for setting up a Kubernetes cluster | ||
| - | [preflight] This might take a minute or two, depending on the speed of your internet connection | ||
| - | [preflight] You can also perform this action in beforehand using ' | ||
| - | [certs] Using certificateDir folder "/ | ||
| - | [certs] Generating " | ||
| - | [certs] Generating " | ||
| - | [certs] apiserver serving cert is signed for DNS names [kube-ctrl-pl-01.juntotelecom.com.br kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 177.75.176.40] | ||
| - | [certs] Generating " | ||
| - | [certs] Generating " | ||
| - | [certs] Generating " | ||
| - | [certs] Generating " | ||
| - | [certs] Generating " | ||
| - | [certs] etcd/server serving cert is signed for DNS names [kube-ctrl-pl-01.juntotelecom.com.br localhost] and IPs [177.75.176.40 127.0.0.1 ::1] | ||
| - | [certs] Generating " | ||
| - | [certs] etcd/peer serving cert is signed for DNS names [kube-ctrl-pl-01.juntotelecom.com.br localhost] and IPs [177.75.176.40 127.0.0.1 ::1] | ||
| - | [certs] Generating " | ||
| - | [certs] Generating " | ||
| - | [certs] Generating " | ||
| - | [kubeconfig] Using kubeconfig folder "/ | ||
| - | [kubeconfig] Writing " | ||
| - | [kubeconfig] Writing " | ||
| - | [kubeconfig] Writing " | ||
| - | [kubeconfig] Writing " | ||
| - | [kubelet-start] Writing kubelet environment file with flags to file "/ | ||
| - | [kubelet-start] Writing kubelet configuration to file "/ | ||
| - | [kubelet-start] Starting the kubelet | ||
| - | [control-plane] Using manifest folder "/ | ||
| - | [control-plane] Creating static Pod manifest for " | ||
| - | [control-plane] Creating static Pod manifest for " | ||
| - | [control-plane] Creating static Pod manifest for " | ||
| - | [etcd] Creating static Pod manifest for local etcd in "/ | ||
| - | [wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/ | ||
| - | [kubelet-check] Initial timeout of 40s passed. | ||
| - | [apiclient] All control plane components are healthy after 41.525710 seconds | ||
| - | [upload-config] Storing the configuration used in ConfigMap " | ||
| - | [kubelet] Creating a ConfigMap " | ||
| - | [upload-certs] Skipping phase. Please see --upload-certs | ||
| - | [mark-control-plane] Marking the node kube-ctrl-pl-01.juntotelecom.com.br as control-plane by adding the labels: [node-role.kubernetes.io/ | ||
| - | [mark-control-plane] Marking the node kube-ctrl-pl-01.juntotelecom.com.br as control-plane by adding the taints [node-role.kubernetes.io/ | ||
| - | [bootstrap-token] Using token: 9xtviv.hgg7hqw1v51l1bd4 | ||
| - | [bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles | ||
| - | [bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to get nodes | ||
| - | [bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials | ||
| - | [bootstrap-token] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token | ||
| - | [bootstrap-token] Configured RBAC rules to allow certificate rotation for all node client certificates in the cluster | ||
| - | [bootstrap-token] Creating the " | ||
| - | [kubelet-finalize] Updating "/ | ||
| - | [addons] Applied essential addon: CoreDNS | ||
| - | [addons] Applied essential addon: kube-proxy | ||
| - | |||
| - | Your Kubernetes control-plane has initialized successfully! | ||
| - | |||
| - | To start using your cluster, you need to run the following as a regular user: | ||
| - | |||
| - | mkdir -p $HOME/.kube | ||
| - | sudo cp -i / | ||
| - | sudo chown $(id -u):$(id -g) $HOME/ | ||
| - | |||
| - | Alternatively, | ||
| - | |||
| - | export KUBECONFIG=/ | ||
| - | |||
| - | You should now deploy a pod network to the cluster. | ||
| - | Run " | ||
| - | https:// | ||
| - | |||
| - | Then you can join any number of worker nodes by running the following on each as root: | ||
| - | |||
| - | kubeadm join 177.75.176.40: | ||
| - | --discovery-token-ca-cert-hash sha256: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ mkdir -p $HOME/.kube | ||
| - | $ sudo cp -i / | ||
| - | $ sudo chown $(id -u):$(id -g) $HOME/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl get pod --all-namespaces -o wide | ||
| - | NAMESPACE | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | </ | ||
| - | |||
| - | ===== Adicionando os workers - nodes ===== | ||
| - | <code bash> | ||
| - | $ sudo kubeadm join 177.75.176.40: | ||
| - | --discovery-token-ca-cert-hash sha256: | ||
| - | [preflight] Running pre-flight checks | ||
| - | [WARNING SystemVerification]: | ||
| - | [preflight] Reading configuration from the cluster... | ||
| - | [preflight] FYI: You can look at this config file with ' | ||
| - | [kubelet-start] Writing kubelet configuration to file "/ | ||
| - | [kubelet-start] Writing kubelet environment file with flags to file "/ | ||
| - | [kubelet-start] Starting the kubelet | ||
| - | [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... | ||
| - | |||
| - | This node has joined the cluster: | ||
| - | * Certificate signing request was sent to apiserver and a response was received. | ||
| - | * The Kubelet was informed of the new secure connection details. | ||
| - | |||
| - | Run ' | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl get nodes -o wide | ||
| - | NAME STATUS | ||
| - | kube-ctrl-pl-01.juntotelecom.com.br | ||
| - | kube-worker-01.juntotelecom.com.br | ||
| - | kube-worker-02.juntotelecom.com.br | ||
| - | </ | ||
| - | |||
| - | ===== Rede calico ===== | ||
| - | <code bash> | ||
| - | $ kubectl create -f https:// | ||
| - | namespace/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | customresourcedefinition.apiextensions.k8s.io/ | ||
| - | Warning: policy/ | ||
| - | podsecuritypolicy.policy/ | ||
| - | serviceaccount/ | ||
| - | clusterrole.rbac.authorization.k8s.io/ | ||
| - | clusterrolebinding.rbac.authorization.k8s.io/ | ||
| - | deployment.apps/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ curl -L https:// | ||
| - | % Total % Received % Xferd Average Speed | ||
| - | | ||
| - | 100 | ||
| - | </ | ||
| - | |||
| - | <file yaml custom-resources.yaml> | ||
| - | --- | ||
| - | # This section includes base Calico installation configuration. | ||
| - | # For more information, | ||
| - | apiVersion: operator.tigera.io/ | ||
| - | kind: Installation | ||
| - | metadata: | ||
| - | name: default | ||
| - | spec: | ||
| - | # Configures Calico networking. | ||
| - | calicoNetwork: | ||
| - | # Note: The ipPools section cannot be modified post-install. | ||
| - | ipPools: | ||
| - | - blockSize: 26 | ||
| - | cidr: 10.244.0.0/ | ||
| - | encapsulation: | ||
| - | natOutgoing: | ||
| - | nodeSelector: | ||
| - | - blockSize: 122 | ||
| - | cidr: fd00::/56 | ||
| - | encapsulation: | ||
| - | natOutgoing: | ||
| - | nodeSelector: | ||
| - | |||
| - | --- | ||
| - | |||
| - | # This section configures the Calico API server. | ||
| - | # For more information, | ||
| - | apiVersion: operator.tigera.io/ | ||
| - | kind: APIServer | ||
| - | metadata: | ||
| - | name: default | ||
| - | spec: {} | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl apply -f custom-resources.yaml | ||
| - | installation.operator.tigera.io/ | ||
| - | apiserver.operator.tigera.io/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl get pod --all-namespaces -o wide | ||
| - | NAMESPACE | ||
| - | calico-apiserver | ||
| - | calico-apiserver | ||
| - | calico-system | ||
| - | calico-system | ||
| - | calico-system | ||
| - | calico-system | ||
| - | calico-system | ||
| - | calico-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | tigera-operator | ||
| - | </ | ||
| - | |||
| - | FIXME após reiniciar o servidor o calico conseguiu atribuir os ips da configuração aos pods | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl get pod --all-namespaces -o wide | ||
| - | NAMESPACE | ||
| - | calico-apiserver | ||
| - | calico-apiserver | ||
| - | calico-system | ||
| - | calico-system | ||
| - | calico-system | ||
| - | calico-system | ||
| - | calico-system | ||
| - | calico-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | kube-system | ||
| - | tigera-operator | ||
| - | </ | ||
| - | ===== Serviços em dualstack ===== | ||
| - | <code bash> | ||
| - | $ kubectl get services --all-namespaces | ||
| - | NAMESPACE | ||
| - | calico-apiserver | ||
| - | calico-system | ||
| - | calico-system | ||
| - | default | ||
| - | kube-system | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service kubernetes | ||
| - | Name: kubernetes | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | | ||
| - | Annotations: | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.0.1 | ||
| - | IPs: | ||
| - | Port: https 443/TCP | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service kube-dns -n kube-system | ||
| - | Name: kube-dns | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | | ||
| - | | ||
| - | Annotations: | ||
| - | | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.0.10 | ||
| - | IPs: | ||
| - | Port: dns 53/UDP | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Port: dns-tcp | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Port: metrics | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service calico-typha -n calico-system | ||
| - | Name: calico-typha | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | Annotations: | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.88.251 | ||
| - | IPs: | ||
| - | Port: calico-typha | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service calico-kube-controllers-metrics -n calico-system | ||
| - | Name: calico-kube-controllers-metrics | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | Annotations: | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.96.246 | ||
| - | IPs: | ||
| - | Port: metrics-port | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service calico-api -n calico-apiserver | ||
| - | Name: calico-api | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | Annotations: | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.160.94 | ||
| - | IPs: | ||
| - | Port: apiserver | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | |||
| - | **Editar e adicionar: | ||
| - | <code bash> | ||
| - | ipFamilyPolicy: | ||
| - | ipFamilies: | ||
| - | - IPv6 | ||
| - | - IPv4 | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl edit service kubernetes | ||
| - | $ kubectl edit service kube-dns -n kube-system | ||
| - | $ kubectl edit service calico-api -n calico-apiserver | ||
| - | $ kubectl edit service calico-typha -n calico-system | ||
| - | $ kubectl edit service calico-kube-controllers-metrics -n calico-system | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service kubernetes | ||
| - | Name: kubernetes | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | | ||
| - | Annotations: | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.0.1 | ||
| - | IPs: | ||
| - | Port: https 443/TCP | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service kube-dns -n kube-system | ||
| - | Name: kube-dns | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | | ||
| - | | ||
| - | Annotations: | ||
| - | | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.0.10 | ||
| - | IPs: | ||
| - | Port: dns 53/UDP | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Port: dns-tcp | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Port: metrics | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service calico-api -n calico-apiserver | ||
| - | Name: calico-api | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | Annotations: | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.160.94 | ||
| - | IPs: | ||
| - | Port: apiserver | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service calico-typha -n calico-system | ||
| - | Name: calico-typha | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | Annotations: | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.88.251 | ||
| - | IPs: | ||
| - | Port: calico-typha | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl describe service calico-kube-controllers-metrics -n calico-system | ||
| - | Name: calico-kube-controllers-metrics | ||
| - | Namespace: | ||
| - | Labels: | ||
| - | Annotations: | ||
| - | Selector: | ||
| - | Type: ClusterIP | ||
| - | IP Family Policy: | ||
| - | IP Families: | ||
| - | IP: 10.96.96.246 | ||
| - | IPs: | ||
| - | Port: metrics-port | ||
| - | TargetPort: | ||
| - | Endpoints: | ||
| - | Session Affinity: | ||
| - | Events: | ||
| - | </ | ||
| - | ===== Teste de conectividade ===== | ||
| - | <code bash> | ||
| - | $ kubectl run multitool --image=praqma/ | ||
| - | pod/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl get pods -o wide | ||
| - | NAME READY | ||
| - | multitool | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl exec -it multitool -- bash | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | bash-5.1# nslookup kubernetes | ||
| - | Server: | ||
| - | Address: | ||
| - | |||
| - | Name: | ||
| - | Address: 10.96.0.1 | ||
| - | Name: | ||
| - | Address: fd00: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | bash-5.1# nslookup google.com | ||
| - | Server: | ||
| - | Address: | ||
| - | |||
| - | Non-authoritative answer: | ||
| - | Name: | ||
| - | Address: 142.251.132.238 | ||
| - | Name: | ||
| - | Address: 2800: | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ kubectl delete pod multitool | ||
| - | pod " | ||
| - | </ | ||
kubernetes_install_debian.1753560544.txt.gz · Last modified: by wikiadm
