Giter Club home page Giter Club logo

lemp-with-k8s-p1's Introduction

Lemp-with-k8s-P1

  1. Create some secrets for MySQL.
  • Create a secret named mysql-root-pass wih key/value pairs as below:

name: passwordvalue: R00t

  • Create a secret named mysql-user-pass with key/value pairs as below:

name: usernamevalue: kodekloud_timname: passwordvalue: GyQkFRVNr3

  • Create a secret named mysql-db-url with key/value pairs as below:

name: databasevalue: kodekloud_db3

  • Create a secret named mysql-host with key/value pairs as below:

name: hostvalue: mysql-service

  1. Create a config map php-config for php.ini with variables_order = "EGPCS" data. 3. Create a deployment named lemp-wp.

  2. Create two containers under it. First container must be nginx-php-container using image webdevops/php-nginx:alpine-3-php7 and second container must be mysql-container from image mysql:5.6. Mount php-config configmap in nginx container at /opt/docker/etc/php/php.ini location.

  1. Add some environment variables for both containers:
  • MYSQL_ROOT_PASSWORD, MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD and MYSQL_HOST. Take their values from the secrets you created. Please make sure to use env field (do not use envFrom) to define the name-value pair of environment variables.
  1. Create a node port type service lemp-service to expose the web application, nodePort must be 30008.

  2. Create a service for mysql named mysql-service and its port must be 3306.

  1. We already have a /tmp/index.php file on jump_host server.
  • Copy this file into the nginx container under document root i.e /app and replace the dummy values for mysql related variables with the environment variables you have set for mysql related parameters. Please make sure you do not hard code the mysql related details in this file, you must use the environment variables to fetch those values.

  • Once done, you must be able to access this website using Website button on the top bar, please note that you should see Connected successfully message while accessing this page.

lemp-with-k8s-p1's People

Contributors

shihabkbasheer03 avatar

Watchers

 avatar

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.