Skip to content

Commit ab47cc8

Browse files
27.12 lesson-8.md
Cluster configuration Kubernetes
1 parent a7501d2 commit ab47cc8

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

Course/lesson-7.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,9 @@
5454
* Job templates
5555
* provides specific jobs
5656
* included to CI/CD workflow
57+
* include:
58+
* `- local` - reference from same repository
59+
* `- file` - reference from another private project (same GitLab instance)
60+
* `- remote` - include from a different location (full URL necessary)
61+
* `- template` - include GitLab's templates
5762

Course/lesson-8.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Deploy Microservices to Kubernetes cluster:
2+
3+
### Create a K8s cluster on Google Cloud:
4+
* [Creating a cluster (Google Cloud project)](https://www.udemy.com/course/docker-and-kubernetes-the-complete-guide/learn/lecture/11628212#overview)
5+
* OR [Creating a cluster (LKE project)](https://techworld-with-nana.teachable.com/courses/1769488/lectures/39916812)
6+
* download and install [gcloud CLI](https://cloud.google.com/sdk/docs/install-sdk)
7+
* `./google-cloud-sdk/install.sh` - install script to add gcloud CLI tools to your PATH
8+
* `gcloud init` - initialize the gcloud CLI
9+
* log in using your Google user account
10+
*
11+
* [Google Cloud Cluster](https://console.cloud.google.com/kubernetes/clusters/details/me-west1/autopilot-cluster-1/details?project=fluent-oarlock-358313)
12+
* `gcloud auth list` - List accounts whose credentials are stored on the local system
13+
* `gcloud config list` - List the properties in your active gcloud CLI configuration
14+
* [Enable the Google Kubernetes Engine API](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#default_cluster_kubectl)
15+
* `gcloud container clusters get-credentials autopilot-cluster-1 --region me-west1 --project fluent-oarlock-358313` - Update the kubectl configuration to use the plugin
16+
* `gke-gcloud-auth-plugin --version` - Check the gke-gcloud-auth-plugin binary version
17+
* `kubectl get namespaces` - Verify the configuration
18+
* `kubectl config view` - To view your environment's kubeconfig
19+
* `kubectl cluster-info` - connect to cluster and get info from it
20+
21+
22+
### Cluster configuration:
23+
* `kubectl create namespace my-micro-service` - create namespace
24+
* namespace/my-micro-service created
25+
* `kubectl create serviceaccount cicd-sa --namespace=my-micro-service` - create service account
26+
* serviceaccount/cicd-sa created
27+
* `vim cicd-role.yaml` - create cicd-role.yaml with role rules
28+
* `kubectl apply -f cicd-role.yaml` - create role
29+
* role.rbac.authorization.k8s.io/cicd created
30+
* `kubectl create rolebinding cicd-rb --role=cicd-role --serviceaccount=my-micro-service:cicd-sa --namespace=my-micro-service` - bind role with rules
31+
* rolebinding.rbac.authorization.k8s.io/cicd-rb created
32+
*

0 commit comments

Comments
 (0)