Skip to content

0xhalil/hello-world-devops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stargazers Issues LinkedIn


Logo

hello-world-devops

This project is a simple Node.js app, demonstration of DevOps practices, showing the usage of Docker and deployment of a basic application using Google Cloud Platform (GCP) services and Kubernetes.

Explore the docs »


Getting Started

To get started with the Hello World DevOps project, follow the steps below. These instructions will guide you through the setup process and demonstrate how to deploy the sample application on Google Cloud Platform using Docker and Kubernetes.

Prerequisites

Before proceeding with the Hello World DevOps project, ensure that you have the following prerequisites in place:

  • Google Cloud Platform (GCP) Account: You should have a Google Cloud Platform account. If you don't have one, you can sign up with this link: Google Cloud Console.
  • Google Cloud SDK: Download Google Cloud SDK to run "gcloud" commands Google Cloud SDK documentation.
  • Git: Make sure you have Git installed on your local machine. You can download Git from the official Git website.
  • Docker: Install Docker on your local machine. Docker will be used to build and create containers for the app. You can download Docker from the official Docker website.

Installation

  1. Clone the repo
    git clone [email protected]:ibrahimakkaya/hello-world-devops.git
  2. Change folder
    cd hello-world-devops
  3. We will make some changes in files, but we will do this in the deployment part.

(back to top)

Deployment

Follow the steps below to deploy the Hello World DevOps application on Google Cloud Platform using Kubernetes:

(back to top)

  1. Login Google Cloud and authenticate.

    gcloud auth login
  2. Create a Google Cloud project named {PROJECT_NAME}.

    gcloud projects create {PROJECT_NAME}
  3. To see PROJECT_ID.

    gcloud projects list
  4. To set desired project as default.

    gcloud config set project {PROJECT_ID}
  5. Enable the necessary Google Cloud services for this project:

    gcloud services enable container.googleapis.com
  6. Create a Kubernetes cluster name what you want, a 1 node basic hardware: (This process will take a little longer, because of this prefer to do it early.)

    gcloud container clusters create {CLUSTER_NAME} --num-nodes=1 --machine-type=n1-standard-1
  7. Create Google Cloud Artifacts with your configuration repository for store Docker image:

    gcloud config get-value compute/region
    
    gcloud artifacts repositories create {REPO_NAME} --project={PROJECT_ID} --repository-format=docker --location={REGION} --description="Docker Repo"

    Difference between region and zone in Google Cloud

  8. Build the Docker image and push it to the Google Cloud Artifacts repository: (Container name can be anything you want)

    gcloud builds submit --tag {REGION}-docker.pkg.dev/{PROJECT_ID}/{REPO_NAME}/{CONTAINER_NAME} .

    Build containers using gcloud build

  9. Open downloaded repository, open deployment.yaml and change the lines as they specified on comments.

    Screenshot
  10. Deploy the application using the Kubernetes manifest specified in the deployment.yaml file:

    kubectl apply -f deployment.yaml
  11. Verify that the deployment is successful:

    kubectl get deployments
  12. Create a Kubernetes service to expose the application:

    kubectl apply -f service.yaml
  13. Wait until to see External IP:

    kubectl get services
  14. You can access simple Node.js app with external IP.

Demo Link: Hello World

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Branch (git checkout -b feature)
  3. Commit your Changes (git commit -m 'Add some feature')
  4. Push to the Branch (git push origin main)
  5. Open a Pull Request

(back to top)

Contact

Halil Ibrahim Akkaya - Medium

Project Link: https://github.com/ibrahimakkaya/hello-world-devops

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published