← Back to Tutorials

DevOps Pipeline Setup

Set up a complete CI/CD pipeline with Docker and Kubernetes.

Step 1: Create a Dockerfile

Start by asking HackLikeMe to create a Dockerfile for your application:

> create a multi-stage Dockerfile for my Node.js Express app

The DevOps agent will analyze your package.json and create an optimized Dockerfile with development and production stages.

Step 2: Build and Test Locally

Ask HackLikeMe to build and test your Docker image:

> build the docker image and run it locally
> verify the container is working correctly

Step 3: Create Kubernetes Manifests

Generate Kubernetes deployment configuration:

> create kubernetes manifests for my app with 3 replicas, a service, and an ingress

This will create deployment.yaml, service.yaml, and ingress.yaml files.

Step 4: Set Up CI/CD

Create a CI/CD pipeline for automated deployments:

GitHub Actions:

> create a GitHub Actions workflow that builds, tests, and deploys to kubernetes

GitLab CI:

> create a .gitlab-ci.yml with build, test, and deploy stages

Step 5: Deploy to Kubernetes

Deploy your application:

> deploy my app to the staging namespace and verify it's running

DevOps Tools Available

The DevOps agent can use any DevOps tool installed on your system:

dockerkubectlterraformansiblehelmawsgcloudazure