GithubHelp home page GithubHelp logo

kimtore / naisd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nais/naisd

0.0 3.0 0.0 10.23 MB

nais deployment daemon

Home Page: http://nais.io

License: MIT License

Makefile 1.14% Go 98.56% Shell 0.30%

naisd's Introduction

Naisd

Build Status Go Report Card

k8s in-cluster daemon with API for performing NAIS-operations

Basic outline

  1. HTTP POST to API with name of application, version and environment
  2. Fetches manifest from internal artifact repository
  3. Extract info from yaml
  4. Get and inject environment specific variables from Fasit
  5. Creates appropriate k8s resources

nais cli

The nais cli will help you in validating your nais.yaml, uploading it to Nexus and deploying your application. Very useful for your CI/CD servers.

Basic Usage

Validating

nais validate [flags]

Flags:
  -f, --file string   path to manifest (default "nais.yaml")
  -o, --output        prints full manifest including defaults

Will validate nais.yaml by default. Specify another file using the -f or --file argument.

Will exit with status 0 on success, 1 on failure.

Uploading

nais upload [flags]

Flags:
  -a, --app string        name of your app
  -f, --file string       path to nais.yaml (default "nais.yaml")
  -p, --password string   the password
  -u, --username string   the username
  -v, --version string    version you want to upload

Will upload nais.yaml to Nexus.

The username and password may be specified using environment variable NEXUS_USERNAME and NEXUS_PASSWORD, and the Nexus repo can be specified using NEXUS_URL.

Example: Uploading to Nexus 2:

NEXUS_URL=http://maven.adeo.no/nexus/content/repositories/m2internal ./nais upload --app myapp -v 10

Example: Uploading to Nexus 3:

./nais upload --app myapp -v 10

Deploy

nais deploy [flags]

Flags:
  -a, --app string            name of your app
  -c, --cluster string        the cluster you want to deploy to (default: "preprod-fss")
  -e, --environment string    environment you want to use (default "q0")
  -m, --manifest-url string   alternative URL to the nais manifest
  -n, --namespace string      the kubernetes namespace (default "default")
  -p, --fasit-password string the password
  -u, --fasit-username string the username
  -v, --version string        version you want to deploy
      --wait                  whether to wait until the deploy has succeeded (or failed)
  -z, --zone string           the zone the app will be in (default "fss")

If using default values, only app, version, fasit-username and fasit-password is required.

The username and password may be specified using environment variable FASIT_USERNAME and FASIT_PASSWORD instead.

Installation

Binaries for amd64 Linux, Darwin and Windows are automatically released on every build.

The commands below will assume you have already downloaded a release.

Install Linux/macOS

xz -d nais-<arch>-amd64.xz
mv nais-<arch>-amd64 /usr/local/bin/nais
chmod +x /usr/local/bin/nais

Where <arch> will be linux or darwin.

Windows

Unzip the release and place it somewhere.

CI

on push:

  • run tests
  • produce binary
  • bump version
  • make and publish alpine docker image with binary to dockerhub
  • make and publish corresponding helm chart to quay.io

dev notes

For local development, use minikube. You can run naisd.go with -kubeconfig= for testing without deploying to cluster.

dep ensure

...to fetch dependecies

To reduce build time, do

go build -i .

initially.

naisd's People

Contributors

davidsteinsland avatar gtcno avatar audunstrand avatar frodesundby avatar kyrremann avatar jhrv avatar sechmann avatar linemos avatar sillerud avatar kimtore avatar terjesannum avatar muni10 avatar jan-berge-ommedal avatar akselw avatar eigilhs avatar

Watchers

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