Skip to content

Update helm install for Kubernetes and add new k8s Docker image#3487

Merged
enisoc merged 2 commits intovitessio:helmfrom
derekperkins:docker-binaries
Jan 23, 2018
Merged

Update helm install for Kubernetes and add new k8s Docker image#3487
enisoc merged 2 commits intovitessio:helmfrom
derekperkins:docker-binaries

Conversation

@derekperkins
Copy link
Copy Markdown
Member

The base image in this repo is 3.1 GB, while this is just 140 MB. I'm working on building a helm chart that will allow users to use any base mysql image, which will use this to copy over only the relevant assets. I'd like to set this image to be an automated build, triggered whenever the base image is rebuilt.

@derekperkins
Copy link
Copy Markdown
Member Author

derekperkins commented Dec 20, 2017

@enisoc I'm trying to copy the files to the proper destination, as compared to what you are doing in https://github.com/youtube/vitess/pull/3311/files#diff-17c3a71d3c4514bfd55ea66afbcc3e8dR46. I'm hoping to make the InitContainer as simple as possible, maybe as simple as cp -R / (new container), or maybe mounting this container as a temporary volume.

@derekperkins
Copy link
Copy Markdown
Member Author

This would be handy if it ever gets implemented - kubernetes/kubernetes#831

@jvaidya
Copy link
Copy Markdown
Contributor

jvaidya commented Dec 20, 2017

@derekperkins do you think python client tools/examples belong here?

e.g:

  • py-vtdb
  • dist/grpc/usr/local/lib/python2.7/site-packages
  • ./vitess/examples/local/client.py

@derekperkins
Copy link
Copy Markdown
Member Author

@jvaidya My original thought here was to provide only the bare minimum to run Vitess in production, and to be honest, I'm not familiar with the things that you mentioned. That being said, I only intend on copying those binaries out, so if there was another specific use case where it would be useful to have these other artifacts, and it didn't bloat the container size much, I wouldn't necessarily be opposed.

@derekperkins
Copy link
Copy Markdown
Member Author

derekperkins commented Dec 20, 2017

Here is how I anticipate using this image

FROM vitess/assets as assets

FROM percona:5.7.20

# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/github.com/youtube/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib

# Copy binaries
COPY --from=assets $GOBIN $GOBIN/

# copy web admin files
COPY --from=assets $VTROOT/web $VTROOT/web

# copy vitess config
COPY --from=assets /mnt/config /mnt/config

# Create vitess user
RUN groupadd -r vitess && useradd -r -g vitess vitess && \
   mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt

# Create mount point for actual data (e.g. MySQL data dir)
VOLUME /vt/vtdataroot

@derekperkins derekperkins changed the title docker: add assets image with binaries + web files Update helm install for Kubernetes and add new base Docker image Dec 23, 2017
@derekperkins
Copy link
Copy Markdown
Member Author

derekperkins commented Dec 23, 2017

Some action items from my conversation today with @enisoc and @sougou

  • require that the etcd operator be installed, but the chart will spin up etcd clusters using it
  • stop logging to container files and only ship to stdout/stderr
  • figure out how to make the mysql image agree on a uid with vttablet (@enisoc)

More work on integrating with Orchestrator will happen in a later PR.

@derekperkins derekperkins changed the title Update helm install for Kubernetes and add new base Docker image Update helm install for Kubernetes and add new k8s Docker image Dec 23, 2017
@derekperkins
Copy link
Copy Markdown
Member Author

Here's a discussion related to chowning and root privileges kubernetes/kubernetes#2630 (comment)

@derekperkins derekperkins force-pushed the docker-binaries branch 2 times, most recently from 33d2f7c to d65224a Compare January 3, 2018 06:24
@derekperkins derekperkins force-pushed the docker-binaries branch 3 times, most recently from 43fadf3 to e152f2e Compare January 20, 2018 07:59
@derekperkins
Copy link
Copy Markdown
Member Author

@enisoc This should be ready for final review

This needs to be added to the Docker Hub auto build process
- Allows for custom database images
- Supports MySQL protocol
- Upgrade to etcd2 topology server
- Uses etcd-operator
- Default pod affinity/anti-affinity
- HPA for vtgates
- Pod security context doesn’t allow root privileges
- Supports default credential chains for GCS/S3
- Moves backup and other config to ConfigMap
- Temporarily removes Orchestrator support
- Vitess components log to stdout/stderr only
- MySQL slow/error logs redirected to stdout
- Removed syslog and hostPath mounts
- Uses new vitess:k8s Docker image
- Support regional failure domain affinity
@enisoc enisoc changed the base branch from master to helm January 23, 2018 00:09
@enisoc
Copy link
Copy Markdown
Member

enisoc commented Jan 23, 2018

I've switched this to merge into a new branch, so we can collaborate on the final form without breaking master in the meantime.

LGTM

Approved with PullApprove

@enisoc enisoc merged commit 6775d26 into vitessio:helm Jan 23, 2018
@derekperkins derekperkins deleted the docker-binaries branch January 23, 2018 00:25
@enisoc enisoc mentioned this pull request Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants