-
Notifications
You must be signed in to change notification settings - Fork 90
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
Create Pod Functionality #961
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! This was something we wanted to add for a while!
@garrett as we have limited set of integrations, do we still want to have a tabbed layout?
I've noticed that pods also supports volumes/mounts so should we add that as well?
src/Containers.jsx
Outdated
onClick={() => this.setState({ showCreatePodModal: true })}> | ||
{_("Create pod")} | ||
</DropdownItem> | ||
]} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've digged up our old designs for adding a pod creation to cockpit-podman and I think we don't want it in a new kebab menu but as a button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am planning to implement other functions later which could go to kebab menu, and which are available through the API, e.g. Prune unused pods, Play a kube YAML, ... And I think two buttons together with filters would not look good on narrow layouts too. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a create pod
button takes up a lot of space, @garrett what do you think?
src/Containers.jsx
Outdated
{ title: proc, props: { modifier: "nowrap" } }, | ||
{ title: mem, props: { modifier: "nowrap" } }, | ||
{ title: <Badge isRead className={containerStateClass}>{_(containerState)}</Badge> }, // States are defined in util.js | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could some competent designer have a look at it? It would be better to show also other pod details, such as port mapping and mounts, and present layout is not prepared for this. I'd be glad to implement it. ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Port mappings an mounts are at the pod level, right? I thought I had a design for this somewhere. (But perhaps I'm thinking of something else...?)
I'll look around, but it's end of the day today, so please ping me if I forget and take a while to get back to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to find what I was thinking of. Perhaps I have a pattern in mind that was in another mockup.
This means I'll need to mock up what I have in mind for Cockpit-Podman. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the pod title a little bit and added Owner label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, please drop the tabs from this modal dialog. Thanks! |
Tabs removed. I also added volumes section, but found out that mounts wont get created for pod because of bug in Podman: containers/podman#13548 . I am not able to verify it is fixed in 4.x version as I am on fedora 35 for now. I would also add a new test for creating pod later on. |
Now it is possible to choose if infra container is created. Also, infra containers are not hidden in pods listings anymore. I also prepared two new tests, TestApplication.testCreatePodUser and TestApplication.testCreatePodSystem. |
src/Containers.jsx
Outdated
@@ -463,9 +484,6 @@ class Containers extends React.Component { | |||
); | |||
} | |||
|
|||
// Remove infra containers | |||
filtered = filtered.filter(id => !this.props.containers[id].IsInfra); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you want to show infra containers, they aren't super interesting for users? Do you have a good reason to show it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Infra container is a placeholder for shared resources of pod containers. The pod port mapping for example is defined on it. Without showing infra container, user of cockpit-podman does not know if pod has such shared resources and what ports pod exposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For that we prefer the following design, it takes the info from the infra container. #489
src/Containers.jsx
Outdated
onClick={() => this.setState({ showCreatePodModal: true })}> | ||
{_("Create pod")} | ||
</DropdownItem> | ||
]} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a create pod
button takes up a lot of space, @garrett what do you think?
src/Containers.jsx
Outdated
{ title: proc, props: { modifier: "nowrap" } }, | ||
{ title: mem, props: { modifier: "nowrap" } }, | ||
{ title: <Badge isRead className={containerStateClass}>{_(containerState)}</Badge> }, // States are defined in util.js | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good PR to look at landing next after the rename PR. |
The rename PR landed, can you please rebase this PR? |
1050367
to
8540cbe
Compare
I've rebased the PR, resolved the conflicts and dropped some of the things which can be a follow up PR. |
This breaks pixel tests: https://cockpit-logs.us-east-1.linodeobjects.com/pull-961-20220819-084819-8540cbeb-fedora-35/TestApplication-testRunImageSystem-integration-pixels.png It causes regression, I did this change a few weeks ago - wrong checkout? Also needs some new tests |
Hmm the code was moved around so maybe it doesn't pick up some css changes? |
a34867f
to
bfe5b80
Compare
Failing tests on ubuntu-2204 are due to podman not support user mounts on 3.4.4 and requires 4.0.0 so our gui should hide it containers/podman#10379 |
dba46cf
to
81d25dc
Compare
Issue summary:
|
e244962
to
b267776
Compare
Agreed, however.... the Ports can be found in |
This implements the ability to create a podman pod for the user and admin session. A pod can have a volume and port mapping, note that volumes are only supported from podman 4.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superb, thank you!
Can you please write proper release note with screenshot as well? |
Thanks everyone for pushing things through, I haven't had any time to pursue this myself. |
No problem, thanks for the initial PR! |
Ability to create new pod group
Podman now allows the creation of pods with an optional port or volume mapping.