Giter Site home page Giter Site logo

kops's Introduction

Kubernetes Cluster Automation with Kops and LAMP Stack Deployment

This repository contains a bash script that automates the process of creating a Kubernetes cluster using kops and deploying a LAMP (Linux, Apache, MySQL, PHP) stack application.

Prerequisites

Before running the script, make sure you have the following tools installed and configured:

Additionally, ensure you have:

  • An AWS account with appropriate permissions.
  • A domain managed in Route 53 or a subdomain.

Script Overview

The script performs the following steps:

  1. Checks for prerequisites.
  2. Creates an S3 bucket for kops state storage.
  3. Creates a Kubernetes cluster with kops.
  4. Creates a namespace.
  5. Deploys a MySQL database.
  6. Deploys a PHP application using Apache.
  7. Exposes the PHP application.
  8. Verifies the deployments.
  9. Optionally, cleans up resources.

Usage

  1. Clone the repository or save the script to a file, e.g., kops_deploy_lamp.sh.

  2. Make the script executable:

    chmod +x kops_deploy_lamp.sh
  3. Update the script variables at the top of the script with your own values, such as CLUSTER_NAME, STATE_BUCKET, ZONE, etc.

  4. Run the script:

    ./kops_deploy_lamp.sh
  5. To clean up the cluster after verification, uncomment the delete_cluster function call at the end of the script.

Script Variables

  • CLUSTER_NAME: The name of the Kubernetes cluster.
  • STATE_BUCKET: The name of the S3 bucket for storing kops state files.
  • KOPS_STATE_STORE: The S3 bucket URL for kops state storage.
  • NODE_COUNT: The number of nodes in the cluster.
  • NODE_SIZE: The instance type for the nodes.
  • MASTER_SIZE: The instance type for the master node.
  • ZONE: The AWS availability zone.
  • NAMESPACE: The namespace for deploying the applications.

Verification

After running the script, the MySQL database and the PHP application will be deployed, and the PHP application will be exposed via a LoadBalancer. You can verify the deployment by checking the status of the pods and services:

kubectl get pods -n <namespace>
kubectl get services -n <namespace>

kops's People

Contributors

rnadjqaim avatar

Stargazers

 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.