top of page

Microservices K8 Ready

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Jul 14, 2022
  • 1 min read

Updated: Sep 13, 2023

How To Make Microservices Kubernetes Ready


Prerequisite

· Kubernetes

· Docker

· K8 cluster-will make use of GCP K8 cluster

Sample Microservices Architecture



· K8 Deployment

· K8 services

· K8 loadbalancer type for exposing services

·

kubectl comand

---

kubectl cluster-info

kubectl get node

kubectl create deployment deployment-name --image=image name --port=8080

kubectl get deployment

kubectl describe deployment deployment-name

kubectl get pods

kubectl logs nameofpod


# in a namespace

kubectl api-resource --namespaced=true


#not in a namespace

kubctl api-resource --namespaced=falseV


expose deployment

==

kubectl get deployments

kubectl expose deployment deployment-name --type=NodePort

kubectl get service


Kubenetes Namespaces

===

default namespace is virtual cluster withinh k8 cluster. It is normally for system realted work, we should not store our application in this namespace.



Better Approach

==



Below are the k8 default namespaces

kubectl get namespaces




Namespace type

====

deafult

if namepace is not defined,then all resources will be tagged to default namespace.


kube-system

This is reseved for k8 resources while creating k8 cluster

for eg: Master Node- API Server,Controller Manager,Schedular,ETCD

Worker Node - Kubelet,kubeproxy


It is not recommended to use this namespace for our application resources like pod,deployment,service etc....


kube-public

This is open for all, it has all cluster information.Everyone can read and access this namespace.


kube-node-lease

This is associated with lease object for each node and improve the performance of node and heartbeats.



We can create our namespace and application resources will be tagged to that namespace.



#to create namespace

kubectl create namespace my-namespace


# to deploy resources in my-namespace

kubectl apply -f deploy.yml --namespace=my-namespace


# to get resources in my-namespace

kubectl get deployment -n my-namespace

kubectl get pods -n my-namespace








 
 
 

Recent Posts

See All
Best Chunking Practices

1. Chunk by Semantic Boundaries (NOT fixed size only) Split by sections, headings, paragraphs , or logical units. Avoid cutting a sentence or concept in half. Works best with docs, tech specs, policie

 
 
 
Future State Architecture

USE CASE: LARGE RETAIL BANK – DIGITAL CHANNEL MODERNIZATION 🔹 Business Context A large retail bank wants to “modernize” its digital channels (internet banking + mobile apps). Constraints: Heavy regul

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page