Skip to content

Commit 8d7f94d

Browse files
committed
Merge branch 'tobru_fixes' into 'master'
several small updates to the tutorial See merge request education/commodore-component-tutorial!1
2 parents 8bcef1b + 03a0b7b commit 8d7f94d

1 file changed

Lines changed: 26 additions & 25 deletions

File tree

tutorial.adoc

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
= Tutorial: Writing your First Commodore Component
1515

16-
This tutorial will guide you through the required steps to create your first Commodore component.
16+
This tutorial will guide you through the required steps to create your first Commodore Component.
1717

18-
Commodore components allow you to customize and extend the number and variety of tasks that you can perform with https://syn.tools/[Project Syn]. Using Commodore components, you can customize and apply changes to all of your clusters, ensuring conformity, coherence, alignment, and drastically reducing the workload for DevOps engineers.
18+
Commodore Components allow you to customize and extend the number and variety of tasks that you can perform with https://syn.tools/[Project Syn]. Using Commodore Components, you can customize and apply changes to all of your clusters, ensuring conformity, coherence, alignment, and drastically reducing the workload for DevOps engineers.
1919

20-
There are many https://github.com/topics/commodore-component[Commodore components] already published; they perform various tasks, all related to the maintenance of Kubernetes clusters of many different kinds, including https://www.openshift.com/[OpenShift] clusters.
20+
There are many https://github.com/topics/commodore-component[Commodore Components] already published; they perform various tasks, all related to the maintenance of Kubernetes clusters of many different kinds, including https://www.openshift.com/[OpenShift] clusters.
2121

2222
WARNING: This tutorial has been prepared with version v0.2.0 of Commodore. Project Syn is moving fast, and we will update this tutorial accordingly as new features and capabilities are made available by the development team.
2323

@@ -27,7 +27,7 @@ In this tutorial, we are going to do the following:
2727
. Then, we are going to create a very simple component, one that will deploy a workload in both clusters at the same time.
2828
. Finally, we are going to wrap up, not without first cleaning up all the different pieces of this experiment.
2929

30-
This tutorial should give you a good idea of how all the different pieces of Project Syn work together, and how Commodore components fit in the picture.
30+
This tutorial should give you a good idea of how all the different pieces of Project Syn work together, and how Commodore Components fit in the picture.
3131

3232
== Requirements
3333

