Giter VIP home page Giter VIP logo

sahinm / cloud-agnostic-devops-for-serverless Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.22 MB

This repository should give concepts of developing unified (vendor/cloud-agnostic) CI/CD pipelines with DevOps principles for serverless applications

License: Apache License 2.0

Shell 12.12% HCL 5.84% Java 35.96% Dockerfile 29.41% C# 3.12% Go 2.39% JavaScript 4.99% PHP 0.84% Python 4.45% Ruby 0.88%

cloud-agnostic-devops-for-serverless's Introduction

Cloud Agnostic Continuous Delivery For Serverless Applications

This repository should give concepts of developing unified (vendor/cloud-agnostic) CI/CD pipelines with DevOps principles for serverless applications. This pipeline uses 3 OpenFaaS instances on three Kubernetes Cluster with On-Prem (VM of Travis-CI), AWS and GCP. So you have a multi-cloud deployment pipeline which is cloud-agnostic and you can run everywhere.

  1. KinD (Kubernetes in Docker) cluster as Temporarily environment for testing
  2. AWS EKS Cluster as STAGING environment
  3. Google Kubernetes Engine (GKE) Cluster as PRODUCTION environment

CI/CD Pipeline with Travis CI

CI/CD Pipeline

Prerequisites

You can just setup your AWS and Google Cloud credentials on your computer and run the installation scripts from this repo to setup the environments

OpenFaaS Installation on AWS

The installation of a Kubernetes Cluster on the Cloud takes about 10-15 minutes. The OpenFaaS installation takes only about 2 minutes.

With this command you get a working OpenFaaS instance on your AWS EKS Cluster as Staging Environment:

./scripts/installation/openfaas-eks-cluster.sh

This script will install eksctl tool from Weaveworks for easier creation of a cluster, create the cluster with the name openfaas-eks-staging on AWS and install OpenFaaS on the cluster with Helm, the Kubernetes package manager.

You can change your User and Password in the script as you like. Later you can use them as encrypted Environment Variables on Travis CI for your pipeline.

With this command you get a working OpenFaaS instance on your GKE Cluster as Production Environment:

./scripts/installation/openfaas-gke-cluster.sh

This is WIP (not ready yet)

Install OpenFaaS CLI

This CLI is used to build and deploy our declarative configured functions (YAML).

curl -sSL https://cli.openfaas.com | sudo sh

Pipeline Usage Tutorial

To get the pipeline running you need to do these steps:

  1. Fork this GitHub Repo to your projects

  2. Go to https://travis-ci.com/ and link your forked repo with Travis CI.

  3. Put your Kubernetes Config file to root of your repo:(it is needed to connect to your cluster)

    cp ~/.kube/eksctl/clusters/openfaas-eks-staging.yml .
    
  4. Create the following Environment Variables

    1. AWS_ACCESS_KEY_ID - your AWS Access Key
    2. AWS_SECRET_ACCESS_KEY - Your AWS Secret Access Key
    3. DOCKER_USERNAME - Your Docker Username
    4. DOCKER_PW - Your Docker Password
    5. EKS_OF_URL - the URL which is resulted from the staging environment script
    6. EKS_OF_USER - Username for OpenFaaS you used in the staging environment script
    7. EKS_OF_PW - Password for OpenFaaS you used in the staging environment script

    TravisCI Environment Variables

  5. checkout the develop branch and update it to the current branch

  6. Trigger your Travis CI Pipeline

That's it !

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.