CKS FULL COURSE 2026 S08 Authentication

Опубликовано: 29 Май 2026
на канале: NeoKloud
45
1

🎬 *Title: Kubernetes Authentication Explained (CKS Level) 🔐 | NeoKloud Style*

---

🎤 *Hook (Powerful Start)*

Before we talk about Kubernetes… let me ask you something.

On Facebook, there are so many fake profiles.

If someone sends you a friend request… do you accept it immediately?

No.

You check the profile.
You look at the name, photos, mutual friends, activity…

You try to figure out — is this person real or fake?

If it looks genuine, you accept.
If not, you ignore or block.

---

That exact process is called **Authentication**.

---

🎯 *Part 1: Connect to Kubernetes*

Now bring this into Kubernetes.

Whenever you run a command like “kubectl get pods”…
that request goes to the **kube-apiserver**.

And the first thing Kubernetes does is exactly what you did on Facebook.

It checks your identity.

It asks:
“Who are you… and can I trust you?”

If your identity is not verified,
your request is rejected immediately.

---

🎯 *Part 2: Big Picture (Cluster + Users)*

A Kubernetes cluster has many components working together — nodes, control plane, services.

And there are different types of users interacting with it.

We have administrators managing the cluster.
We have developers deploying applications.
We have applications themselves talking to the API.

---

Now one important clarification.

End users who access applications are handled by the application itself — not Kubernetes.

Here, we only focus on **access to the Kubernetes cluster**.

---

🎯 *Part 3: Types of Users (CKS Important)*

In Kubernetes, there are mainly two types of users:

First, *humans* — admins and developers.
Second, *machines* — applications, services, automation tools.

---

And here comes a very important CKS concept.

Kubernetes does *not* manage users internally.

You cannot create users inside Kubernetes.

Instead, Kubernetes depends on external systems.

It simply says:
“Show me proof that you are valid.”

---

🎯 *Part 4: Where Authentication Happens*

Every request — whether from kubectl or API — goes to the **kube-apiserver**.

This is the entry point of the cluster.

Before doing anything,
the API server authenticates the request.

No authentication… no access.

---

🎯 *Part 5: Authentication Methods (Core Learning)*

Now let’s understand how Kubernetes verifies identity.

---

🔹 *Client Certificate Authentication*

This is the most common and secure method.

Users are given certificates signed by a trusted authority.

The API server verifies that certificate.

If it is valid, the user is authenticated.

---

🔹 *Bearer Token Authentication*

Here, a token is used as identity.

The request carries this token.

The API server checks if the token is valid.

This is commonly used by Service Accounts.

---

🔹 *Static Password File*

You can define usernames and passwords in a file.

This file is used by the API server to authenticate users.

It is simple but stores credentials in plain text.

---

🔹 *Static Token File*

Similar to password file, but instead of passwords, tokens are used.

Again, simple but not secure for production.

---

🔹 *Bootstrap Token*

Used when a new node joins the cluster.

It provides temporary authentication.

---

🔹 *External Providers (OIDC, LDAP, etc.)*

In real-world setups, authentication is often handled externally.

Kubernetes trusts providers like Google, Azure, LDAP.

---

🔹 *Webhook Authentication*

Kubernetes can also send authentication requests to an external service.

That service decides whether the request is valid.

---

🎯 *Part 6: Service Accounts (MOST IMPORTANT 🔥)*

Now comes a critical concept for CKS — Service Accounts.

Pods also need to talk to the API server.

So Kubernetes gives each pod an identity.

That identity is called a Service Account.

---

When a pod is created,
a token is automatically mounted inside it.

The pod uses this token to communicate with the API server.

---

🚨 *Security Risk (CKS Focus)*

This is where things become important.

That token is mounted by default.

If an attacker gets access to the pod,
they can use this token.

---

✅ *Best Practice (Exam Ready)*

If your pod does not need API access,
you should disable this behavior.

This is a very common CKS exam question.

---

🎯 *Part 7: How to Think in Exam 🧠*

When you see a question, think like this:

Who is making the request?
How is identity being verified?
Is there any insecure configuration?

---

🎯 *Quick Revision Trick*

Remember this:

Client Certificate
Bearer Token
Static File
OIDC
Webhook
Bootstrap

---

🎬 *Outro (Strong Close)*

So just like you verify a Facebook profile before accepting a request…
Kubernetes verifies identity before allowing access.

If this concept is clear…
your Kubernetes security foundation is strong.

Next step — Authorization and RBAC.