Skip to content
A Crossplane resource pack for a minimal GCP setup
Shell Dockerfile Makefile
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.registry Remove Environment terminology Apr 2, 2020
hack Rename to stack-gcp-sample Apr 1, 2020
kustomize fix names of the resource classes Mar 3, 2020
.gitignore Update go.sum Feb 4, 2020
Dockerfile app.yaml and behavior.yaml are in place Feb 12, 2020
Jenkinsfile.branch shared jobs: update repo url Feb 20, 2020
Jenkinsfile.continuous shared jobs: update repo url Feb 20, 2020
Jenkinsfile.publish shared jobs: update repo url Feb 20, 2020
Jenkinsfile.tag shared jobs: update repo url Feb 20, 2020
Makefile Rename to stack-gcp-sample Apr 1, 2020
README.md Remove Environment terminology Apr 2, 2020
example.yaml Rename resourcepacks to stacks Apr 1, 2020

README.md

GCP Sample Stack

You can use this stack to spin up a private network as well as resource classes that will let you provision resources in that network.

Installation

Requirements:

  • Crossplane should be installed.
  • GCP Provider should be installed and its version should be at least 0.7.0

If you have crossplane-cli installed, you can use the following command to install:

# Do not forget to change <version> with the correct version.
kubectl crossplane stack install --cluster -n crossplane-system 'crossplane/stack-gcp-sample:<version>' gcp-sample

If you don't have crossplane-cli installed, you need to create the following YAML to install:

apiVersion: stacks.crossplane.io/v1alpha1
kind: ClusterStackInstall
metadata:
  name: "gcp-sample"
  namespace: crossplane-system
spec:
  package: "crossplane/stack-gcp-sample:<version>"

Usage Instructions

You can create the following YAML to trigger creation of

and the following resource classes with minimal hardware requirements that will let you create instances that are connected to that network.

apiVersion: gcp.stacks.crossplane.io/v1alpha1
kind: GCPSample
metadata:
  name: test
spec:
  region: us-west2
  projectID: crossplane-playground
  credentialsSecretRef:
    name: gcp-account-creds
    namespace: crossplane-system
    key: credentials

In Crossplane, the resource classes that are annotated with resourceclass.crossplane.io/is-default-class: "true" are used as default if the claim doesn't specify a resource class selector. The resource classes you create via the GCPSample instance above will deploy all of its resource classes as default. If you'd like those defaulting annotations to be removed, you need to add the following to GCPSample instance above:

templatestacks.crossplane.io/remove-defaulting-annotations: true

Build

Run make

Test Locally

Minikube

Run make and then run the following command to copy the image into your minikube node's image registry:

# Do not forget to specify <version>
docker save "crossplane/stack-gcp-sample:<version>" | (eval "$(minikube docker-env --shell bash)" && docker load)

After running this, you can use the installation command and the image loaded into minikube node will be picked up.

You can’t perform that action at this time.