Skip to content
No description, website, or topics provided.
Python Shell Dockerfile Makefile
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.cloudbuild Correctly exclude pre-release tags (#372) Jun 25, 2019
crd Allow 'Feature' release type (#364) Jun 6, 2019
docs Remove missed line on primary app image requirement (#473) Jan 17, 2020
marketplace Increasing test coverage for provision.py (#472) Jan 17, 2020
scripts Make OwnerRefs handle cleanup of deployer's RBAC resources (#460) Jan 7, 2020
tests Validate partner and solution ID (#449) Jan 15, 2020
.gitignore Add unit test coverage to make tests/py (#462) Jan 8, 2020
.gitmodules Pull ubbagent from https endpoint (rather than ssh). (#191) Jul 26, 2018
.travis.yml Makefile refactoring. (#265) Nov 15, 2018
Contributing.md Initial commit. Feb 20, 2018
LICENSE Initial commit. Feb 20, 2018
Makefile Makefile refactoring. (#265) Nov 15, 2018
README.md Validate partner and solution ID (#449) Jan 15, 2020
cloudbuild-tag-prerelease.yaml Declare substitutions (#357) May 24, 2019
cloudbuild-tag.yaml Declare substitutions (#357) May 24, 2019
cloudbuild.yaml Validate partner and solution ID (#449) Jan 15, 2020
common.Makefile Makefile refactoring. (#265) Nov 15, 2018
crd.Makefile Add KALM crd to make crd/install target (#378) Jul 1, 2019
gcloud.Makefile Developer experience adjustments to tools. (#109) May 25, 2018
marketplace.Makefile Add helm_onbuild target to marketplace.Makefile (#421) Nov 11, 2019
tests.Makefile Add unit test coverage to make tests/py (#462) Jan 8, 2020
var.Makefile Remove MARKETPLACE_TOOLS_PATH references. (#258) Nov 5, 2018

README.md

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:marketplace-dev-robot@PROJECT-ID.iam.gserviceaccount.com \
  --role roles/editor

gcloud projects add-iam-policy-binding PROJECT-ID \
  --member serviceAccount:marketplace-dev-robot@PROJECT-ID.iam.gserviceaccount.com \
  --role roles/container.admin

The created Service Account email will be marketplace-dev-robot@PROJECT-ID.iam.gserviceaccount.com. 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 marketplace-dev-robot@PROJECT-ID.iam.gserviceaccount.com

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
You can’t perform that action at this time.