Giter VIP home page Giter VIP logo

cnd's Introduction

Cloud Native Development (CND)

CircleCI

Cloud Native Development (CND) is about running your development flow entirely in kubernetes, avoiding the time-consuming docker build/push/pull/redeploy cycle.

CND helps you achieve this with a mix of kubernetes automation, file synching between your local file system and kubernetes and hot reloading of containers.

How does it work

This is how a standard dev environment looks like:

 

And this how it looks after converting it into a cloud native environment:

 

The cnd container duplicates the manifest of the api pod, so it is fully integrated with every Kubernetes feature.

Local changes are synched to the cnd container via ksync. As you save locally, it will be automatically synched in your cnd container in seconds.

Once you're ready to integrate, you can revert back to your original configuration for general end-to-end testing before sending a PR or pushing to production.

Installation

The synching functionality of cnd is provided by ksync.

To install ksync, execute:

curl https://vapor-ware.github.io/gimme-that/gimme.sh | bash

and:

ksync init --image=vaporio/ksync:0.3.2-hotfix

check the ksync installation by executing:

ksync doctor

If ksync is successfully installed, install cnd from by executing:

go get github.com/okteto/cnd

Usage

Note: these instructions assume that you already have a kubernetes-based application running.

Define your Cloud Native Development file (cnd.yml). A cnd.yml looks like this:

name: dev
swap:
  deployment:
    file: nginx-deployment.yml
    container: nginx
    image: ubuntu
  service:
    file: nginx-service.yml
mount:
  source: .
  target: /src

For more information about the Cloud Native Development file, see its reference.

To convert your dev environment to a cloud native environment, execute:

cnd up

by default, it uses a cnd.yml in your current folder. For using a different file, execute:

cnd up -f path-to-cnd-file

To create a long-running session to your cloud native environment, execute:

cnd exec sh

You can also execute standalone commands like:

cnd exec go test

In order to revert back to your original configuration, execute:

cnd down

Switch back and forth your development mode as you wish by executing cnd up and cnd down. Finally, in order to permanently remove your cloud native development, execute:

cnd rm

For a full demo of Cloud Native Development, check the Voting App demo.

Troubleshooting

Files are not syncing

cnd uses ksync and syncthing to sync files between your environments. If your cloud native environment is not being updated correctly, review the following:

  1. Verify that ksync is functioning correctly by running ksync doctor
  2. Review ksync's logs (~/.ksync/daemon.log) for errors
  3. Browse to http://localhost:8384 to see if there are any syncthing-specific issues.

Files syncing is slow

Please follow syncthing's docs to troubleshoot this.

cnd's People

Contributors

borjaburgos avatar pchico83 avatar rberrelleza avatar

Watchers

 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.