Fueling Curiosity, One Insight at a Time
At Codemancers, we believe every day is an opportunity to grow. This section is where our team shares bite-sized discoveries, technical breakthroughs and fascinating nuggets of wisdom we've stumbled upon in our work.
Apr 16, 2024
Terraform alias is a feature that allows you to manage resources across multiple regions more efficiently. It enables you to define different configurations for resources in various regions while using the same Terraform codebase.
Here's a simple example to illustrate how to use Terraform alias for multiple regions:
In this example, we define two different AWS providers with aliases
#terraform #iac
Here's a simple example to illustrate how to use Terraform alias for multiple regions:
provider "aws" {
alias = "us_east"
region = "us-east-1"
}
provider "aws" {
alias = "us_west"
region = "us-west-1"
}
resource "aws_instance" "example" {
provider = aws.us_east
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}
resource "aws_instance" "example_west" {
provider = aws.us_west
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}
In this example, we define two different AWS providers with aliases
us_east
and us_west
, representing the US East and US West regions, respectively. Then, we create instances using these providers, specifying the region-specific provider for each instance. This allows Terraform to manage resources in different regions using the same configuration file.#terraform #iac
Mahesh Bhosle
DevOps Engineer
Apr 12, 2024
#devops #kubernetes
k9s is a powerful command-line interface (CLI) tool for Kubernetes management. It allows you to interact with Kubernetes clusters efficiently, offering features like resource viewing, log access, event monitoring, and pod command execution—all from your terminal. Install k9s using Homebrew with the command
k9s is a powerful command-line interface (CLI) tool for Kubernetes management. It allows you to interact with Kubernetes clusters efficiently, offering features like resource viewing, log access, event monitoring, and pod command execution—all from your terminal. Install k9s using Homebrew with the command
brew install k9s
, and access its intuitive interface by running k9s
nisanth
Apr 11, 2024
Spread operator in JavaScript is represented by three dots (...).
It's a useful syntax for manipulating arrays and objects in various ways.
Following are some of the use cases:-
Spread in Arrays:-
1. Copying Arrays: It allows you to create a new array by copying another array.
const originalArray = [1, 2, 3];
const copyArray = [...originalArray];
console.log(copyArray); // [1, 2, 3]
2. Concatenating Arrays: You can merge arrays together.
const array1 = [1, 2, 3];
const array2 = [4, 5, 6];
const mergedArray = [...array1, ...array2];
console.log(mergedArray); // [1, 2, 3, 4, 5, 6]
3. Adding Elements to Arrays: You can add new elements to an existing array.
const array1 = [1, 2, 3];
const newArray = [...array1, 4, 5, 6];
console.log(newArray); // [1, 2, 3, 4, 5, 6]
Spread in Objects:-
1. Copying Objects: It allows you to create a shallow copy of an object.
const originalObj = { name: 'John', age: 30 };
const copyObj = { ...originalObj };
console.log(copyObj); // { name: 'John', age: 30 }
2. Merging Objects: You can merge multiple objects into one.
const obj1 = { name: 'John' };
const obj2 = { age: 30 };
const mergedObj = { ...obj1, ...obj2 };
console.log(mergedObj); // { name: 'John', age: 30 }
3. Adding Properties to Objects: You can add new properties to an object.
const obj1 = { name: 'John' };
const newObj = { ...obj1, age: 30 };
console.log(newObj); // { name: 'John', age: 30 }
Function Arguments:
1. Spread can be used to pass an array as individual arguments to a function.
const numbers = [1, 2, 3];
const sum = (a, b, c) => a + b + c;
console.log(sum(...numbers)); // 6
Sachin Kabadi
System Analyst
Apr 11, 2024
#devops #kubernetes #helm
To verify the Helm chart, you can use the following command:
This command opens a web browser and directs it to a service running in your Minikube Kubernetes cluster. It simplifies accessing and testing applications deployed locally on Minikube.
To verify the Helm chart, you can use the following command:
minikube service servicename
This command opens a web browser and directs it to a service running in your Minikube Kubernetes cluster. It simplifies accessing and testing applications deployed locally on Minikube.
nisanth
Apr 10, 2024
git switch -c branch_name
used in Git to create and switch to a new branch in one step.#gitcommand
soniya.rayabagi
Apr 10, 2024
The
#devops #helm #helmhub #kubernetes
helm search hub <keyword>
command is used to search for charts available in the Helm Hub, which is a centralized repository of Helm charts , keyword can be prometheus, grafana, nginx, postgresql etc.helm search hub <keyword> --max-col-width=0
this command displays the results without column width limitations.#devops #helm #helmhub #kubernetes
soniya.rayabagi
Apr 10, 2024
Empty a file using the
#UnixCommand
>
symbol. Simply typing > filename
truncates the file, removing all its previous content.#UnixCommand
soniya.rayabagi
Apr 10, 2024
chmod 777
is a command used to set permissions on a file or directory in Unix-like operating systems (including Linux and macOS). It grants full read, write, and execute permissions.#devops #FilePermissions
soniya.rayabagi
Apr 8, 2024
Kubernetes on Docker Desktop
• Install Docker Desktop
• Enable Kubernetes from docker-desktop setting
• Switch the Kubernetes context to docker-desktop
• Example :
• Instead of using the command
• To install kubectx on Mac:
#devops #kubernetes #dockerdesktop
• Install Docker Desktop
• Enable Kubernetes from docker-desktop setting
• Switch the Kubernetes context to docker-desktop
• Example :
❯ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
docker-desktop docker-desktop docker-desktop
* kind-kube-nginx-cluster kind-kube-nginx-cluster kind-kube-nginx-cluster
❯ kubectl config use-context docker-desktop
Switched to context "docker-desktop".
• Instead of using the command
kubectl config use-context docker-desktop
we can also go with kubectx
to switch between Kubernetes context• To install kubectx on Mac:
brew install kubectx
#devops #kubernetes #dockerdesktop
soniya.rayabagi
Apr 8, 2024
Access Kubernetes dashboard on minikube
To access the dashboard:
This will enable the dashboard add-on, and open the proxy in the default web browser.
#devops #kubernetes
To access the dashboard:
minikube dashboard
This will enable the dashboard add-on, and open the proxy in the default web browser.
#devops #kubernetes
nisanth
Showing 21 to 23 of 77 results
Ready to Build Something Amazing?
Codemancers can bring your vision to life and help you achieve your goals
- Address
2nd Floor, Zee Plaza,
No. 1678, 27th Main Rd,
Sector 2, HSR Layout,
Bengaluru, Karnataka 560102 - Contact
hello@codemancers.com
+91-9731601276