concept kubectl in category microservice

This is an excerpt from Manning's book Microservices in .NET Core, Second Edition.
This will install and start the Kubernetes cluster. Furthermore this installs the
microk8scommand line interface which includes thekubectlcommand that we are going to use. To make it a bit easier to follow along with the work in the following sections you can create an alias for kubectl:
Figure 3.5. Docker Desktop Kubernetes settings
![]()
Once the Loyalty Program API and the Special Offers microservice is deploy we should se both running in Kubernetes both in the Kubernetes dashboard (which we configured in chapter 3) and in the
kubectlcommand line:
We can also see from this that the Loyalty Program event consumer by looking at the last shedule column. In my case the cron job has been triggered 20 seconds ago.
We can also see a list of recent invocation of the Loyalty Program event consumer by looking at the Kubernetes jobs list:
> kubectl get jobs NAME COMPLETIONS DURATION AGE loyalty-program-consumer-1590755940 1/1 2s 11s loyalty-program-consumer-1590757080 1/1 2s 1m11s loyalty-program-consumer-1590757140 1/1 3s 2m11sThis concludes the deployment of the Loyalty Program microservice. The API part as well as the event consumers part is running in our Kubernetes cluster in AKS. The Kubernetes manifest we have created for the Loyalty Program is the template for the manifests for all the microservices we will create, only the container images will have different name and the event consumer schedules will vary.

This is an excerpt from Manning's book Microservices Security in Action.
\> kubectl apply -f sts.deployment.yaml deployment.apps/sts-deployment created
The communications among all these components happen via the API server. For example, to deploy a container in Kubernetes, we need to talk to the API server via a Kubernetes client application, which is called a kubectl. We discuss all four components in a master node in detail later in the appendix.
To interact with the Kubernetes environment running on Google Cloud, you also need to install kubectl as a component of the gcloud tool, which you installed in section J.5.1. This command-line tool, kubectl, runs on your local computer and talks to the Kubernetes API server running on Google Cloud to perform certain operations. The following command installs kubectl as a component of the gcloud tool:
\> gcloud components install kubectl
The best way to understand how Kubernetes internal communication happens is to go through one simple command and see how it works end to end (see figure J.4). In section J.6, we used the following
kubectlcommand to create a Kubernetes Deployment with the Docker imagegcr.io/google-samples/hello-app:\> kubectl run hello-server --image gcr.io/google-samples/hello-app:1.0 \ --port 8080When we run this command from kubectl running on our local machine, it creates a request with the provided parameters and talks to an API running on the Kubernetes API server. The communications among all the components in the Kubernetes control plane happens via the API server.