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

Use debian-base image from kubernetes repository as base for NPD. #160

Merged
merged 1 commit into from
Feb 26, 2018
Merged

Use debian-base image from kubernetes repository as base for NPD. #160

merged 1 commit into from
Feb 26, 2018

Conversation

filbranden
Copy link
Contributor

@filbranden filbranden commented Feb 14, 2018

This image is based on Debian Stretch (9) which has a recent version of systemd libraries that includes all necessary compression algorithms.

I propose using that image unconditionally (instead of Alpine when journald is disabled) since the image size with debian-base is not that much of a concern anymore.

FTR, I didn't really test this...

This is analogous to a change we're pushing to fluentd-gcp container in GoogleCloudPlatform/k8s-stackdriver#101

@Random-Liu

Cheers,
Filipe


This change is Reviewable

This image is based on Debian Stretch (9) which has a recent version of
systemd libraries that includes all necessary compression algorithms.

I propose using that image unconditionally (instead of Alpine when
journald is disabled) since the image size with debian-base is not that
much of a concern anymore.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 14, 2018
@tallclair
Copy link
Member

Thanks! /lgtm

Copy link
Member

@Random-Liu Random-Liu left a comment

Choose a reason for hiding this comment

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

LGTM other than the comment

ifeq ($(ENABLE_JOURNALD), 1)
# Enable journald build tag.
BUILD_TAGS:=-tags journald
# Use fedora because it has newer systemd version (229) and support +LZ4. +LZ4 is needed
# on some os distros such as GCI.
BASEIMAGE:=fedora
Copy link
Member

Choose a reason for hiding this comment

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

Can we only replace this one?
alpine:3.4 is ~4mb.
gcr.io/google-containers/debian-base-amd64:0.3 is ~40mb.

I feel like we should use smaller image if we don't need journald support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel like we should use smaller image if we don't need journald support.

A few points I have against that:

  1. Every relevant Linux distribution uses systemd nowadays, so the point of supporting no journal is kind of moot to me...

  2. We already use debian-base-amd:0.3 as base layer for other images (such as fluentd-gcp, etc.) so reusing it might actually reduce overall disk usage since they're all sharing from the same base.

  3. Supporting two builds means this needs more testing, it's likely we might end up breaking one but not the other, which might go unnoticed as one of them is seldom or never used... Let's try to reduce overall complexity.

Having said that, if you really insist, I think it's OK to keep using Alpine for no journald... Let me know if you really want to keep Alpine for the non-journal case.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with all @filbranden 's points.

Copy link
Member

@Random-Liu Random-Liu Feb 26, 2018

Choose a reason for hiding this comment

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

Every relevant Linux distribution uses systemd nowadays, so the point of supporting no journal is kind of moot to me...

We have the no-journal support because we were still using containerVM at that time.

I still think we should support no journal, because journal support:

  • need lib-systemd-dev to build;
  • will make the binary non-static.

I still prefer making it possible to have a simple statically linked binary for users who don't use journal, e.g. people may use this in LinuxKit.

As for the base image, as long as BASEIMAGE is over-writable, I'm fine with always using gcr.io/google-containers/debian-base-amd64:0.3 as the default base image to reduce the maintenance overhead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this PR still does what you suggested... It still keeps the ENABLE_JOURNALD variable and sets build tags appropriately in those cases. So, good to merge?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah :)

@Random-Liu
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 26, 2018
@Random-Liu Random-Liu merged commit 24ae2d8 into kubernetes:master Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants