So we saw how we can use the declarative approach.
How can we now make changes to our deployments or services?
Well, the cool thing is you can simply change something
in your Yaml files, reapply the files
and the necessary changes will be made in your cluster.
For example, if you wanna change the number of replicas
for the deployment, you can change it in Yaml file,
save the file and then simply apply it again.
So we run the kub control applied dash f
deployment Yaml file.
Again, if we hit enter, these changes will be made
and therefore if you now run get pods,
you'll see that you get free pods
because we specified three replicas here.
And that's how easy it is.
And if you wanna scale down again
you can of course, rechange this,
apply these changes
and then after a while,
you will see that you got only one pod,
you'll see, two pods are already terminating here.
Now, what if we wanted to change the image for example,
if we wanna go back to kub first app here
we can also change the image here
and then apply this and now see whether that has an effect.
And you see if I reload, it does.
So that is how easy it is to make changes
to your deployments
or to your configuration files in general.
And that's of course, another advantage
of this declarative approach.
You can just change these conflict files,
reapply them, and your changes will be applied.
You don't have to type long commands again
and you can only change single things
and only these changes will then be applied.
So you don't have to repeat an entire command
just to change one option in the command.
With the declarative approach, that's not required.
In addition, of course, you can check this Yaml file
into source, control and also use tools like
Git to therefore for keep track of different versions
of this Yaml file.
So that's another advantage you would have here.
With that however, I'll go back to the tac two here
and apply that.
And if I now reload, we get this again.
So that's awesome,
that's how easy we can make changes here.
Now what about deleting resources?
You also got a command for that
and that's the kub control delete command
which we saw before already,
but besides deleting a deployment
by targeting it by its name, which you still could do,
just because you created it declaratively,
doesn't mean that you can't delete it imperatively,
so we could delete our deployment by its name here,
which we chose, so by this name
but you can also simply call kub control delete dash f
and then point at the file name, which you wanna delete.
And it's not the file, which will be deleted
but the resources that were created based on the file.
And if you wanna delete multiple resources
you can separate them with a comma here
or simply add multiple dash f option flax here like this.
I'm not going to do it here
we're going to do it in the next lecture
but this is how you can delete resources
in a declarative approach
or if you want still in an imperative approach.
So you don't have to go with the declarative one,
you can also use the imperative way of deleting,
even though we created it declaratively.