DEV Community

Avinash Maurya
Avinash Maurya

Posted on

1

Azure, Kafka, Docker, Kubernetes, and AWS.

Full-stack developer working with technologies like Azure, Kafka, Docker, Kubernetes, and AWS. Keep in mind that this is a basic guide, and you might need to refer to official documentation and resources for more in-depth understanding.

Azure

Azure CLI:

# Login to Azure
az login

# List available subscriptions
az account list --output table

# Set default subscription
az account set --subscription <subscription_id>

# Create a resource group
az group create --name <resource_group_name> --location <region>
Enter fullscreen mode Exit fullscreen mode

Azure App Service:

# Create a web app
az webapp create --resource-group <resource_group_name> --plan <app_service_plan_name> --name <app_name> --runtime <runtime>

# Deploy to Azure App Service
az webapp deployment source config --name <app_name> --resource-group <resource_group_name> --repo-url <repo_url> --branch <branch_name>
Enter fullscreen mode Exit fullscreen mode

Kafka

Kafka Commands:

# Start Zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties

# Start Kafka broker
bin/kafka-server-start.sh config/server.properties

# Create a topic
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic <topic_name>

# Produce a message
bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic <topic_name>

# Consume messages
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic <topic_name> --from-beginning
Enter fullscreen mode Exit fullscreen mode

Docker

Docker Basics:

# Build a Docker image
docker build -t <image_name> .

# Run a Docker container
docker run -p <host_port>:<container_port> <image_name>

# List running containers
docker ps

# Stop a running container
docker stop <container_id>

# Remove a container
docker rm <container_id>

# Remove an image
docker rmi <image_name>
Enter fullscreen mode Exit fullscreen mode

Kubernetes

Kubernetes Basics:

# Create a deployment
kubectl create deployment <deployment_name> --image=<image_name>

# Expose a deployment as a service
kubectl expose deployment <deployment_name> --port <service_port>

# Scale a deployment
kubectl scale deployment <deployment_name> --replicas=<num_replicas>

# Get pod information
kubectl get pods

# Get service information
kubectl get services
Enter fullscreen mode Exit fullscreen mode

AWS

AWS CLI:

# Configure AWS CLI
aws configure

# List AWS regions
aws ec2 describe-regions --output table

# Create an EC2 instance
aws ec2 run-instances --image-id <ami_id> --instance-type <instance_type> --key-name <key_pair_name> --region <region>

# List S3 buckets
aws s3 ls
Enter fullscreen mode Exit fullscreen mode

AWS Lambda:

# Create a Lambda function
aws lambda create-function --function-name <function_name> --runtime <runtime> --role <role_arn> --handler <handler> --code S3Bucket=<bucket>,S3Key=<key>

# Invoke a Lambda function
aws lambda invoke --function-name <function_name> --payload '{"key1":"value1", "key2":"value2"}' <output_file>
Enter fullscreen mode Exit fullscreen mode

These commands cover some basic operations with each technology. Remember to replace placeholders like <...> with your actual values. For more detailed and specific information, refer to the official documentation for each technology and service.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →