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

generate kube -s: do not insert annotations for the bind in the service yaml #11929

Closed
dilyanpalauzov opened this issue Oct 12, 2021 · 12 comments · Fixed by #11943
Closed

generate kube -s: do not insert annotations for the bind in the service yaml #11929

dilyanpalauzov opened this issue Oct 12, 2021 · 12 comments · Fixed by #11943
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@dilyanpalauzov
Copy link
Contributor

I run a podman container as described at https://mail.aegee.org/cgit/aegee-ldap/tree/readme.md#n13 . Then call podman generate kube -s busy_mclaren. The output is:

# Save the output of this file and use kubectl create -f to import
# it into Kubernetes.
#
# Created with podman-3.4.0
apiVersion: v1
kind: Service
metadata:
  annotations:
    bind-mount-options:/home/d/data: Z
  creationTimestamp: "2021-10-12T05:51:48Z"
  labels:
    app: busymclaren
  name: busymclaren
spec:
  ports:
  - name: "3890"
    nodePort: 31091
    port: 3890
    protocol: TCP
    targetPort: 0
  selector:
    app: busymclaren
  type: NodePort
status:
  loadBalancer: {}

Apart from the fact, that the annotation is syntactically not accepted by kubelet apply -f, such annotations have nothing to do with the Service and therefore shall not be emitted.

@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2021

@baude PTAL

@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2021

Seems this is a duplicate of #11930

@rhatdan rhatdan closed this as completed Oct 12, 2021
@dilyanpalauzov
Copy link
Contributor Author

dilyanpalauzov commented Oct 12, 2021

This ticket is about the useless anotation, the other ticket is about targetPort:0.

@mheon
Copy link
Member

mheon commented Oct 12, 2021

It's useless for Kube, but it's necessary for preserving this information for podman play kube - one of our goals is that podman play kube on YAML from podman generate kube should produce close-to-identical containers. Podman containers and Kube YAML are not perfectly matched, hence the need for such annotations.

@dilyanpalauzov
Copy link
Contributor Author

The annotation is included in the Pod and in the Service object. I mean, that it is sufficient to include the annotation only in the Pod object.

@mheon
Copy link
Member

mheon commented Oct 12, 2021

Ahh, fair.

@mheon mheon reopened this Oct 12, 2021
@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2021

Interested in opening a PR to fix it?

@dilyanpalauzov
Copy link
Contributor Author

I am not interested.

@baude
Copy link
Member

baude commented Oct 12, 2021

would changing where it is in the stanza be a breaking change though?

baude added a commit to baude/podman that referenced this issue Oct 12, 2021
Kubernetes fails to deal with an annotation that has a space in it.
Trim these strings to remove spaces.

Fixes: containers#11929

Signed-off-by: Brent Baude <[email protected]>

[NO TESTS NEEDED]
@dilyanpalauzov
Copy link
Contributor Author

dilyanpalauzov commented Oct 12, 2021

This ticket is not about the syntactically invalid annotation.

This ticket is about the unnecessary annotation in the Service yaml output.

@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2021

Not if nothing uses it.

@dilyanpalauzov
Copy link
Contributor Author

I use the latest podman - commit 171f7b8 - and I see no difference in the output of podman generate kube -s - the generated annotation is syntactically invalid. The bind annotation is included both in the Pod.metadata and Service.metadata . including the bind annotation in Service.metadata seems unnecessary.

mheon pushed a commit to mheon/libpod that referenced this issue Oct 19, 2021
Kubernetes fails to deal with an annotation that has a space in it.
Trim these strings to remove spaces.

Fixes: containers#11929

Signed-off-by: Brent Baude <[email protected]>

[NO TESTS NEEDED]
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants