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

CRI: Enable custom infra container image #33488

Merged
merged 1 commit into from
Oct 4, 2016

Conversation

resouer
Copy link
Contributor

@resouer resouer commented Sep 26, 2016

A minor fix to enable custom infra container image ref #29478

  • Need to address:
    Not sure how do deal with infra image credential, leave it as it is today. Should we allow user to specify credentials in pod yaml?

This change is Reviewable

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Sep 26, 2016
@resouer
Copy link
Contributor Author

resouer commented Sep 27, 2016

@k8s-bot e2e test this please #33175

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 27, 2016
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 28, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins GKE smoke e2e failed for commit 555f957. Full PR test history.

The magic incantation to run this job again is @k8s-bot gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

XXX_unrecognized []byte `json:"-"`
Linux *LinuxPodSandboxConfig `protobuf:"bytes,8,opt,name=linux" json:"linux,omitempty"`
// Optional custom image of pod's infra container
PodInfraContainerImage *string `protobuf:"bytes,9,opt,name=podInfraContainerImage" json:"podInfraContainerImage,omitempty"`
Copy link
Member

@Random-Liu Random-Liu Sep 28, 2016

Choose a reason for hiding this comment

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

I'm not sure whether we want to pass this through CRI. At least, currently infra container is a docker specific thing.

IIRC, we can only specify infra container image per-node not per-container, if so I feel like we should pass this to dockershim when creating docker service instead of passing through CRI.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, "infra" image is a docker-specific implementation detail. I think we'll be better off passing this to the internal DockerService for now, and eventually this should be configured directly for the CRI shim (either through flags or a configuartion file).

Copy link
Member

Choose a reason for hiding this comment

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

hmm, only passing PodInfraContainerImage to dockershim is enough. It shouldn't be part of CRI.

@Random-Liu Random-Liu added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Sep 28, 2016
@Random-Liu Random-Liu assigned Random-Liu and yujuhong and unassigned vishh Sep 28, 2016
@Random-Liu
Copy link
Member

Not sure how do deal with infra image credential, leave it as it is today. Should we allow user to specify credentials in pod yaml?

We have an issue discussing this before #22344.

@vishh
Copy link
Contributor

vishh commented Sep 28, 2016

I don't see why the infra container needs to be in kubelet. It is a runtime specific implementation detail. I'd also not recommend making custom infra containers a legit thing, because we intend to make infra containers init daemons in the future.

@yujuhong
Copy link
Contributor

I don't see why the infra container needs to be in kubelet. It is a runtime specific implementation detail. I'd also not recommend making custom infra containers a legit thing, because we intend to make infra containers init daemons in the future.

As @Random-Liu mentioned above, infra container is a docker-specific implementation detail. The issue was to support the current behavior in the CRI shim for docker, not via the API.

As for "custom" infra containers, this is already a thing since we have a kubelet flag for it, and there are users relying on it. I don't see how we can suddently stop supporting it.
If infra container is a runtime implementation detail, I don't think we can make infra containers init daemons.

@feiskyer
Copy link
Member

Agree with @yujuhong, the infra container image feature shouldn't be dropped, but it also shouldn't be part of CRI. I think pass the image to dockershim directly in kubelet is ok.

@resouer
Copy link
Contributor Author

resouer commented Sep 30, 2016

Will use http://kubernetes.io/docs/user-guide/images/#configuring-nodes-to-authenticate-to-a-private-repository to deal with credentials, and move commits to DockerService

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 30, 2016
@resouer resouer force-pushed the infra-image branch 2 times, most recently from d6275a2 to b8013d2 Compare October 2, 2016 21:33
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 2, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins GCE Node e2e failed for commit b8013d2. Full PR test history.

The magic incantation to run this job again is @k8s-bot node e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins Kubemark GCE e2e failed for commit b8013d2. Full PR test history.

The magic incantation to run this job again is @k8s-bot kubemark e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@resouer
Copy link
Contributor Author

resouer commented Oct 3, 2016

The result of Jenkins Kubemark has no clue for what's failing ...

@yujuhong
Copy link
Contributor

yujuhong commented Oct 3, 2016

@resouer this is #33867. I don't think the kubemark suite is blocking, so just ignore the failure for now.

// (with credentials)?
image := defaultSandboxImage
var (
image string
Copy link
Member

Choose a reason for hiding this comment

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

Why not var image string?

@Random-Liu
Copy link
Member

LGTM with one nit.

var (
image string
)
infraContainerImage := ds.podInfraContainerImage
Copy link
Contributor

Choose a reason for hiding this comment

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

You can simplify line 48 to 56 by doing

image := defaultSandboxImage
if len(infraContainerImage) != 0 {
    image = infraContainerImage
}

image = defaultSandboxImage
}

// NOTE(harryz) Assume user to handle custom pod infra container image pulling by following:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a TODO or just a regular comment? If it's the latter, there is no need to add your name here (as there is no action item).

nit: Change it to To use a custom sandbox image in a private repository, users need to configure the nodes with credentials properly. http://kubernetes.io/docs/user-guide/images/#configuring-nodes-to-authenticate-to-a-private-repository

@@ -76,7 +77,8 @@ type DockerLegacyService interface {
}

type dockerService struct {
client dockertools.DockerInterface
client dockertools.DockerInterface
podInfraContainerImage string
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename the field to podSandboxImage. We should not use the "infra container" name anymore in this package.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 4, 2016
Modify api protoc for infra
@resouer
Copy link
Contributor Author

resouer commented Oct 4, 2016

rebased and nit fixed in latest commit

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 4, 2016
@Random-Liu
Copy link
Member

LGTM. Wait for @yujuhong to approve because she had change request before.

@yujuhong
Copy link
Contributor

yujuhong commented Oct 4, 2016

LGTM. Thanks for the PR!

@yujuhong yujuhong added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 4, 2016
@yujuhong yujuhong added this to the v1.5 milestone Oct 4, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants