{"id":151,"date":"2026-10-15T11:41:27","date_gmt":"2026-10-15T11:41:27","guid":{"rendered":"https:\/\/ping4support.com\/blog\/?p=151"},"modified":"2026-10-15T11:51:06","modified_gmt":"2026-10-15T11:51:06","slug":"is-your-kubernetes-cluster-really-safe","status":"publish","type":"post","link":"https:\/\/ping4support.com\/blog\/is-your-kubernetes-cluster-really-safe\/","title":{"rendered":"Is Your Kubernetes Cluster Really Safe?"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-theme-palette-3-color has-text-color has-link-color wp-elements-1 wp-block-paragraph\" style=\"border-style:none;border-width:0px\"><em>Five simple habits that keep a small problem from becoming a big one.<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Your Kubernetes cluster is probably running fine today. The real question is what happens if someone gets a foothold inside it. This guide walks through the habits that answer that question, in plain language, whether you are new to Kubernetes or have run it for years.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-2\">Think of your cluster as an apartment building<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Deploying an app on Kubernetes feels great. A few minutes later, everything is green and running. But a running cluster is not the same as a safe one. Out of the box, Kubernetes is built to be flexible, not locked down.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Picture an apartment building where every door is unlocked, every tenant holds a master key, and nobody has changed the locks in years. Nothing bad has happened yet, but you would not sleep well.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The five habits below fix exactly that: keys (RBAC), walls (Network Policies), house rules (Pod Security), safes (Secrets), and maintenance (upgrades).<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-3\">1. RBAC: decide who gets which key<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">RBAC (Role-Based Access Control) decides who can do what in your cluster. That &#8220;who&#8221; includes people, groups, and applications.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Why you will be glad you did it:<\/strong><\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>A stolen key opens fewer doors.<\/strong> If an account or token leaks, the attacker only gets what that account was allowed to do. A narrow account means a small incident. A <code>cluster-admin<\/code> account means the whole building.<\/li>\n\n\n\n<li><strong>It saves you from honest mistakes.<\/strong> Many outages come from a well-meaning person running the right command in the wrong namespace. Least privilege makes that mistake impossible.<\/li>\n\n\n\n<li><strong>You can answer the audit question.<\/strong> When permissions are written down and reviewed, &#8220;who can delete things in production?&#8221; has a real answer.<\/li>\n\n\n\n<li><strong>Apps are users too.<\/strong> Pods talk to the Kubernetes API through service accounts. If every app shares one powerful account, one weak app exposes everything.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Take a look at what you have today:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get roles,rolebindings -A\nkubectl get clusterroles,clusterrolebindings\nkubectl auth can-i get pods --all-namespaces<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Quick rules to live by:<\/strong><\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Give the least access that still gets the job done.<\/li>\n\n\n\n<li>Avoid <code>cluster-admin<\/code> unless you truly need it.<\/li>\n\n\n\n<li>Give each application its own service account.<\/li>\n\n\n\n<li>Review permissions regularly. Access piles up over time and rarely gets removed.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-4\">2. Network Policies: put walls between the rooms<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">By default, every Pod can talk to every other Pod. That is convenient, and it is also the apartment with no interior walls. Network Policies let you say exactly which Pods, namespaces, and outside endpoints may talk to each other.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One catch worth knowing first: they only work if your cluster&#8217;s networking plugin (CNI) supports them. Check this before you assume you are protected.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Why it matters:<\/strong><\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Attackers rarely stop at one room.<\/strong> They get a foothold, then move sideways. Network isolation keeps one compromised frontend Pod from reaching your database.<\/li>\n\n\n\n<li><strong>Your design becomes a rule.<\/strong> The frontend talks to the backend, and only the backend talks to the database. A policy makes the cluster enforce that.<\/li>\n\n\n\n<li><strong>Outbound traffic matters too.<\/strong> Limiting egress makes it harder for a compromised workload to reach the internet, download tools, or send data out.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">See what is in place:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get networkpolicies -A\nkubectl get pods -n kube-system<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The second command helps you spot which networking components are running.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Quick rules to live by:<\/strong><\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Restrict ingress and egress traffic you do not need.<\/li>\n\n\n\n<li>Allow only the application-to-database connections that are required.<\/li>\n\n\n\n<li>Keep frontend, backend, and database workloads separate.<\/li>\n\n\n\n<li>Test policies before enforcing them in production. A policy that is too strict can quietly break good traffic.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-5\">3. Pod Security: no need for a master toolbox<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Containers share the node&#8217;s kernel. A container running as root with extra powers has a much easier path to escape onto the host. Pod security settings take those extra powers away.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>What each setting buys you:<\/strong><\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run as non-root.<\/strong> Escaping to the host becomes far harder.<\/li>\n\n\n\n<li><strong>Drop all capabilities.<\/strong> Attackers love powers that most apps never use.<\/li>\n\n\n\n<li><strong>Block privilege escalation.<\/strong> A process cannot gain more rights than its parent.<\/li>\n\n\n\n<li><strong>Use the RuntimeDefault seccomp profile.<\/strong> It filters dangerous system calls with very little effort.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a solid starting point:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>securityContext:\n  runAsNonRoot: true\n  runAsUser: 10001\n  runAsGroup: 10001\n  allowPrivilegeEscalation: false\n  capabilities:\n    drop:\n      - ALL\n  seccompProfile:\n    type: RuntimeDefault<\/code><\/pre>\n\n\n\n<p class=\"has-theme-palette-3-color has-text-color has-link-color wp-elements-6 wp-block-paragraph\"><strong>A  warning:<\/strong> check that your container image and app actually work with this user and these filesystem permissions. An app that expects to write to a root-owned folder will crash when it runs as user 10001. Try it in staging, fix the file ownership in your image, then roll it out.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-7\">4. Secrets: do not leave the spare key under the doormat<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Passwords, API keys, and database credentials deserve special care. Here is why:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Code and images get copied everywhere.<\/strong> A secret baked into a repository or image lives in every clone, registry, and build cache, often forever.<\/li>\n\n\n\n<li><strong>Leaked credentials are the easiest way in.<\/strong> Attackers do not need an exploit if they can simply log in.<\/li>\n\n\n\n<li><strong>Kubernetes Secrets are not automatically safe.<\/strong> By default they are only base64-encoded, which is not encryption. Without access controls and encryption at rest, anyone who can read the API data can read them.<\/li>\n\n\n\n<li><strong>Rotation shortens the damage.<\/strong> A credential that changes regularly has a short useful life once stolen.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>What to do about it:<\/strong><\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Restrict who can read Kubernetes Secrets.<\/li>\n\n\n\n<li>Turn on encryption at rest for Kubernetes API data.<\/li>\n\n\n\n<li>Consider an external secrets manager, such as OpenBao, where it fits.<\/li>\n\n\n\n<li>Rotate credentials and audit who accessed them.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-8\">5. Upgrades: even great locks need maintenance<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Security policies protect you from what you configured. Upgrades protect you from what you did not know about.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Security fixes.<\/strong> New vulnerabilities are found all the time, and the fixes only reach supported versions.<\/li>\n\n\n\n<li><strong>Bug fixes.<\/strong> Many mysterious cluster problems are already solved in newer releases.<\/li>\n\n\n\n<li><strong>Supported features.<\/strong> Old versions eventually stop getting patches, and then you are exposed with no fix available.<\/li>\n\n\n\n<li><strong>Small steps beat giant leaps.<\/strong> Teams that upgrade regularly face small, manageable changes. Teams that wait years face a risky, painful jump.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Upgrades can also bring compatibility surprises, which is why they deserve a plan instead of a gamble.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-3-color has-text-color has-link-color wp-elements-9\">Before you start<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Take a snapshot of how things look right now. If something is already broken, you want to know before the upgrade, not blame it afterwards<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl version\nkubectl get nodes -o wide\nkubectl get pods -A\nkubectl get events -A --sort-by=.lastTimestamp<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Then go through this checklist:<\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Back up cluster state and persistent application data.<\/li>\n\n\n\n<li>Read the release notes and look for deprecated APIs.<\/li>\n\n\n\n<li>Check compatibility of your CNI, CSI, Helm charts, and workloads.<\/li>\n\n\n\n<li>Make sure you have enough CPU, memory, and disk space.<\/li>\n\n\n\n<li>Have a rollback or recovery plan ready.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-10\">The upgrade, step by step<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Pick your target version<\/strong> and confirm the supported upgrade path. Skipping versions is often not allowed.<\/li>\n\n\n\n<li><strong>Back up<\/strong> the cluster and its configuration. This is your safety net.<\/li>\n\n\n\n<li><strong>Upgrade the control plane<\/strong> following your distribution&#8217;s documentation.<\/li>\n\n\n\n<li><strong>Upgrade worker nodes one by one,<\/strong> so capacity stays available and workloads can move around.<\/li>\n\n\n\n<li><strong>Validate<\/strong> system components and your applications.<\/li>\n\n\n\n<li><strong>Review<\/strong> logs, resource usage, and network connectivity.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Running K3s?<\/strong> Follow the official K3s upgrade documentation and check the supported version-skew rules. Do not assume standard kubeadm upgrade commands apply to K3s. Using the wrong procedure is a classic way to break a healthy cluster.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-11\">Did it actually work? Check after every upgrade<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">An upgrade is not done when the command finishes. It is done when you have proved the cluster works.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get nodes\nkubectl get pods -A\nkubectl get networkpolicies -A\nkubectl get events -A --sort-by=.lastTimestamp<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Then confirm that:<\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li>All nodes are Ready.<\/li>\n\n\n\n<li>Critical Pods are Running or Completed, as expected.<\/li>\n\n\n\n<li>Network policies still allow the traffic you need. Upgrades can change networking behavior.<\/li>\n\n\n\n<li>RBAC permissions are still correct.<\/li>\n\n\n\n<li>Applications can reach their databases and other services.<\/li>\n\n\n\n<li>Monitoring and logging are working, so you can see the next problem coming.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-12\">Here the cheat sheet<\/h4>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><tbody><tr><th>Habit<\/th><th>In the building<\/th><th>Protects you from<\/th><\/tr><tr><td>RBAC<\/td><td>Who holds which key<\/td><td>Stolen or misused accounts doing too much<\/td><\/tr><tr><td>Network Policies<\/td><td>Walls between rooms<\/td><td>Attackers moving sideways<\/td><\/tr><tr><td>Pod Security<\/td><td>Then confirm that:All nodes are Ready.Critical Pods are Running or Completed, as expected.Network policies still allow the traffic you need. Upgrades can change networking behavior.RBAC permissions are still correct.Applications can reach their databases and other services.Monitoring and logging are working, so you can see the next problem coming.House rules for guests<\/td><td>Container escapes and privilege escalation<\/td><\/tr><tr><td>Regular Upgrades<\/td><td>Ongoing maintenance<\/td><td>Known vulnerabilities and unsupported software<\/td><\/tr><tr><td>Secrets Management<\/td><td>A real safe<\/td><td>Credential leaks<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">No single layer is perfect. Together, an attacker has to beat several independent defenses instead of just one.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-theme-palette-1-color has-text-color has-link-color wp-elements-13\">One last thing<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Security and upgrades are not a one-time project. They are a habit, like locking the door when you leave. Least-privilege access, network isolation, secure Pod settings, good secrets handling, and a tested upgrade process all add up to a calmer, more reliable cluster.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And the golden rule: <strong>always test security changes and version upgrades in staging before touching production.<\/strong> Staging is where mistakes are cheap. Production is where they are expensive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Five simple habits that keep a small problem from becoming a big one. Your Kubernetes cluster is probably running fine&#8230;<\/p>\n","protected":false},"author":1,"featured_media":152,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":"[]"},"categories":[20],"tags":[],"class_list":["post-151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-techncal-support"],"_links":{"self":[{"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":10,"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":165,"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions\/165"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/media\/152"}],"wp:attachment":[{"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ping4support.com\/blog\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}