Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial version of Trillian Kubernetes application #302

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8585e19
Add configs for deploying Trillian onto Kubernetes via Google Cloud M…
Oct 12, 2018
d877eff
remove "imagePullPolicy: Always"
Nov 26, 2018
f6812dc
Add --enable-autoscaling flag to cluster creation command
Nov 29, 2018
317e12b
Remove prometheus-to-sd
Nov 29, 2018
36bf9af
Regenerate cloudbuild.yaml
Nov 30, 2018
e9c329f
Add machine type and min/max nodes flags to cluster creation command
Dec 3, 2018
02323e5
Correct name of IMAGE_ETCD_OPERATOR_FIELD in APP_PARAMETERS in Makefile
Jan 7, 2019
3565b13
Add missing EtcdCluster entry to app CRD componentKinds
Jan 7, 2019
e2b0257
Remove braces from environment variable names
Jan 7, 2019
a2d1083
Makefile: Use v1.2.1 of Trillian instead of latest version
Jan 7, 2019
287b90d
Add/improve descriptions in trillian/schema.yaml
Jan 7, 2019
45775ee
Set maximum for etcd cluster size in trillian/schema.yaml
Jan 7, 2019
8b501cc
Add clusterConstraints to trillian/schema.yaml
Jan 7, 2019
2d8e2d6
Remove -cluster-wide option from etcd-operator
Jan 7, 2019
8a35c4f
Provide links in trillian/schema.yaml to the Etcd RBAC docs and examples
Jan 7, 2019
5a0d2c9
Add regex for ETCD_VERSION in trillian/schema.yaml
Jan 7, 2019
e6264a4
Remove List wrapper around ConfigMap
Jan 9, 2019
03beff3
Remove Lists and duplicate labels
Jan 9, 2019
a87a3c0
Mirror etcd-operator image in $REGISTRY
Jan 21, 2019
2e239cc
Add 500GiB of persistent storage for MySQL database
Jan 21, 2019
7b7fbf8
Remove --resign_odds flag from logsigner
Jan 21, 2019
547688e
Increase default size of Etcd cluster to 5
Jan 28, 2019
dcc0db6
Do not delete Secrets when uninstalling Trillian
Feb 1, 2019
d91c6d8
Remove EtcdCluster from Trillian app.yaml
Feb 1, 2019
9afd70b
Make the Busybox image used by etcd-operator configurable
Feb 19, 2019
d72653b
Prefer Etcd cluster members to be scheduled on different Kubernetes n…
Feb 19, 2019
7c5ce25
Make the image used by Etcd cluster members configurable
Feb 19, 2019
3c4e7e6
Make the MySQL passwords configurable via Makefile
Feb 19, 2019
968c54d
Add README sections on scaling, backup & restore, and uninstallation
Feb 21, 2019
31561ee
Fix service name in port-forwarding section of README
Feb 21, 2019
fa9d190
Use correct tag in Trillian README
Feb 25, 2019
ce9315a
Remove unnecessary quotation marks
Feb 25, 2019
6311297
Add labels to Etcd cluster pods
Feb 25, 2019
45a595a
Remove documentation referring to "expanded manifest file"
Feb 25, 2019
086d9cf
Consistently use $APP_INSTANCE_NAME instead of $NAME
Feb 25, 2019
f8a67e0
Document the need to create a namespace if not using "default"
Feb 25, 2019
be200d3
Require Etcd cluster pods to be scheduled on different nodes
Feb 25, 2019
2805e47
Reduce maximum size of Etcd cluster from 9 to 7
Feb 25, 2019
0c431df
Document how to delete Etcd entirely during uninstallation
Feb 25, 2019
3ad97fe
Document how to delete secrets
Feb 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,24 @@ steps:
- -j4
- app/verify

- id: Verify trillian
name: gcr.io/cloud-marketplace-tools/k8s/dev:local
waitFor:
- Copy kubectl Credentials
- Copy gcloud Credentials
- Pull Dev Image
env:
- 'KUBE_CONFIG=/workspace/.kube'
- 'GCLOUD_CONFIG=/workspace/.config/gcloud'
# Use local Docker network named cloudbuild as described here:
# https://cloud.google.com/cloud-build/docs/overview#build_configuration_and_build_steps
- 'EXTRA_DOCKER_PARAMS=--net cloudbuild'
dir: k8s/trillian
args:
- make
- -j4
- app/verify

- id: Verify wordpress
name: gcr.io/cloud-marketplace-tools/k8s/dev:local
waitFor:
Expand Down
141 changes: 141 additions & 0 deletions k8s/trillian/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
include ../app.Makefile
include ../crd.Makefile
include ../gcloud.Makefile
include ../var.Makefile

NAME ?= trillian-1
TAG ?= 1.2.1
APP_DEPLOYER_IMAGE ?= $(REGISTRY)/trillian/deployer:$(TAG)
# Default Busybox image used by etcd-operator:
# https://github.com/coreos/etcd-operator/blob/16f0e1b3693483061f2a8252c0e361b06d216424/pkg/util/k8sutil/k8sutil.go#L64
BUSYBOX_IMAGE ?= busybox:1.28.0-glibc
ETCD_OPERATOR_IMAGE ?= quay.io/coreos/etcd-operator:v0.9.1
ETCD_REPOSITORY ?= quay.io/coreos/etcd
ETCD_VERSION ?= 3.2.13

ifdef IMAGE_TRILLIAN_LOGSERVER
IMAGE_TRILLIAN_LOGSERVER_FIELD = , "IMAGE_TRILLIAN_LOGSERVER": "$(IMAGE_TRILLIAN_LOGSERVER)"
endif

