Giter Site home page Giter Site logo

kubernetes-mongodb-deplyment's Introduction

Kubernetes deployment on minikube

The repository you're in currently contains files written in YAML format that can be used to set up and run a MongoDB database on a local Kubernetes cluster using Minikube. Minikube allows you to test and experiment with Kubernetes without the need for a remote cluster. The YAML files in the repository contains the instructions and parameters that are needed to create the resources required to run a MongoDB database on Minikube. These files will be used to create and configure the MongoDB pod and its services.

requirements:

  1. Minikube must be installed on your system.
  2. kubectl must be installed on your system.
  3. A hypervisor, such as VirtualBox, hyperkit, KVM, etc. must be installed on your system.

we will be using hyperkit as hypervisor in this example

Steps to deploy mongodb on minikube:

  1. Create a secret for the MongoDB database.
  2. Create a MongoDB pod.
  3. Create an internal service to connect the pod to the MongoDB database.
  4. Create a configmap to store the MongoDB URL.
  5. Create a Mongo Express pod, which is a web-based tool to interact with MongoDB.
  6. Create an external service for the Mongo Express to make it accessible from outside the cluster.

Note

Before proceeding to the next step in the process of deploying a MongoDB database on Minikube, it is important to ensure that there are no errors in the previous command. This means that you should verify that the previous command has completed successfully before moving on to the next one, to avoid any potential issues or errors.

Commands to deploy mongodb on minikube:

  1. Start minikube Only to start and for stopping you will use minikube at start and all for other works you will use kubectl
minikube start --vm-driver=hyperkit
  1. Create a secret for mongodb You are creating some secret variable to store the mongodb username and password
kubectl apply -f secret.yaml
  1. Create mongodb deployment This file contains the deployment configuration for mongodb and it's services configuration
kubectl apply -f mongo.yaml
  1. Create configmap for mongodb url This file contains the configuration for mongodb url
kubectl apply -f mongo-configmap.yaml
  1. Create mongo express deployment This file contains the deployment configuration for mongo express and it external service configuration to make it accessible from outside
kubectl apply -f mongo-express.yaml
  1. Get the external ip of the mongo express service In usual case, you can get the external ip of the service creating just by creating it but in minikube you have to do it manually
minikube service mongo-express-service

๐ŸŽ‰ Congratulation you have successfully deployed mongodb on minikube

kubernetes-mongodb-deplyment's People

Contributors

yashsharma1911 avatar meshery-dev[bot] avatar meshery[bot] avatar

Watchers

 avatar

Forkers

muzairs15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.