PROJECT ARCHIVED
Before creating the infrastructure and start processing articles make sure to walk over the following sections of this chapter.
After that go a head to the next chapter Project lifecycle.
go
for application logic is used: installation guidepulumi
as infrastructure as code (IaC) tool is used: installation guidenode
andnpm
is used to describe Pulumi IaC: installation guidegcloud
CLI is used to access resources created in gcp: installation guide, Make sure to rungcloud init
&gcloud auth application-default login
kubectl
is used to interact with created kubernetes clusters: installation guidetask
is used instead of a makefile to install, verify, build and in general maintain the project: installation guideprotoc
is used to compile proto3 api file: installation guideprotoc-gen-go
:$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
gPRC quickstartprotoc-gen-go-grpc
:$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
gPRC quickstart
ko
to build container images: installation guidegrype
for vulnerability scanning: installation guide
You can check if installations are met by running sh ./scripts/check-installations.sh
or task verify:check
.
$ task -l
task: Available tasks for this project:
* deploy:container-image-push: Push a golang container to quay.io
* deploy:pull-whopper-config: Pull kubeconfig to access whopper cluster
* deploy:whopper: Deploy whopper infrastructure with pulumi
* destroy:cleanup-project: Delete all created it resources
* destroy:whopper: Destroy the whopper infrastructure
* init-project: Initialize project for production
* kubectl-o: kubectl wrapper to interact with operator cluster
* kubectl-w: kubectl wrapper to interact with the whopper cluster
* scan:whopper-cluster: Kubernetes cluster scan
* test:whopper-cluster: Whopper kubernetes tests
* verify-project: Run all checks to verify project quality
* verify:code: Verify project code
* verify:go: Verify project golang code
* verify:install: Install and update project dependencies
* verify:ts: Verify project typescript code
Additional information can be get by setting the --summary
flag.
Example:
$ task --summary verify:go
task: verify:go
Verify project golang code
commands:
- Task: verify:check-go-build
- Task: verify:check-go-mod
- Task: verify:check-golangci-lint
- Task: verify:test-go-unit
A couple of environment variables are required.
- Export you pulumi access token as environment variable
PULUMI_ACCESS_TOKEN
. - Make sure
GOPATH
is set. It usually points to/home/<user>/go
- Set
DEFAULT_GOOGLE_PROJECT
to your GCP profile id
!! Does not work on Windows !! I suggest using Linux or Macos. You can spin up virtual linux machine using VirtualBox or any other virtualization tool.
To install depenencies locally use the task file run task verify:install
This will do the following this for you:
- Install go libraries
- Install npm libraries locally
- Clone project googleapi which is used to build parts of the whopper api (see api proto3 file)
- Compile proto3 golang code
The lifecycle of this project is desirbed in more detail in one of the docs documents see docs/project-lifecycle.
A brief summary of each phase is given in the sections:
Setup infrastructure for the fist time. There are two different types of infrastructure deployments.
- Production deployment: The production deployment is on going and uses the pulumi kubernetes operator. The operator watches the
main
branch for updates. Production infrastructure is build to stay with rolling blue-green updates. The tasktask init-project
is used to set up the project inititially. - Feature test deployment: The feature test deployment is a short term infrastructure test. It is used whenever a commit is pushed to any other branch then main. The infrastructure is deployed, tested and then destroyed. If these phases succeed without any error the feature is considered "bug free" and can be merged to
main
. The tasktask deploy:whopper
can be used to deploy the whopper infrastructure to a pulumi stack with the name of the current branch.
operation
...
Tasks available to clean up the infrastructure:
task destroy:cleanup-project
to destroy themain
project including the whopper infrastructure with the pulumi operator and the operator cluster.task destroy:whopper
to the destroy the whopper infrastructure with the stack name of the current branch.
More information can be found in the
/docs
folder.