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

providers, podman: support podman 2.0 #1728

Merged
merged 3 commits into from
Jul 16, 2020

Conversation

giuseppe
Copy link
Member

fix some issues that prevented using podman 2.0

Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 13, 2020
@BenTheElder BenTheElder requested review from amwat and removed request for krzyzacy July 13, 2020 21:02
@aojea
Copy link
Contributor

aojea commented Jul 13, 2020

sorry, but we don't have CI for podman, is this going to work for both 1.9 and 2.0?

@giuseppe
Copy link
Member Author

sorry, but we don't have CI for podman, is this going to work for both 1.9 and 2.0?

yes, I've tested it both with 1.9 and 2.0

@giuseppe
Copy link
Member Author

/test pull-kind-conformance-parallel-1-16

the podman inspect format changed, attempt to parse using both
formats.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@@ -180,7 +180,6 @@ func runArgsForNode(node *config.Node, clusterIPFamily config.ClusterIPFamily, n
// for now this is what we want. in the future we may revisit this.
"--privileged",
"--security-opt", "seccomp=unconfined", // also ignore seccomp
"--security-opt", "apparmor=unconfined", // also ignore apparmor
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any side effect removing this?

Copy link
Contributor

Choose a reason for hiding this comment

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

ic

Command Output: Error: invalid config provided: AppArmorProfile and privileged are mutually exclusive options

I'm not very much into apparmor, so my question is about the user experience, does this means the users need to disable apparmor or use specific profiles, or just will work?

Copy link
Member

Choose a reason for hiding this comment

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

Let's just specify --privileged and drop all --security-opt *.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's just specify --privileged and drop all --security-opt *.

that is better, thanks for the suggestion. I've updated the PR

Copy link
Member

Choose a reason for hiding this comment

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

how does this apply to older versions of podman?

Copy link
Member

Choose a reason for hiding this comment

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

were these flags just ignored? docker does not throw this error.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is just a regression in Podman that raises an error when both --privileged and --security-opt apparmor=* are used. There is already an issue to track the problem in podman 2.0 so that --security-opt apparmor= overrides --privileged. For our use case though it doesn't matter since --privileged implies no apparmor and selinux

Copy link
Member

Choose a reason for hiding this comment

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

SGTM, I just want to make sure we're not not-reporting these 😅

@aojea
Copy link
Contributor

aojea commented Jul 15, 2020

@mheon talking about compatibility , if I use the same command we are using in the docker provider, podman 2.0 fails :/

// retrieve the specific port mapping using docker inspect
cmd := exec.Command(
"docker", "inspect",
"--format", fmt.Sprintf(
"{{ with (index (index .NetworkSettings.Ports \"%d/tcp\") 0) }}{{ printf \"%%s\t%%s\" .HostIp .HostPort }}{{ end }}", common.APIServerInternalPort,
),
n.String(),

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@aojea
Copy link
Contributor

aojea commented Jul 15, 2020

/retest
/lgtm
hope we don't have more differences between 1.9 and 2.x
Thanks
/assign @BenTheElder

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 15, 2020
@giuseppe
Copy link
Member Author

/test pull-kind-conformance-parallel-1-16

1 similar comment
@giuseppe
Copy link
Member Author

/test pull-kind-conformance-parallel-1-16

@BenTheElder
Copy link
Member

1.16 has a regression somewhere in the stack, I'll bypass that job when we're ready to merge.

@@ -182,20 +182,45 @@ func (p *Provider) GetAPIServerEndpoint(cluster string) (string, error) {
return "", errors.Errorf("network details should only be one line, got %d lines", len(lines))
}

// portMapping maps to the standard CNI portmapping capability
// portMapping19 maps to the standard CNI portmapping capability used in podman 1.9
Copy link
Member

Choose a reason for hiding this comment

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

this also applies to other < 2.0, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, this is the struct used by podman <= 1.9

Copy link
Member

Choose a reason for hiding this comment

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

maybe we should note that /shrug

@@ -355,7 +353,7 @@ func generatePortMappings(clusterIPFamily config.ClusterIPFamily, portMappings .
if strings.HasSuffix(hostPortBinding, ":0") {
hostPortBinding = strings.TrimSuffix(hostPortBinding, "0")
}
args = append(args, fmt.Sprintf("--publish=%s:%d/%s", hostPortBinding, pm.ContainerPort, protocol))
args = append(args, fmt.Sprintf("--publish=%s:%d/%s", hostPortBinding, pm.ContainerPort, strings.ToLower(protocol)))
Copy link
Member

Choose a reason for hiding this comment

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

aside: this really seems like a bug in podman.

Copy link

Choose a reason for hiding this comment

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

Already fixed on master, but it slipped into a few published releases

Copy link
Member

Choose a reason for hiding this comment

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

docker accepts uppercase AND this is the canonical value in CRI, which is why we're using uppercase https://github.com/kubernetes/cri-api/blob/34366a3c19379c566a82895ce1bcb75d9a502fac/pkg/apis/runtime/v1alpha2/api.pb.go#L58

Copy link
Member

Choose a reason for hiding this comment

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

ack, thanks

@BenTheElder
Copy link
Member

/lgtm
/approve
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 15, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 15, 2020
@BenTheElder
Copy link
Member

We need to file a bug about 1.16
/override pull-kind-conformance-parallel-1-16

@k8s-ci-robot
Copy link
Contributor

@BenTheElder: Overrode contexts on behalf of BenTheElder: pull-kind-conformance-parallel-1-16

In response to this:

We need to file a bug about 1.16
/override pull-kind-conformance-parallel-1-16

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@BenTheElder
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 16, 2020
@k8s-ci-robot k8s-ci-robot merged commit 0cd238e into kubernetes-sigs:master Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants