How to create a pod in Kubernetes that contains an immage Docker that contain mongodb?
Ziliani, this question is a little unclear. We do not know if your goal is to put mongodb into a Pod or you would like to run mongodb in Kubernetes. In future try to be more clear with what you want to achieve and what have you already tried so we can know how to help you.
If you want to easily deploy Mongodb in Kubernetes you can use helm charts as Vasily mentions or you can also check this guide on mongodb github. Also you could read this article to figure out what you should be taking notice of.
This tutorial on the other hand explains full process of running mongodb in Google Kubernetes Engine using StatefulSet.
If you just want a running Pod with mongodb inside, like you have wrote below:
Because i would an file yaml. That include this instruction of Docker docker run -p 27017:27017 --name mongodb bitnami/mongodb:latest
You can use this pod yaml as a reference:
apiVersion: v1
kind: Pod
metadata:
name: mongoDB
spec:
volumes:
- name: mongodb-pod
hostPath:
path: /tmp/mongodb
containers:
- image: bitnami/mongodb:latest
name: mongodb
volumeMounts:
- name: mongodb-data
mountPath: /data/db
ports:
- containerPort: 27017
protocol: TCP
Easiest way to do that is use Helm - package manager for Kubernetes.