1podman-generate-kube(1)()                            podman-generate-kube(1)()
2
3
4

NAME

6       podman-generate-kube  - Generate Kubernetes YAML based on a pod or con‐
7       tainer
8
9

SYNOPSIS

11       podman generate kube [options] container... | pod
12
13

DESCRIPTION

15       podman generate kube will generate Kubernetes Pod YAML  (v1  specifica‐
16       tion)  from  Podman one or more containers or a single pod. Whether the
17       input is for containers or a pod, Podman will always generate the spec‐
18       ification  as  a  Pod.  The input may be in the form of a pod or one or
19       more container names or IDs.
20
21
22       Note that the generated Kubernetes YAML file can be used to re-run  the
23       deployment via podman-play-kube(1).
24
25

OPTIONS

27   --filename, -f=filename
28       Output  to  the  given  file,  instead  of  STDOUT. If the file already
29       exists, generate kube will refuse to replace it and return an error.
30
31
32   --service, -s
33       Generate a Kubernetes service object in addition to the Pods.  Used  to
34       generate  a  Service specification for the corresponding Pod output. In
35       particular, if the object has portmap bindings, the service  specifica‐
36       tion  will include a NodePort declaration to expose the service. A ran‐
37       dom port is assigned by Podman in the specification.
38
39

EXAMPLES

41       Create Kubernetes Pod YAML for a container called some-mariadb .
42
43
44              $ sudo podman generate kube some-mariadb
45              # Generation of Kubernetes YAML is still under development!
46              #
47              # Save the output of this file and use kubectl create -f to import
48              # it into Kubernetes.
49              #
50              # Created with podman-0.11.2-dev
51              apiVersion: v1
52              kind: Pod
53              metadata:
54                creationTimestamp: 2018-12-03T19:07:59Z
55                labels:
56                  app: some-mariadb
57                name: some-mariadb-libpod
58              spec:
59                containers:
60                - command:
61                  - docker-entrypoint.sh
62                  - mysqld
63                  env:
64                  - name: PATH
65                    value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
66                  - name: TERM
67                    value: xterm
68                  - name: HOSTNAME
69                  - name: container
70                    value: podman
71                  - name: GOSU_VERSION
72                    value: "1.10"
73                  - name: GPG_KEYS
74                    value: "199369E5404BD5FC7D2FE43BCBCB082A1BB943DB \t177F4010FE56CA3336300305F1656F24C74CD1D8
75                      \t430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \t4D1BB29D63D98E422B2113B19334A25F8507EFA5"
76                  - name: MARIADB_MAJOR
77                    value: "10.3"
78                  - name: MARIADB_VERSION
79                    value: 1:10.3.10+maria~bionic
80                  - name: MYSQL_ROOT_PASSWORD
81                    value: x
82                  image: quay.io/baude/demodb:latest
83                  name: some-mariadb
84                  ports:
85                  - containerPort: 3306
86                    hostPort: 36533
87                    protocol: TCP
88                  resources: {}
89                  securityContext:
90                    allowPrivilegeEscalation: true
91                    privileged: false
92                    readOnlyRootFilesystem: false
93                  tty: true
94                  workingDir: /
95              status: {}
96
97
98
99       Create Kubernetes Pod YAML for a pod called demoweb and include a  ser‐
100       vice.
101
102
103              $ sudo podman generate kube -s demoweb
104              # Generation of Kubernetes YAML is still under development!
105              #
106              # Save the output of this file and use kubectl create -f to import
107              # it into Kubernetes.
108              #
109              # Created with podman-0.12.2-dev
110              apiVersion: v1
111              kind: Pod
112              metadata:
113                creationTimestamp: 2018-12-18T15:16:06Z
114                labels:
115                  app: demoweb
116                name: demoweb-libpod
117              spec:
118                containers:
119                - command:
120                  - python3
121                  - /root/code/graph.py
122                  env:
123                  - name: PATH
124                    value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
125                  - name: TERM
126                    value: xterm
127                  - name: HOSTNAME
128                  - name: container
129                    value: podman
130                  image: quay.io/baude/demoweb:latest
131                  name: practicalarchimedes
132                  resources: {}
133                  securityContext:
134                    allowPrivilegeEscalation: true
135                    capabilities: {}
136                    privileged: false
137                    readOnlyRootFilesystem: false
138                  tty: true
139                  workingDir: /root/code
140              status: {}
141              ---
142              apiVersion: v1
143              kind: Service
144              metadata:
145                creationTimestamp: 2018-12-18T15:16:06Z
146                labels:
147                  app: demoweb
148                name: demoweb-libpod
149              spec:
150                ports:
151                - name: "8050"
152                  nodePort: 31269
153                  port: 8050
154                  protocol: TCP
155                  targetPort: 0
156                selector:
157                  app: demoweb
158                type: NodePort
159              status:
160                loadBalancer: {}
161
162
163

SEE ALSO

165       podman(1), podman-container(1), podman-pod(1), podman-play-kube(1)
166
167

HISTORY

169       December 2018, Originally compiled by Brent Baude (bbaude at redhat dot
170       com)
171
172
173
174                                                     podman-generate-kube(1)()
Impressum