Skip to content

Deploying a simple Nodejs with Kubernetes and Ansible

Notifications You must be signed in to change notification settings

busecolak/k8s-hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k8s-hello-world

Automation for the Nodejs Hello World app

This folder contains the Ansible playbook used to automate all the manual steps in deploying the example Nodejs Hello World app.

The main playbook will create the following k8s resources with given service_name (default: helloworld) in given namespace (default: testing).

  • Deployment
  • Service
  • Ingress
  • HPA objects (using build-in CPU metric)

Usage

The Ansible playbook assumes you have the following installed on your workstation:

You will also need to install a Python dependencies via Python Pip:

pip3 install openshift

Once they are installed, you can run the playbook with:

ansible-playbook -i inventory main.yml

To expose service on localhost:11130, you can run following command:

ansible-playbook -i inventory expose.yml

Once you're finished testing the Nodejs Hello World app in the Kubernetes cluster, you can run the following commands to delete the necessary resources:

ansible-playbook -i inventory remove.yml

The above commands assume you have kubectl installed.

To list k8s cluster resource, you can run following command:

python list_resources.py <namespace>s

About

Deploying a simple Nodejs with Kubernetes and Ansible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages