Giter VIP home page Giter VIP logo

gitkube-example's Introduction

gitkube-example

An nginx example application to be used with gitkube: git push to deploy on to Kubernetes.

Instructions

  • Install gitkube on your Kubernetes cluster

    $ kubectl create -f https://storage.googleapis.com/gitkube/gitkube-setup-stable.yaml
    
    $ #expose gitkubed service
    $ kubectl --namespace kube-system expose deployment gitkubed --type=LoadBalancer --name=gitkubed
  • Clone this repo:

    $ git clone https://github.com/hasura/gitkube-example
    $ cd gitkube-example
  • Create a kubernetes deployment and service:

    $ kubectl create -f k8s.yaml
  • Add your SSH public key to remote.yaml:

    $ cat ~/.ssh/id_rsa.pub | awk '$0="  - "$0' >> "remote.yaml"
  • [Multi-node] If you are running a multi-node cluster, remote.yaml should specify a registry to push and pull from/into the cluster. Read more about this secret here and detailed instructions for few registry providers here.

      registry:
      url: "docker.io/<user>"
      credentials:
      # docker-registry secret name
        secretRef: regsecret
  • Create the gitkube remote:

    $ kubectl create -f remote.yaml
  • Wait for the remote url:

    $ kubectl get remote example -o json | jq -r '.status.remoteUrl'
    # remoteUrl will be like ssh://default-example@[ip-address]/~/git/default-example

    Note that for services exposed as type NodePort, remoteUrl will not be filled automatically. Check .status.remoteUrlDesc for instructions on manually constructing the remoteUrl

  • Create the git remote:

    $ git remote add example [remoteUrl]
  • Git push to update the nginx application

    $ git push example master
  • Checkout the application using kubectl proxy:

    $ kubectl proxy

    Visit http://localhost:8001/api/v1/namespaces/default/services/nginx/proxy on browser

gitkube-example's People

Contributors

shahidhk avatar surajnarwade avatar tirumaraiselvan avatar

Watchers

 avatar  avatar  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.