@@ -118,7 +118,7 @@ IMPORTANT: Do not press the kbd:[Enter] key when prompted with the `If you don't
118118

119119
=== Install Steward on Minikube
120120

121-
Now that Lieutenant is installed we can install https://docs.syn.tools/steward/[Steward] on our cluster. This tool is in charge of watching the GitLab and GitHub repositories, and triggers the GitOps operations required to keep each cluster up-to-date.
121+
Now that Lieutenant is installed we can install https://docs.syn.tools/steward/[Steward] on our cluster. This tool is in charge of bootstrapping https://argoproj.github.io/argo-cd/[Argo CD] which watches the GitLab and GitHub repositories, and triggers the GitOps operations required to keep each cluster up-to-date.
122122

123123
We can easily install Steward on Minikube using the `./3_steward_on_minikube.sh` script.
124124

@@ -142,7 +142,7 @@ TIP: The term "synthesize" means performing all the required steps so that a clu
142142
$ ./4_synthesize_on_k3s.sh
143143
----
144144

145-
And now we are ready: we have two working Kubernetes clusters, one Minikube and one k3s, and both are assigned to the same tenant. To verify this, we ask now the Lieutenant API, installed in our Minikube cluster:
145+
And now we are ready: we have two working Kubernetes clusters, one Minikube and one k3s, and both are assigned to the same tenant. To verify this, we ask now the Lieutenant Custom Resources, available in our Minikube cluster:
146146

147147
[source,bash]
148148
----
@@ -175,7 +175,7 @@ If you feel adventurous enough, and still have enough available RAM in your syst
175175

176176
== Creating a Commodore Component
177177

178-
Now we're getting to the actual subject of this tutorial! Let us dive into the real task of creating a new Commodore component.
178+
Now we're getting to the actual subject of this tutorial! Let us dive into the real task of creating a new Commodore Component.
179179

180180
=== Using the Commodore Docker Image
181181

@@ -222,7 +222,7 @@ COMMODORE_GLOBAL_GIT_BASE=ssh://git@github.com/$GITHUB_USERNAME
222222

223223
=== Compiling the Commodore Catalog
224224

225-
The first step to create a Commodore component is what is usually referred to as "compiling the catalog." This catalog provides a unique reference point of information about all the configuration and workloads affecting a single cluster.
225+
The first step to create a Commodore Component is what is usually referred to as "compiling the catalog." This catalog provides a unique reference point of information about all the configuration and workloads affecting a single cluster.
226226

227227
Now we are ready to compile our catalog. Every time you call the `commodore` tool you will have to enter the password of your SSH key.
228228

@@ -254,7 +254,7 @@ Let us create the component first:
254254

255255
[source,bash]
256256
----
257-
$ commodore component new fortune
257+
$ Commodore Component new fortune
258258
Agent pid 9
259259
Enter passphrase for /app/.ssh/id_rsa:
260260
Identity added: /app/.ssh/id_rsa (user@domain.com)
@@ -273,7 +273,7 @@ $ code dependencies/fortune
273273
.Editing the Fortune component
274274
image::vscode_01.png[]
275275

276-
Commodore components are written using https://jsonnet.org/[Jsonnet] (pronounced "jay-sonnet"), a data templating language for app and tool developers. If you have never written Jsonnet before, do not worry; just know that all valid JSON files are valid Jsonnet files, and that Jsonnet provides useful extensions, such as variables and functions, and various export formats, which make it easy to write very complex JSON applications with it.
276+
Commodore Components are usually written using https://jsonnet.org/[Jsonnet] (pronounced "jay-sonnet"), a data templating language for app and tool developers. If you have never written Jsonnet before, do not worry; just know that all valid JSON files are valid Jsonnet files, and that Jsonnet provides useful extensions, such as variables and functions, and various export formats, which make it easy to write very complex JSON applications with it.
277277

278278
In Visual Studio Code, open the `component/main.jsonnet` file, and replace its text with the following:
279279

@@ -318,15 +318,15 @@ Open the `component/app.jsonnet` file and replace its contents with the followin
318318
include::assets/code/app.jsonnet[]
319319
----
320320

321-
The `secrets=false` parameter is required. This is due to an incompatibility of ArgoCD with the Kapitan plugin at the time of this writing, which prevents it from loading properly. Since we do not require secrets for this tutorial, we can safely disable this.
321+
The `secrets=false` parameter is required. Since we do not require secrets for this tutorial, we can safely disable this.
322322

323323
=== Compiling the Component
324324

325325
Now that we have written our component, let's compile it to see if it's generating what we need:
326326

327327
[source,bash]
328328
----
329-
$ commodore component compile dependencies/fortune
329+
$ Commodore Component compile dependencies/fortune
330330
Agent pid 9
331331
Enter passphrase for /app/.ssh/id_rsa:
332332
Identity added: /app/.ssh/id_rsa (user@domain.com)
@@ -468,7 +468,7 @@ $ commodore catalog compile c-late-cloud-248
468468
469469
----
470470

471-
Since ArgoCD, itself managed by Steward, is watching these repositories, it will pick up the new state and seamlessly deploy it across our two clusters in a few minutes.
471+
Since Argo CD, itself managed by Steward, is watching these repositories, it will pick up the new state and seamlessly deploy it across our two clusters in a few minutes.
472472

473473
With https://k9scli.io/[K9s] we can watch our clusters as they pick up the changes and apply them in all transparency. The namespace `syn-fortune` will contain the required deployment, pods, and service.
474474

@@ -478,11 +478,11 @@ image::k9s_k3d.png[]
478478
.K9s showing the `syn-fortune` and `lieutenant` pods in Minikube
479479
image::k9s_minikube.png[]
480480

481-
=== Accessing the ArgoCD Console
481+
=== Accessing the Argo CD Console
482482

483-
https://argoproj.github.io/argo-cd/[ArgoCD] is a declarative GitOps continuous deployment tool for Kubernetes. It is managed by Steward, and takes care of synchronizing and automatically updating the state of our clusters following changes in the configuration. You can access the ArgoCD console in both clusters through these steps:
483+
https://argoproj.github.io/argo-cd/[Argo CD] is a declarative GitOps continuous deployment tool for Kubernetes. It is managed by Steward, and takes care of synchronizing and automatically updating the state of our clusters following changes in the configuration. You can access the Argo CD console in both clusters through these steps:
484484

485-
First, retrieve the ArgoCD admin password with this command:
485+
First, retrieve the Argo CD admin password with this command:
486486

487487
[source,bash]
488488
----
@@ -491,17 +491,17 @@ $ kubectl --context minikube -n syn get secret/steward -o jsonpath='{.data.token
491491

492492
TIP: The `pbcopy` command is usually found in macOS. In Linux, you can `alias pbcopy="xclip -selection clipboard"`.
493493

494-
Second, redirect trafic to ArgoCD:
494+
Second, redirect traffic to Argo CD:
495495

496496
[source,bash]
497497
----
498-
$ kubectl --context minikube -n syn port-forward svc/argocd-server 8080:80
498+
$ kubectl --context minikube -n syn port-forward svc/Argo CD-server 8080:80
499499
----
500500

501501
And third, open http://localhost:8080 with the username `admin` and the password you copied in the previous step.
502502

503-
.ArgoCD console
504-
image::argocd.png[]
503+
.Argo CD console
504+
image::Argo CD.png[]
505505

506506
You can repeat this steps to access the console in the K3s cluster, by changing the value of the `kubectl --context` parameter.
507507

@@ -533,7 +533,8 @@ We are done! You can now remove the clusters in your computer, and also remove t
533533

534534
* Run the `./5_delete.sh` script to deregister and stop all local clusters.
535535
* Remove your clone of `commodore-defaults` on GitHub.
536-
* Remove your GitLab projects: `tutorial-tenant`, `tutorial-cluster-minikube`, and `tutorial-cluster-k3s`
536+
537+
TIP: The GitLab projects `tutorial-tenant`, `tutorial-cluster-minikube`, and `tutorial-cluster-k3s` have been automatically deleted by the Lieutenant Operator.
537538

538539
[source,bash]
539540
----
@@ -564,10 +565,10 @@ INFO[0002] Successfully deleted cluster projectsyn!
564565

565566
== Conclusion
566567

567-
I hope this tutorial has given you a good idea of what Commodore components are, and how they can help you in your DevOps workflow.
568+
I hope this tutorial has given you a good idea of what Commodore Components are, and how they can help you in your DevOps workflow.
568569

569-
Commodore components can be used to deploy monitoring tools, to change the state of lots of clusters at once, to perform backup operations, to modify network policies, and many other tasks that otherwise would have to be performed manually.
570+
Commodore Components can be used to deploy monitoring tools, to change the state of lots of clusters at once, to perform backup operations, to modify network policies, and many other tasks that otherwise would have to be performed manually.
570571

571-
Creating Commodore components at the moment is a long task, but the rewards are high in terms of the economies of scale DevOps reach when managing multi-cluster architectures.
572+
Creating Commodore Components at the moment is a long task, but the rewards are high in terms of the economies of scale DevOps reach when managing multi-cluster architectures.
572573

573-
If you create a new open source Commodore component, add the https://github.com/topics/commodore-component[`commodore-component` tag] on your GitHub project and let us know about it! We will be thrilled to check it out and who knows? Maybe even contribute back to your effort.
574+
If you create a new open source Commodore Component, add the https://github.com/topics/commodore-component[`commodore-component` tag] on your GitHub project and let us know about it! We will be thrilled to check it out and who knows? Maybe even contribute back to your effort.

0 commit comments

Comments
 (0)