Why to use kubectl apply in production - kubectl create vs kubectl apply - CKA Training

Опубликовано: 29 Сентябрь 2024
на канале: networknutsdotnet
542
15

What is difference between kubectl create and kubectl apply?

Basically kubectl create is a "imperative" way of creating resources in kubernetes. kubectl create doesn't use last-applied-configuration. kubectl create directly talks to api-server. It doesn't look into the live object configuration created by kubernetes. Not recommeded to use in production and while working with team and code on version control system like git.

Whereas, kubectl apply is a "declarative" way to creating and managing resources. kubectl apply creates last-applied-configuration inside the live object configuration created by kubernetes. kubectl apply compares local configuration with last-applied configuration and bring the resource in desired state.

Timeline:
00:00-19:18 - kubectl create
19:19-44:60 - kubectl apply

Visit us - https://networknuts.net
social - networknuts