GithubHelp home page GithubHelp logo

matt-jns / marketplace-k8s-app-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlecloudplatform/marketplace-k8s-app-tools

0.0 0.0 0.0 1.67 MB

License: Apache License 2.0

Shell 14.99% Python 76.35% Makefile 6.48% Dockerfile 2.18%

marketplace-k8s-app-tools's Introduction

Overview

This repository contains a set of tools supporting the development of Kubernetes applications deployable via Google Cloud Marketplace.

Getting Started

See the how to build your application deployer documentation.

References

Examples

  • The marketplace-k8s-app-example repository contains example applications.

  • The click-to-deploy repository contains more examples. This is the source code backing Google Click to Deploy Kubernetes applications listed on Google Cloud Marketplace.

Coding style

We follow Google's coding style guides.

Development

Setting up

Log in gcloud with a Service Account

Instead of using your personal credential to log in, it's recommended to use a Service Account instead.

A new Service Account and proper permissions can be created using the following commands. PROJECT-ID is the (non-numeric) identifier of your GCP project. This assumes that you're already logged in with gcloud.

gcloud iam service-accounts create \
  marketplace-dev-robot \
  --project PROJECT-ID \
  --display-name "GCP Marketplace development robot"

gcloud projects add-iam-policy-binding PROJECT-ID \
  --member serviceAccount:[email protected] \
  --role roles/editor

gcloud projects add-iam-policy-binding PROJECT-ID \
  --member serviceAccount:[email protected] \
  --role roles/container.admin

The created Service Account email will be [email protected]. Note that you can replace marketplace-dev-robot with another name.

Now you can switch gcloud to using the Service Account by creating and downloading a one-time key, and activate it.

gcloud iam service-accounts keys create ~/marketplace-dev-robot-key.json \
  --iam-account [email protected]

gcloud auth activate-service-account \
  --key-file ~/marketplace-dev-robot-key.json

You should keep ~/marketplace-dev-robot-key.json credential key in a safe location. Note that this is the only copy; the generated key cannot be downloaded again.

Log in application default credentials for kubectl

kubectl connecting to GKE requires application default credentials. Log in using the following command:

gcloud auth application-default login

Running the doctor command

At the very least, you need to connect to a GKE cluster. Follow this instruction to ensure you have a properly setup environment.

Run tests locally

Run unit tests:

make tests/py

Run integration tests:

make tests/integration

Build deployers locally

Set deployers container tag:

export MARKETPLACE_TOOLS_TAG=local-$USER

Build container images:

make marketplace/build

marketplace-k8s-app-tools's People

Contributors

huyhg avatar trironkk avatar eshiroma avatar vcanaa avatar gibbleyg avatar wgrzelak avatar deustis avatar jprzychodzen avatar khajduczenia avatar nimishc avatar agarg2008 avatar andreychoi avatar danhipke avatar jvolkman avatar brendanlundy avatar danielmkn avatar janetkuo avatar lwander avatar geofrau avatar thiagolacerda avatar tieske avatar wendyqian11 avatar ukclivecox avatar erikcandeia avatar ovk6 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.