🚀 Kubernetes Quick Tips: Environment Variables -- Choosing Between env and envFrom 🔹 When to use envFrom: Load multiple environment variables from ConfigMaps or Secrets in bulk. Perfect for reducing clutter when you have a lot of variables to import at once. Example: envFrom: - configMapRef: name: my-configmap - secretRef: name: my-secret 🔹 When to use env: For individual environment variables or more granular control. Ideal when pulling specific values from different sources like Secrets, ConfigMaps, or pod fields. Example: env: - name: APP_ENV value: production - name: DATABASE_URL valueFrom: secretKeyRef: name: my-secret key: db-url 📌 Gist: Use envFrom for simplicity with large sets of variables, and env for precision when mixing multiple sources! #Kubernetes #DevOps #CloudNative #K8sTips #Containerization #ConfigMaps #Secrets #KubernetesTips
Fahad Ahammed’s Post
More Relevant Posts
-
"Stern allows you to tail multiple pods on Kubernetes and multiple containers within the pod. Each result is color-coded for quicker debugging" Read about the 5 must-have tools for #kubernetes in my latest article #devops #logging #observability #cloudnative
To view or add a comment, sign in
-
#hello conncetion..! 🚀 Mastering Kubernetes with HostPath: Exploring the fileOrCreate Type! 🛠️ 🌟 What is fileOrCreate in Kubernetes? In Kubernetes, HostPath volumes empower your Pods by granting them access to the host node’s filesystem. The fileOrCreate type adds a unique twist—it automatically creates a file at the specified path if it doesn’t already exist! 💡 This is a game-changer for lightweight file persistence, perfect for logs, temporary data, or application configurations. 🔑 Key Highlights: ✅ Maps the host node's filesystem to the Pod. ✅ Ensures that files needed by the application are pre-created if they don’t exist. ✅ Simplifies managing distributed apps with minimal setup. 🛠️ My Recent Experiment: I implemented the fileOrCreate concept by mapping /undata/index.html on the host node. 📄 Kubernetes automatically created the file and served a custom webpage with a NodePort Service. 👨💻 And yes, seeing "Hello from Unnati" displayed on my browser felt amazing! 😍 A big thank you to my mentor Ankush Kathar Sir, who continues to inspire and guide me through Kubernetes and beyond. 🙌 #Kubernetes #CloudComputing #DevOps #KubernetesVolumes #HostPath #Containerization #fileOrCreate #DistributedSystems #CloudNative #Docker #K8s #AnkushSir #TechLeadership #CloudJourney #TechExploration #LearningByDoing #TechTips #FileManagement #DevOpsCommunity #CloudNativeComputing
To view or add a comment, sign in
-
𝐅𝐥𝐚𝐬𝐡 𝐅𝐚𝐜𝐭𝐬: 𝐁𝐢𝐠 𝐈𝐧𝐬𝐢𝐠𝐡𝐭𝐬! 𝐈𝐧𝐢𝐭-𝐜𝐨𝐧𝐭𝐚𝐢𝐧𝐞𝐫𝐬 are used to initialize something inside Pod. The init-containers will run and exit. After every init container which exits with a code 0, your main containers will start. Examples:Moving some file into your application containers, e.g. Configuration. ☛ Kubernetes itself does not know anything about 𝐬𝐢𝐝𝐞𝐜𝐚𝐫𝐬. Sidecar-Containers are a pattern to solve some use-cases. * Kubernetes distinguishes between Init-Containers and Containers running inside your Pod. ☛ We call Sidecars -> all containers, that do not provide a user-focused service. For example, this could be a proxy or something for easier database access. If you're running a Java-App you could use a sidecar to export JVM metrics in Prometheus format. ☛ The difference here is, your sidecar-containers must run all the time. If 𝐨𝐧𝐞 𝐨𝐟 𝐲𝐨𝐮𝐫 𝐧𝐨𝐭-𝐢𝐧𝐢𝐭-𝐜𝐨𝐧𝐭𝐚𝐢𝐧𝐞𝐫𝐬 𝐞𝐱𝐢𝐭𝐬, 𝐤𝐮𝐛𝐞𝐫𝐧𝐞𝐭𝐞𝐬 𝐰𝐢𝐥𝐥 𝐫𝐞𝐬𝐭𝐚𝐫𝐭 𝐭𝐡𝐞 𝐰𝐡𝐨𝐥𝐞 𝐩𝐨𝐝. And that's the difference! ☛ Init containers run and exit before your main application starts, Sidecars run side-by-side with your main container(s) and provide some kind of service for them. #DevOps #Containers #Microservices #CICD #SoftwareDevelopment #CloudComputing #Automation #Scalability #kubernetes #k8s
To view or add a comment, sign in
-
🚀 Day Two: Worker Node Components in Kubernetes 🖥️ The Worker Node in Kubernetes is where the actual workloads (your applications) run. Here’s a breakdown of the key components that make it all happen: 1️⃣ Kubelet Responsibilities: Ensures that the containers inside the Pods are running as expected. 🟢 Monitors container health and restarts them if needed. ♻️ Communicates with the Kube-API-Server, reporting the status of both Pods and the node. 📡 2️⃣ Kube-Proxy Responsibilities: Enables Pods to find and communicate with each other. 🔗 Implements network rules, allowing traffic to flow between Pods across different nodes. 🌐 3️⃣ Container Runtime Engine (CRE) Responsibilities: Pulls container images from registries. 📥 Runs the containers that make up your applications. 🚀 Works closely with Kubelet to ensure containers are running as specified in the Pod definition. ✅ Stay tuned for Day 3 as we continue our Kubernetes journey! #Kubernetes #K8s #Containers #CloudNative #DevOps #Containerd #KubernetesJourney #TechInsights
To view or add a comment, sign in
-
🚀 Understanding DaemonSet in Kubernetes 🚀 A DaemonSet ensures that a copy of a specific Pod runs on all or a subset of nodes in a Kubernetes cluster. When you add a node to the cluster, a DaemonSet automatically schedules a Pod on the new node, and when you remove a node, the corresponding Pods are cleaned up. For example, DaemonSets are commonly used for logging, monitoring, or network management tools (like Fluentd or Prometheus) that you want to run across all nodes. 📝 Example DaemonSet manifest file: apiVersion: apps/v1 kind: DaemonSet metadata: name: example-daemonset namespace: default spec: selector: matchLabels: app: example template: metadata: labels: app: example spec: containers: - name: daemonset-container image: nginx 📋 Commands for DaemonSets: List DaemonSets 👉kubectl get ds Delete a DaemonSet 👉kubectl delete daemonset <daemonset-name> 👉kubectl delete daemonset --all To add nodes to the cluster: 👉kops edit ig --name=bucketname nodes-us-east-1a To update the cluster: 👉kops update cluster --name bucketname --yes --admin #Kubernetes #DevOps #K8s #DaemonSet #Kops #CloudComputing #ContainerOrchestration
To view or add a comment, sign in
-
Just back from "DevInfra-Days" organized by StackGen. Arshad Sayyad opened the talked with great energy and explained about the problem that StackGen is solving for. ⚡ Yusuf Kanchwala deep dived into the tech aspects about how their product is capable of writing the HashiCorp terraform in minutes just by doing the code scan. 💡 👋Sangam gave a live demo of the application and every participant also followed along and we ended up generating terraform code of a python application and deployed that to server less architecture on cloud in minutes!! ⏩ Here I learned about the game-changing power of appCD for AWS Lambda developers! 🤯 If you're building event-driven applications on AWS Lambda, appCD's Infrastructure from Code feature is a must-know. It automatically generates IaC files, ensuring your deployments are secure, compliant, and lightning-fast. ⚡️ No more struggling with infrastructure provisioning or worrying about policy violations. appCD takes care of the heavy lifting, so you can focus on what you do best: writing awesome code. 💻 Check out stackgen.com to streamline your development workflow and accelerate your time-to-market. #DevInfraDays #DevopsMadeEasyForDevelopers #Devops #InfrastructureAsCode #Serverless
To view or add a comment, sign in
-
Red Hat publishes Docker Hub images for Granite 7B LLMs and InstructLab | Red Hat Developer OCI images are now available on the registries Docker Hub and Quay.io, making it even easier to use the Granite 7B large language model (LLM) and InstructLab. Read more: https://lnkd.in/gbFhgKFh Follow techbeatly for #learningeveryday Follow SocialKonf for #communitylearning #learningeveryday #devops #techbeatly #socialkonf
To view or add a comment, sign in
-
🚀 Kubernetes Tip: ReplicaSets ensure high availability by managing identical pod replicas. ✅ Key Features: Pod Replication: ReplicaSets ensure that a defined number of pod replicas are always running, helping maintain desired application availability. Self-Healing: If a pod fails or is deleted, the ReplicaSet automatically creates new pods to replace them, ensuring the desired state is maintained. Scalability: You can scale a ReplicaSet horizontally by adjusting the number of replicas, allowing applications to handle increased load. ✅ How we can create the yaml file for create the ReplicatSet and implement the same. Here is the Sample replica_file.yaml apiVersion: apps/v1 kind: ReplicaSet metadata: name: myfirstrs # myfirstrs is my replica set name spec: replicas: 1 selector: matchLabels: run: myfirstrs template: metadata: labels: run: myfirstrs spec: containers: - name: myfirstcontainer image: nginx ✅ Verify replica set and pods by using below command kubectl get rs -n devopstest kubectl get pods -n devopstest # devopstest is namespace ✅ After that you can scale the replica set by using below cmmand kubectl scale rs myfirstrs --replicas=5 -n devopstest # we are going scale the 1 pod to 5 pods. 💡 Use Cases: Ensure application availability in production. Seamlessly handle rolling updates. 🔑 Best Practices: Define proper labels and selectors. Monitor ReplicaSets for optimal performance. Got any ReplicaSet tips to share? Drop them below! 👇 #Kubernetes #DevOps #CloudNative #Containerization #ReplicaSets #HighAvailability
To view or add a comment, sign in
-
Red Hat publishes Docker Hub images for Granite 7B LLMs and InstructLab | Red Hat Developer OCI images are now available on the registries Docker Hub and Quay.io, making it even easier to use the Granite 7B large language model (LLM) and InstructLab. Read more: https://lnkd.in/gcwygFzr Follow techbeatly for #learningeveryday Follow SocialKonf for #communitylearning #learningeveryday #devops #techbeatly #socialkonf
To view or add a comment, sign in
-
𝐅𝐥𝐚𝐬𝐡 𝐅𝐚𝐜𝐭𝐬: 𝐁𝐢𝐠 𝐈𝐧𝐬𝐢𝐠𝐡𝐭𝐬! --- Taints and tolerations in Kubernetes Taints and tolerations are used to set 𝐫𝐞𝐬𝐭𝐫𝐢𝐜𝐭𝐢𝐨𝐧𝐬 on which PODS needs to be scheduled on a NODE. Taints are set on Nodes, Tolerations - on pods. To taint a node: 𝑘𝑢𝑏𝑒𝑐𝑡𝑙 𝑡𝑎𝑖𝑛𝑡 𝑛𝑜𝑑𝑒𝑠 𝑛𝑜𝑑𝑒-𝑛𝑎𝑚𝑒 𝑘𝑒𝑦=𝑣𝑎𝑙𝑢𝑒:𝑡𝑎𝑖𝑛𝑡-𝑒𝑓𝑓𝑒𝑐𝑡 𝑘𝑢𝑏𝑒𝑐𝑡𝑙 𝑡𝑎𝑖𝑛𝑡 𝑛𝑜𝑑𝑒𝑠 𝑛𝑜𝑑𝑒1 𝑎𝑝𝑝=𝑏𝑙𝑢𝑒:𝑁𝑜𝑆𝑐ℎ𝑒𝑑𝑢𝑙𝑒 The taint-effect defines what will happen to the pods if they do not tolerate the taint: 𝐍𝐨𝐒𝐜𝐡𝐞𝐝𝐮𝐥𝐞 - pod will not be scheduled on the node 𝐏𝐫𝐞𝐟𝐞𝐫𝐍𝐨𝐒𝐜𝐡𝐞𝐝𝐮𝐥𝐞 - the system will try to avoid placing the pod on the node, but that is not guaranteed 𝐍𝐨𝐄𝐱𝐞𝐜𝐮𝐭𝐞 - new pods will not be scheduled on the node, and existing pods on the node if any - will be evicted if they do not tolerate the taint To remove a taint from a node add a - (minus) at the end of taint: 𝑘𝑢𝑏𝑒𝑐𝑡𝑙 𝑡𝑎𝑖𝑛𝑡 𝑛𝑜𝑑𝑒𝑠 𝑛𝑜𝑑𝑒-𝑛𝑎𝑚𝑒 𝑘𝑒𝑦=𝑣𝑎𝑙𝑢𝑒:𝑡𝑎𝑖𝑛𝑡-𝑒𝑓𝑓𝑒𝑐𝑡- Tolerations are added to pods inside 𝐬𝐩𝐞𝐜.𝐭𝐨𝐥𝐞𝐫𝐚𝐭𝐢𝐨𝐧𝐬 of the Pod definition: spec: tolerations: - key: "Myapp" operator: "Equal" value: "red" effect: "NoSchedule" When the Kubernetes cluster is first setup: a taint is set to Master node automatically to prevent any pod to being scheduled on this Node. This is best practice. To see this taint: 𝑘𝑢𝑏𝑒𝑐𝑡𝑙 𝑑𝑒𝑠𝑐𝑟𝑖𝑏𝑒 𝑛𝑜𝑑𝑒 𝑚𝑎𝑠𝑡𝑒𝑟 | 𝑔𝑟𝑒𝑝 𝑇𝑎𝑖𝑛𝑡 #kubernetes #k8s #devops #devopslearning
To view or add a comment, sign in