Home > Mobile >  how should i create YAML files for the apps i intend to deploy?
how should i create YAML files for the apps i intend to deploy?

Time:11-21

i'm completely new to Kubernetes so forgive me if im asking some dumb questions :-0

when you deploy apps to k8s, you usually write up some yaml files for the app right? how do you know which k8s objects you should make config file for?

for example, im following a tutorial that deploys mysql on k8s and it says i would need deployment.yaml, secret.yaml, pv.yaml, pvc.yaml and service.yaml but how do you know in the first place you need these config files in order to successfully deploy mysql app?

are there any guide or standard to follow on this matter? all the tutorials or documentations i been watching and reading dont tell me which objects to define for a particular app and why.

i feel like i dont understand k8s at all or seriously missing some import points here

thanks for the answer in advance!!

i've been googling to find answers on the question but can't find any concrete one yet :(

CodePudding user response:

To answer your question in short:

  • Use Visual Studio Code Kubernetes Tools for a quick generation of deployment manifests (yaml files)
  • Learn what each key and value in deployment manifests means by reading the docs and modify generated manifests accordingly.

CodePudding user response:

This is way to broad to give a decent answer for, but to make it short. Mentioned files "deployment.yaml, secret.yaml, pv.yaml, pvc.yaml and service.yam" are not specific to only mysql, it's just what you need to deploy your app on Kubernetes. It's not exactly a entry friendly topic and there is just about no reason to write down entire tutorial just for this post, as there is plenty of sources available, so I will just recommend those that I remember helped me:

"you need to learn Kubernetes RIGHT NOW!!" By NetworkChuck

https://www.youtube.com/watch?v=7bA0gTroJjw

"Kubernetes Tutorial for Beginners" by TechWorld with Nana

https://www.youtube.com/watch?v=X48VuDVv0do

And then there is official documentation: https://kubernetes.io/docs/home/

I'd also not skip on paying for some test clusters with the hosting provider, as you will find out that quite a chunk of those files are pre-generated by them.

Hope this helps

  • Related