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  a Podman container or pod. Whether the input is for a con‐
17       tainer or pod, Podman will always generate the specification as a  Pod.
18       The input may be in the form of a pod or container name or ID.
19
20
21       Note  that the generated Kubernetes YAML file can be used to re-run the
22       deployment via podman-play-kube(1).
23
24

OPTIONS:

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

Examples

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

SEE ALSO

168       podman(1), podman-container(1), podman-pod(1), podman-play-kube(1)
169
170

HISTORY

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