Kubernetes Service Account and RBAC Tutorial

In this tutorial, we created a Service Account with a Role and RoleBinding for read-only access to Pods. You can find the source code in the GitHub repository. What is a Service Account in Kubernetes? A Service Account in Kubernetes is a special type of account that is used by processes or applications running inside Pods to authenticate and interact with the Kubernetes API. Unlike User Accounts, which are typically associated with human users, Service Accounts are designed for non-human access. They are used to grant specific permissions to applications, allowing them to interact with the Kubernetes cluster in a controlled and secure way. ...

January 16, 2025 · 5 min · Hamid

Hashicorp Vault Agent Tutorial: Generating .env from Vault Secrets

In this tutorial, we will set up Vault Agent to generate a .env file with secrets from HashiCorp Vault. We’ll use the AppRole authentication method to securely authenticate and retrieve secrets, then write them to an environment file for use in your application. You can find the complete configuration files and setup used in this tutorial in the GitHub repository. ⚠️ Important Note: This tutorial uses Vault in development mode (-dev) for simplicity. Development mode is not secure and should only be used for testing and learning purposes. In a production environment: ...

January 2, 2025 · 4 min · Hamid

Hello world Kubernetes with Nginx on Minikube

Kubernetes gives you the ability to deploy your app in a highly available way, and it has provisioning features that you can use to avoid manual tasks. There are tons of tutorials about Kubernetes out there, but in this simple post, I just want to give you the simplest deployment ever in Kubernetes. You will see how to deploy nginx with Kubernetes and access it easily. Before deployment, make sure you have properly installed kubectl and minikube, and remove any old stuff from minikube using the delete and start commands. ...

August 18, 2023 · 3 min · Hamid

Local Storage for shopping cart in Javascript

In a previous exercise class with students, we created a simple shopping cart with JS. Today I had another lecture and I added a localStorage feature to this project. In this version of the project, the added items can persist in the cart after a refresh and we added another file named cart.html that shows the added cart items. You can see the source code of this project in the v2.0.0 tag in this repo: JsShoppingCart ...

May 23, 2022 · 2 min · Hamid

Simple Shopping Cart with pure Javascript

I’m a code mentor and private programming tutor. Today, my student and I were working on event listeners in JS and I tried to teach how to make a simple and minimal shopping cart. If you are learning JS, this could be a good exercise. You can find the code here. And you can see a demo here. In this work, we added our products like this: <div class="product"> <h3>Product one</h3> <p>Price: 2000</p> <button data-id="1" data-price="2000">Add to cart</button> </div> We know that in the real world we do not do this manually and we generate them with loops using data that we have retrieved from a database. ...

May 18, 2022 · 2 min · Hamid

Simple exercise for Javascript Ajax

I have about 4 years of experience working as a private tutor of programming. About five years ago, I published a blog post on my website in Persian language entitled “Private Laravel Tutor” and people started to call me. I always love teaching people and it was a good opportunity. After a while, the number of students increased and today I have two sessions per day on average. Most of my previous students are now working around the world. ...

May 14, 2022 · 2 min · Hamid