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

Update Docker and Kubernetes scripts #861

Merged
merged 14 commits into from Nov 24, 2017

Conversation

Projects
None yet
3 participants
@gdbelvin
Collaborator

gdbelvin commented Nov 22, 2017

This PR updates all the necessary components to get the following commands working again:

  • docker-compose up
  • kubectl apply -f deploy/kubernetes/.

The PR contains the following changes:

  • Build and push images with docker-compose
    • No more complicated setup scripts
  • Generate kubernetes configs with kompose convert
    • No more complex, hand-crafted files.
  • Initialize default domain with an init container.
    • No more exposed ports from Trillian Logs and Maps
    • No more complex setup scripts and json parsing
  • One line server setup command, updated README.

@gdbelvin gdbelvin requested review from phad and cesarghali Nov 22, 2017

@gdbelvin gdbelvin changed the title from Kube to Update Docker and Kubernetes scripts Nov 22, 2017

@phad

I'm not at all familiar with Kubernetes so can't really comment usefully on this PR.

name: log-server
spec:
ports:
- name: "8090"

This comment has been minimized.

@phad

phad Nov 22, 2017

Contributor

looks odd - why name the port with a stringified number? can't you give it a more meaningful label?

@phad

phad Nov 22, 2017

Contributor

looks odd - why name the port with a stringified number? can't you give it a more meaningful label?

This comment has been minimized.

@RJPercival

RJPercival Nov 24, 2017

Member

This file has been generated from docker-compose.yml, which doesn't allow ports to be given names unfortunately.

@RJPercival

RJPercival Nov 24, 2017

Member

This file has been generated from docker-compose.yml, which doesn't allow ports to be given names unfortunately.

@gdbelvin gdbelvin requested a review from RJPercival Nov 23, 2017

Show outdated Hide outdated README.md Outdated

gdbelvin added some commits Nov 9, 2017

Update docker-compose
This updates docker-compose so that it supports a single-line cluster
bring up.
- docker-compose up -d
- Auto initializes with an init container
- Changed service names to have `-` rather than `_` to be kubernetes
compatable.
- docker-compose is now fully kompose compatible.
@gdbelvin

This comment has been minimized.

Show comment
Hide comment
@gdbelvin

gdbelvin Nov 24, 2017

Collaborator

Updated. PTAL.

Collaborator

gdbelvin commented Nov 24, 2017

Updated. PTAL.

@google google deleted a comment from codecov-io Nov 24, 2017

image: us.gcr.io/key-transparency/prometheus
- server
- sequencer
image: us.gcr.io/key-transparency/prometheus:latest

This comment has been minimized.

@RJPercival

RJPercival Nov 24, 2017

Member

Isn't the "latest" tag used by default?

@RJPercival

RJPercival Nov 24, 2017

Member

Isn't the "latest" tag used by default?

This comment has been minimized.

@gdbelvin

gdbelvin Nov 24, 2017

Collaborator

It is, but there's a strange issue..
Kubernetes will only pull the latest image if latest is specified but I had difficulty getting Kubernetes to pull a fresh image without the :latest tag.

@gdbelvin

gdbelvin Nov 24, 2017

Collaborator

It is, but there's a strange issue..
Kubernetes will only pull the latest image if latest is specified but I had difficulty getting Kubernetes to pull a fresh image without the :latest tag.

This comment has been minimized.

@RJPercival

RJPercival Nov 24, 2017

Member

Ah that could be because you aren't specifying an ImagePullPolicy (https://kubernetes.io/docs/concepts/configuration/overview/#container-images).

@RJPercival

RJPercival Nov 24, 2017

Member

Ah that could be because you aren't specifying an ImagePullPolicy (https://kubernetes.io/docs/concepts/configuration/overview/#container-images).

@@ -67,44 +67,46 @@ services:
- --batch_size=50
- --force_master=true
- --alsologtostderr
ports:
- "8091"

This comment has been minimized.

@RJPercival

RJPercival Nov 24, 2017

Member

No longer need port 8092?

@RJPercival

RJPercival Nov 24, 2017

Member

No longer need port 8092?

This comment has been minimized.

@gdbelvin

gdbelvin Nov 24, 2017

Collaborator

All the Trillian processes expose 8090 and 8091. To avoid port clashing I was mapping this to 8092 so an external initialization script could create a Trillian Log. Now that I'm initializing things with a docker init container, these ports no longer need to be exposed.

In this configuration Kubernets will make the port available internally to the cluster, and docker-compose will pick a random host port to map 8091 to.

@gdbelvin

gdbelvin Nov 24, 2017

Collaborator

All the Trillian processes expose 8090 and 8091. To avoid port clashing I was mapping this to 8092 so an external initialization script could create a Trillian Log. Now that I'm initializing things with a docker init container, these ports no longer need to be exposed.

In this configuration Kubernets will make the port available internally to the cluster, and docker-compose will pick a random host port to map 8091 to.

@gdbelvin gdbelvin merged commit 808d4b9 into google:master Nov 24, 2017

2 checks passed

cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@gdbelvin gdbelvin deleted the gdbelvin:kube branch Nov 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment