From 060ea173544a86e119d2521930ace265fd603ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Fernandes?= Date: Sat, 19 Sep 2026 22:54:19 +0000 Subject: [PATCH] modified: README.md --- README.md | 189 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 114 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index dc155ca..859b1f1 100644 --- a/README.md +++ b/README.md @@ -2,80 +2,83 @@ Kubernetes is an open‑source platform that automates the deployment, scaling, and management of containerized applications. It acts as an orchestrator, ensuring your containers run reliably across clusters of machines, handling networking, storage, and updates without downtime. -- [Namespaces](#namespaces) - - [Create namespace](#create-namespace) - - [namespace stuck on delete](#namespace-stuck-on-delete) -- [Pods](#pods) - - [Create an pod](#create-an-pod) - - [Get Pod](#get-pod) - - [delete Pod](#delete-pod) - - [delete all Failed pods](#delete-all-failed-pods) - - [delete all pods with prefix](#delete-all-pods-with-prefix) - - [OOMKilled](#oomkilled) - - [Attach to an pod](#attach-to-an-pod) - - [Run command on pod](#run-command-on-pod) - - [Container TTY](#container-tty) -- [Persistent volumes](#persistent-volumes) - - [create PersistentVolumes - host path](#create-persistentvolumes---host-path) - - [find persistent volume used pvc](#find-persistent-volume-used-pvc) - - [Patch pv - change to retain policy](#patch-pv---change-to-retain-policy) - - [Patch pv - remove finalizers](#patch-pv---remove-finalizers) - - [check orphans](#check-orphans) - - [persistent volume claims](#persistent-volume-claims) - - [Create an pod with PVC](#create-an-pod-with-pvc) -- [kubectl](#kubectl) - - [Helper pods](#helper-pods) - - [network testing](#network-testing) - - [Resources](#resources) - - [Services Accounts](#services-accounts) -- [Secrets](#secrets) - - [Manifest - Opaque / Base64](#manifest---opaque--base64) - - [Manifest - StringData](#manifest---stringdata) - - [Inline with heredoc and environment variables](#inline-with-heredoc-and-environment-variables) - - [substr](#substr) -- [annotations](#annotations) -- [nodes](#nodes) -- [taints](#taints) - - [add taint](#add-taint) - - [remove taint](#remove-taint) - - [control plane - NoSchedule](#control-plane---noschedule) - - [Official \*.kubernetes.io taints](#official-kubernetesio-taints) - - [cordon](#cordon) -- [statefulset](#statefulset) - - [statefulset - Set Replicas](#statefulset---set-replicas) -- [Deployment](#deployment) - - [Deployment - Set Replicas](#deployment---set-replicas) - - [Deployment - rollout restart](#deployment---rollout-restart) -- [Daemonset](#daemonset) - - [Daemonset - rollout restart](#daemonset---rollout-restart) -- [services](#services) -- [certs](#certs) - - [list all certs](#list-all-certs) - - [get cert end date](#get-cert-end-date) -- [service accounts](#service-accounts) -- [Services DNS Name](#services-dns-name) -- [core-dns](#core-dns) - - [Overrides](#overrides) - - [Remove warning from logs](#remove-warning-from-logs) -- [Custom Resource Definitions](#custom-resource-definitions) -- [k3s](#k3s) - - [Install / Setup](#install--setup) - - [prune old images](#prune-old-images) - - [kill all](#kill-all) - - [Prune ephemeral containerd data](#prune-ephemeral-containerd-data) - - [check system logs](#check-system-logs) - - [Workarounds \& Fixes](#workarounds--fixes) - - [Failed unmounting var-lib-rancher.mount on reboot](#failed-unmounting-var-lib-ranchermount-on-reboot) - - [klipper-lb](#klipper-lb) - - [troubleshooting](#troubleshooting) - - [Containerd state](#containerd-state) -- [host cli](#host-cli) - - [host cli - check port usage](#host-cli---check-port-usage) - - [kill all connections](#kill-all-connections) -- [cert-manager](#cert-manager) - - [Removing cert‑manager Metadata from Secrets](#removing-certmanager-metadata-from-secrets) -- [hosting](#hosting) - - [misc](#misc) +- [kubernetes](#kubernetes) + - [Namespaces](#namespaces) + - [Create namespace](#create-namespace) + - [namespace stuck on delete](#namespace-stuck-on-delete) + - [Pods](#pods) + - [Create an pod](#create-an-pod) + - [Get Pod](#get-pod) + - [delete Pod](#delete-pod) + - [delete all Failed pods](#delete-all-failed-pods) + - [delete all pods with prefix](#delete-all-pods-with-prefix) + - [OOMKilled](#oomkilled) + - [Attach to an pod](#attach-to-an-pod) + - [Run command on pod](#run-command-on-pod) + - [Keep pod Alive](#keep-pod-alive) + - [Persistent volumes](#persistent-volumes) + - [create PersistentVolumes - host path](#create-persistentvolumes---host-path) + - [find persistent volume used pvc](#find-persistent-volume-used-pvc) + - [Patch pv - change to retain policy](#patch-pv---change-to-retain-policy) + - [Patch pv - remove finalizers](#patch-pv---remove-finalizers) + - [check orphans](#check-orphans) + - [persistent volume claims](#persistent-volume-claims) + - [Create an pod with PVC](#create-an-pod-with-pvc) + - [kubectl](#kubectl) + - [Helper pods](#helper-pods) + - [network testing](#network-testing) + - [Resources](#resources) + - [Services Accounts](#services-accounts) + - [configMap](#configmap) + - [Secrets](#secrets) + - [Manifest - Opaque / Base64](#manifest---opaque--base64) + - [Manifest - StringData](#manifest---stringdata) + - [Inline with heredoc and environment variables](#inline-with-heredoc-and-environment-variables) + - [substr](#substr) + - [mounting](#mounting) + - [annotations](#annotations) + - [nodes](#nodes) + - [taints](#taints) + - [add taint](#add-taint) + - [remove taint](#remove-taint) + - [control plane - NoSchedule](#control-plane---noschedule) + - [Official \*.kubernetes.io taints](#official-kubernetesio-taints) + - [cordon](#cordon) + - [statefulset](#statefulset) + - [statefulset - Set Replicas](#statefulset---set-replicas) + - [Deployment](#deployment) + - [Deployment - Set Replicas](#deployment---set-replicas) + - [Deployment - rollout restart](#deployment---rollout-restart) + - [Daemonset](#daemonset) + - [Daemonset - rollout restart](#daemonset---rollout-restart) + - [services](#services) + - [certs](#certs) + - [list all certs](#list-all-certs) + - [get cert end date](#get-cert-end-date) + - [service accounts](#service-accounts) + - [Services DNS Name](#services-dns-name) + - [core-dns](#core-dns) + - [Overrides](#overrides) + - [Remove warning from logs](#remove-warning-from-logs) + - [Custom Resource Definitions](#custom-resource-definitions) + - [k3s](#k3s) + - [Install / Setup](#install--setup) + - [prune old images](#prune-old-images) + - [kill all](#kill-all) + - [Prune ephemeral containerd data](#prune-ephemeral-containerd-data) + - [check system logs](#check-system-logs) + - [Workarounds \& Fixes](#workarounds--fixes) + - [Failed unmounting var-lib-rancher.mount on reboot](#failed-unmounting-var-lib-ranchermount-on-reboot) + - [klipper-lb](#klipper-lb) + - [troubleshooting](#troubleshooting) + - [Containerd state](#containerd-state) + - [host cli](#host-cli) + - [host cli - check port usage](#host-cli---check-port-usage) + - [kill all connections](#kill-all-connections) + - [cert-manager](#cert-manager) + - [Removing cert‑manager Metadata from Secrets](#removing-certmanager-metadata-from-secrets) + - [hosting](#hosting) + - [misc](#misc) ## Namespaces @@ -336,7 +339,11 @@ POD_NAME=$(kubectl get pod -l app=$MY_APP_NAME -n $NAMESPACE -o jsonpath='{.item kubectl exec -n $NAMESPACE -it ${POD_NAME} -- sh ``` -### Container TTY +### Keep pod Alive + +```yaml +command: ["tail", "-f", "/dev/null"] +``` ```yaml ... @@ -582,6 +589,20 @@ kubectl get secret -o jsonpath='{.data.token}' | base64 -d > ./ser kubectl config view --raw -o jsonpath='{.clusters[0].cluster.certificate-authority-data}' ``` +## configMap + +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: my-config +data: + app.conf: | + key=value + nested/file.txt: | + hello +``` + ## Secrets ### Manifest - Opaque / Base64 @@ -659,6 +680,24 @@ envsubst < ./secret.yaml | kubectl apply -f - ``` +### mounting + +``` yaml + + volumeMounts: + - name: secret-name + mountPath: /secret + subPath: mySecret + +volumes: + - name: secret-name + secret: + secretName: secret-name + # required if secret is ah ssh identity + # defaultMode: 0400 + +``` + ## annotations ``` bash