The Shipyard project provides common tooling for creating K8s clusters with KIND (K8s in Docker) and provides a common Go framework for creating end to end tests. Shipyard contains common functionality shared by other projects. Any project specific functionality should be part of that project.
A base image
quay.io/submariner/shipyard-dapper-base is created from Shipyard and contains all the tooling to build other projects and run
tests in a consistent environment.
Shipyard has several folders at the root of the project:
Shipyard ships with some Makefile targets which can be used by consuming projects and are used by Shipyard’s CI to test and validate itself. It also has some specific Makefile targets which are used by the project itself.
To enable usage of Shipyard’s functionality, please see Adding Shipyard to a Project.
Once Shipyard has been added to a project, you can use any of the Makefile targets that it provides.
Any variables that you need to pass to these targets should be specified in your Dockerfile.dapper so they’re available in the Dapper environment. For example:
ENV DAPPER_ENV="REPO TAG QUAY_USERNAME QUAY_PASSWORD TRAVIS_COMMIT CLUSTERS_ARGS DEPLOY_ARGS"
Having any of the Shipyard Makefile targets rely on your project’s specific targets can be done easily by adding the dependency in your project’s Makefile. For example:
clusters: build images
If you’ve made changes to Shipyard’s base image and need to test them in your project, run:
in the Shipyard directory. This creates a local image with your changes available for consumption in other projects.
Shipyard ships a Makefile.inc file which defines these basic targets:
If your project uses Shipyard then it has all these targets and supports all the variables these targets support.
Any variables supported by these targets can be either declared as environment variables or assigned on the
make command line (takes
precedence over environment variables).
A Make target that creates a KIND-based multi-cluster environment with just the default K8s deployment:
clusters.shscript. To get a list of available arguments, run:
A Make target that deploys Submariner components in a KIND-based cluster environment (if one isn’t created yet, this target will first invoke the clusters target to do so):
deploy.shscript. To get a list of available arguments, run:
To clean up all the KIND clusters deployed in any of the previous steps, use:
This command will remove the clusters and any resources that might’ve been left in docker that are not needed any more (images, volumes, etc).
Uploads the built images to Quay.io:
make release release_images="<image name>"
Shipyard has some project-specific targets which are used to build parts of the projects:
Builds the basic image which is then used by other projects to build the code and run tests: