1245 Commits

Author SHA1 Message Date
274d34a25a kube play: support auto updates and rollbacks
Add auto-update support to `podman kube play`.  Auto-update policies can
be configured for:
 * the entire pod via the `io.containers.autoupdate` annotation
 * a specific container via the `io.containers.autoupdate/$name` annotation

To make use of rollbacks, the `io.containers.sdnotify` policy should be
set to `container` such that the workload running _inside_ the container
can send the READY message via the NOTIFY_SOCKET once ready.  For
further details on auto updates and rollbacks, please refer to the
specific article [1].

Since auto updates and rollbacks bases on Podman's systemd integration,
the k8s YAML must be executed in the `podman-kube@` systemd template.
For further details on how to run k8s YAML in systemd via Podman, please
refer to the specific article [2].

An examplary k8s YAML may look as follows:
```YAML
apiVersion: v1
kind: Pod
metadata:
  annotations:
      io.containers.autoupdate: "local"
      io.containers.autoupdate/b: "registry"
  labels:
    app: test
  name: test_pod
spec:
  containers:
  - command:
    - top
    image: alpine
    name: a
  - command:
    - top
    image: alpine
    name: b
```

[1] https://www.redhat.com/sysadmin/podman-auto-updates-rollbacks
[2] https://www.redhat.com/sysadmin/kubernetes-workloads-podman-systemd

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-09-06 08:56:55 +02:00
fb38838fea Man pages: refactor common options: --memory*
(memory-star, i.e., several memory options) that didn't get
included in #15276. Most of them are shoo-ins; the two in
container-clone and pod-clone deserve special attention
because of the "If unspecified" wording.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-05 17:59:13 -06:00
cbaa78cd8a Fix list of default capabilities
Fixes: https://github.com/containers/podman/issues/15626

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-05 07:25:38 -04:00
b9df3a6a9f Man pages: refactor common options: --label
Went with the podman-run version, where the "example" is
in the option template as per our guidelines.

I could not include the network- or volume-create
man pages, nor podman build.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-03 05:49:52 -06:00
e136bcc7c9 Merge pull request #15606 from edsantiago/docs_dedup_digestfile
[CI:DOCS] Man pages: refactor common options: --digestfile
2022-09-03 13:27:25 +02:00
0e66f75f2a Merge pull request #15604 from edsantiago/docs_dedup_deviceXY
[CI:DOCS] Man pages: refactor common options: --device-X-Y
2022-09-02 12:57:45 +02:00
070dfa3b3b Man pages: refactor common options: --digestfile
Only used in two pages. I took the liberty of adding the "N/A
on remote" text to manifest-push.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-01 15:45:00 -06:00
475cac4432 Merge pull request #15601 from edsantiago/docs_dedup_name
[CI:DOCS] Man pages: refactor common options: --name
2022-09-01 23:41:53 +02:00
3d09d47a25 Man pages: refactor common options: --device-X-Y
Followup from #15276: add the FAQ-26 link, and fix one
broken replacement.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-01 13:11:44 -06:00
050f3291b9 implement podman update
podman update allows users to change the cgroup configuration of an existing container using the already defined resource limits flags
from podman create/run. The supported flags in crun are:

this command is also now supported in the libpod api via the /libpod/containers/<CID>/update endpoint where
the resource limits are passed inthe request body and follow the OCI resource spec format

–memory
–cpus
–cpuset-cpus
–cpuset-mems
–memory-swap
–memory-reservation
–cpu-shares
–cpu-quota
–cpu-period
–blkio-weight
–cpu-rt-period
–cpu-rt-runtime
-device-read-bps
-device-write-bps
-device-read-iops
-device-write-iops
-memory-swappiness
-blkio-weight-device

resolves #15067

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-09-01 13:02:01 -04:00
c63830166c Man pages: refactor common options: --name
Only for podman-create and -run, unfortunately: all the
others are too different, and can't easily be combined.

I went with the podman-run version because it was most
recently updated in #5192.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-01 10:58:00 -06:00
8266dbe7a9 Merge pull request #15473 from umohnani8/empty-dir
Add emptyDir volume support to kube play
2022-08-31 09:36:04 -04:00
60e4b762b3 Merge pull request #15562 from edsantiago/docs_dedup_signal
[CI:DOCS] Man pages: refactor common options: --signal
2022-08-31 09:28:00 -04:00
55710d8d55 Merge pull request #15411 from arixmkii/override_default_username
Allow to override default username via command line
2022-08-31 09:12:46 -04:00
9b4dac4c4d Merge pull request #15389 from giuseppe/userns-map-user
podman: add uid and gid options to keep-id
2022-08-31 08:37:34 -04:00
70a599b571 Man pages: refactor common options: --signal
Would've been an easy one, except I decided to fix the text
to conform to our guidelines. I haven't been doing this,
but in this case it's only two man pages and the text is
short enough to make for easy review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-31 05:27:08 -06:00
1ed9a47409 Man pages: refactor common options: --restart
Only applicable to podman-create and -run. I went with the -run
version because it is cleaner and more recently updated.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-30 08:35:53 -06:00
98169c20dd Add emptyDir volume support to kube play
When a kube yaml has a volume set as empty dir, podman
will create an anonymous volume with the empty dir name and
attach it to the containers running in the pod. When the pod
is removed, the empy dir volume created is also removed.

Add tests and docs for this as well.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-08-30 10:34:45 -04:00
8637548a36 docs: move userns options to separate file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-30 15:10:41 +02:00
e015c9e3f7 podman: add uid and gid options to keep-id
add two new options to the keep-id user namespace option:

- uid: allow to override the UID used inside the container.
- gid: allow to override the GID used inside the container.

For example, the following command will map the rootless user (that
has UID=0 inside the rootless user namespace) to the UID=11 inside the
container user namespace:

$ podman run --userns=keep-id:uid=11 --rm -ti  fedora cat /proc/self/uid_map
         0          1         11
        11          0          1
        12         12      65525

Closes: https://github.com/containers/podman/issues/15294

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-30 14:39:27 +02:00
62d87aa9ba Man pages: refactor common options: --subXidname
Whew! This one started off identical everywhere, but the version
in podman-run got fixed in #1380, then again in #5192, with no
corresponding fixes to any of the other man pages.

I went with the podman-run version, with a small change in wording.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-30 05:28:28 -06:00
08a2851bae Allow to override default username via command line
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2022-08-30 13:35:07 +03:00
4e18c8100f Man pages: refactor common options: --http-proxy
Only between podman-create and -run. (podman-build is too
different). I went with the podman-run version.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-29 06:47:07 -06:00
d19438fa6d Man pages: refactor common options: --dns-*
--dns-opt and --dns-search, but only in podman-create and -run.
Went with the -run version in both cases; --dns-opt remained
unchanged, but in --dns-search I changed 'and' to 'with'.

Did not consolidate podman-build or podman-pod-create: too
different.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-29 05:37:52 -06:00
d68eea6014 Merge pull request #15507 from patrycja-guzik/docs-examples
[CI:DOCS] Fix example sections to follow the same format
2022-08-27 07:23:08 -04:00
11de12097f Fix example sections to follow the same format
Signed-off-by: patrycja-guzik <patrycja.k.guzik@gmail.com>
2022-08-27 00:10:34 +02:00
61d842a183 Fix template name inconsistency
Signed-off-by: Stefano Figura <stefano@figura.im>
2022-08-26 15:34:05 +02:00
b1247b62bd Merge pull request #15482 from edsantiago/docs_dedup_systemd
Man pages: refactor common options: --systemd
2022-08-26 06:33:35 -04:00
bb7ae54ef7 Merge pull request #15466 from mtrmac/image-trust-sigstore
podman image trust overhaul, incl. sigstore
2022-08-25 16:11:50 -04:00
42fdc72aa8 Man pages: refactor common options: --systemd
I went with the podman-run version, which better conforms to
style conventions.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-25 08:52:41 -06:00
ff3f574fc0 Add support for sigstoreSigned in (podman image trust set)
NOTE: This does not edit the use-sigstore-attachments value
in registries.d, similarly to how (podman image trust set) didn't
set the lookaside paths for simple signing.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-25 01:50:43 +02:00
0ff0fde49e Man pages: refactor common options: log-related options
podman-logs and podman-pod-logs. Most of these were already
identical, needing no review. Exceptions:

  --follow : needed some container/pod tweaking. This is the
             only one that really needs careful review.

  --names  : I went with the longer version

Note that podman-events has --since and --until options too, but
those are too different to be combined here.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-24 17:48:02 -06:00
2fed2a2829 Man pages: refactor common options: --pid
I chose the one from podman-run, but reordered ns/private
to put them in alphabetical order.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-24 11:48:43 -06:00
34d516840d Merge pull request #15453 from edsantiago/docs_dedup_ipc
[CI:DOCS] Man pages: refactor common options: --ipc
2022-08-24 10:15:34 -04:00
082388a159 Merge pull request #15439 from rhatdan/service
Fix documentation of use of tcp connections
2022-08-24 09:59:31 -04:00
67c4068bb3 Merge pull request #15443 from flouthoc/env-merge-support
run,create: add support for `--env-merge` for preprocessing default environment variables
2022-08-24 09:14:42 -04:00
33ab7e846a Man pages: refactor common options: --ipc
This is not an easy one to review, sorry.

I went with the version from podman-create. The differences
against podman-run are subtle: apostrophes, whitespace, and
the arg description in the '####' line. Suggestion for review:
run hack/markdown-preprocess-review, then after you finish
with that, cd /tmp/markdown<TAB>/ipc and use your favorite
two-file diff tool to compare podman-run* against zzz*.

I did not even try to combine the podman-build one; that one
is too different.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-24 06:58:20 -06:00
ef6285a6f2 Man pages: refactor common options: --gidmap
Two versions: one for container-related commands, one for pods.

The container one is easy: all versions matched, so I made no
changes.

The pod one is hard to review. I went with the pod-clone
version because the pod-create one looks suspicious: it
talks in terms of containers, not pods. It's possible
that I've got it wrong, and that these two cannot be
combined, so please review very carefully. I strongly
recommend using hack/markdown-preprocess-review for this one.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-24 05:43:23 -06:00
c64a6ba072 Man pages: Refactor common options: --workdir
I chose the version from podman-run because it is the most
up-to-date, and most correct wrt current syntax guidelines.
Differences are in arg description, language, and asterisks.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-24 04:43:06 -06:00
b4584ea854 run,create: add support for --env-merge for preprocessing vars
Allow end users to preprocess default environment variables before
injecting them into container using `--env-merge`

Usage
```
podman run -it --rm --env-merge some=${some}-edit --env-merge
some2=${some2}-edit2 myimage sh
```

Closes: https://github.com/containers/podman/issues/15288

Signed-off-by: Aditya R <arajan@redhat.com>
2022-08-24 14:06:25 +05:30
9dca68bdd9 Man pages: refactor common options: --ignore
Should be an easy one to review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-23 15:18:44 -06:00
2538bea8da Merge pull request #15438 from edsantiago/docs_dedup_devicecgrouprule
[CI:DOCS] Man pages: refactor common options: --device-cgroup-rule
2022-08-23 17:02:18 -04:00
2651009c48 Merge pull request #15429 from graywolf-at-work/document-transport
Document restrictions on transport in FROM
2022-08-23 16:23:08 -04:00
8b1e88bf80 Fix documentation of use of tcp connections
Fixes: https://github.com/containers/podman/issues/15430

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-08-23 16:12:08 -04:00
7d7aead511 Man pages: refactor common options: --device-cgroup-rule
I chose the version from podman-create. (This is unusual. podman-run
tends to have the better-maintained, more up-to-date version.)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-23 13:02:09 -06:00
2c03681b2c Man pages: refactor common options: --disable-content-trust
A NOP option. I chose the container word, of course, and the
word 'option' instead of 'flag'. I also hyphenated where needed.

I'm choosing to eliminate the "not on remote" text, because I
don't think it's true: podman-remote happily accepts that
flag on all those commands, including build. (It's marked
as hidden on build, but still accepted).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-23 10:10:35 -06:00
bd3bbb1349 Merge pull request #15417 from edsantiago/docs_dedup_fix_sloppiness
[CI:DOCS] Man pages: fix sloppiness
2022-08-23 11:15:24 -04:00
5dea1218a0 Merge pull request #15426 from nicrowe00/14955
podman kube play/down --read from URL
2022-08-23 11:12:50 -04:00
5c9bac141e Man pages: refactor common options: --cpus
Only on podman create and run: the --cpus option on container-clone
and pod-clone can probably be combined, but maybe later. pod-create
has unique wording that can't be combined.

This is a freebie to review: the text in both files was already
identical, and I made no changes to it. hack/markdown-preprocess-review
will agree, and show you no diffs, because there are none worth
seeing.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-23 08:04:36 -06:00
5948320951 Merge pull request #15384 from sstosh/options-cgroupsv1-rootless
Warning messages are printed and ignored if we use an unsupported option on cgroups V1 rootless systems
2022-08-23 09:42:47 -04:00