ifdef IMAGE_TRILLIAN_LOGSIGNER
IMAGE_TRILLIAN_LOGSIGNER_FIELD = , "IMAGE_TRILLIAN_LOGSIGNER": "$(IMAGE_TRILLIAN_LOGSIGNER)"
endif

ifdef IMAGE_MYSQL
IMAGE_MYSQL_FIELD = , "IMAGE_MYSQL": "$(IMAGE_MYSQL)"
endif

ifdef MYSQL_ROOT_PASSWORD
MYSQL_ROOT_PASSWORD_FIELD = , "MYSQL_ROOT_PASSWORD": "$(MYSQL_ROOT_PASSWORD)"
endif

ifdef MYSQL_TRILLIAN_PASSWORD
MYSQL_TRILLIAN_PASSWORD_FIELD = , "MYSQL_TRILLIAN_PASSWORD": "$(MYSQL_TRILLIAN_PASSWORD)"
endif

ifdef ETCD_VERSION
ETCD_VERSION_FIELD = , "ETCD_VERSION": "$(ETCD_VERSION)"
endif

APP_PARAMETERS ?= { \
"APP_INSTANCE_NAME": "$(NAME)", \
"NAMESPACE": "$(NAMESPACE)" \
$(IMAGE_TRILLIAN_LOGSERVER_FIELD) \
$(IMAGE_TRILLIAN_LOGSIGNER_FIELD) \
$(IMAGE_MYSQL_FIELD) \
$(MYSQL_ROOT_PASSWORD_FIELD) \
$(MYSQL_TRILLIAN_PASSWORD_FIELD) \
$(ETCD_VERSION_FIELD) \
}
APP_TEST_PARAMETERS ?= {}


app/build:: .build/trillian/busybox \
.build/trillian/db_server \
.build/trillian/deployer \
.build/trillian/etcd_operator \
.build/trillian/etcd \
.build/trillian/log_server \
.build/trillian/log_signer


.build/trillian: | .build
mkdir -p "$@"


.build/trillian/busybox: .build/var/REGISTRY \
.build/var/TAG \
| .build/trillian
docker pull "$(BUSYBOX_IMAGE)"
docker tag "$(BUSYBOX_IMAGE)" \
"$(REGISTRY)/trillian/busybox:$(TAG)"
docker push "$(REGISTRY)/trillian/busybox:$(TAG)"
@touch "$@"


.build/trillian/db_server: .build/var/REGISTRY \
.build/var/TAG \
| .build/trillian
docker pull gcr.io/trillian-opensource-ci/db_server:$(TAG)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please take a look at the versioning of images at gcr.io/trillian-opensource-ci? It looks like we have there tags matching the commits, not semantic versions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have both - there's a tag for every commit to master, as well as a tag for every released version.

docker tag gcr.io/trillian-opensource-ci/db_server:$(TAG) \
"$(REGISTRY)/trillian/db_server:$(TAG)"
docker push "$(REGISTRY)/trillian/db_server:$(TAG)"
@touch "$@"


.build/trillian/deployer: deployer/* \
manifest/* \
schema.yaml \
.build/var/APP_DEPLOYER_IMAGE \
.build/var/REGISTRY \
.build/var/TAG \
| .build/trillian
docker build \
--build-arg REGISTRY="$(REGISTRY)/trillian" \
--build-arg TAG="$(TAG)" \
--build-arg MARKETPLACE_TOOLS_TAG="$(MARKETPLACE_TOOLS_TAG)" \
--tag "$(APP_DEPLOYER_IMAGE)" \
-f deployer/Dockerfile \
.
docker push "$(APP_DEPLOYER_IMAGE)"
@touch "$@"


.build/trillian/etcd_operator: .build/var/REGISTRY \
.build/var/TAG \
| .build/trillian
docker pull "$(ETCD_OPERATOR_IMAGE)"
docker tag "$(ETCD_OPERATOR_IMAGE)" \
"$(REGISTRY)/trillian/etcd_operator:$(TAG)"
docker push "$(REGISTRY)/trillian/etcd_operator:$(TAG)"
@touch "$@"


.build/trillian/etcd: .build/var/REGISTRY \
.build/var/TAG \
| .build/trillian
docker pull "$(ETCD_REPOSITORY):v$(ETCD_VERSION)"
docker tag "$(ETCD_REPOSITORY):v$(ETCD_VERSION)" \
"$(REGISTRY)/trillian/etcd:v$(ETCD_VERSION)"
docker push "$(REGISTRY)/trillian/etcd:v$(ETCD_VERSION)"
@touch "$@"


.build/trillian/log_server: .build/var/REGISTRY \
.build/var/TAG \
| .build/trillian
docker pull gcr.io/trillian-opensource-ci/log_server:$(TAG)
docker tag gcr.io/trillian-opensource-ci/log_server:$(TAG) \
"$(REGISTRY)/trillian/log_server:$(TAG)"
docker push "$(REGISTRY)/trillian/log_server:$(TAG)"
@touch "$@"


.build/trillian/log_signer: .build/var/REGISTRY \
.build/var/TAG \
| .build/trillian
docker pull gcr.io/trillian-opensource-ci/log_signer:$(TAG)
docker tag gcr.io/trillian-opensource-ci/log_signer:$(TAG) \
"$(REGISTRY)/trillian/log_signer:$(TAG)"
docker push "$(REGISTRY)/trillian/log_signer:$(TAG)"
@touch "$@"
Loading