Skip to content

Commit 12e2d83

Browse files
committed
Added last changes
1 parent 8d7f94d commit 12e2d83

3 files changed

Lines changed: 27 additions & 22 deletions

File tree

5_delete.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ source lib/functions.sh
44
source lib/minikube.sh
55

66
check_minikube
7+
check_variable "GITLAB_ENDPOINT" $GITLAB_ENDPOINT
8+
check_variable "GITLAB_USERNAME" $GITLAB_USERNAME
79

810
echo "===> Find Tenant ID"
911
TENANT_ID=$(kubectl --context minikube -n lieutenant get tenant | grep t- | awk 'NR==1{print $1}')
@@ -21,6 +23,10 @@ echo "===> Removing everything"
2123
kubectl --context minikube -n lieutenant delete cluster "$K3S_CLUSTER_ID"
2224
kubectl --context minikube -n lieutenant delete cluster "$MINIKUBE_CLUSTER_ID"
2325
kubectl --context minikube -n lieutenant delete tenant "$TENANT_ID"
24-
minikube delete
25-
k3d cluster delete projectsyn
26-
killall ngrok
26+
27+
echo "===> Waiting 20 seconds for the removal of GitLab repositories"
28+
sleep 20s
29+
30+
# minikube delete
31+
# k3d cluster delete projectsyn
32+
# killall ngrok

assets/code/main.jsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ local labelSelector = {
4646
namespace: namespace
4747
},
4848
spec: {
49+
replicas: 2,
4950
template: {
5051
spec: {
5152
containers: [

tutorial.adoc

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Commodore Components allow you to customize and extend the number and variety of
1919

2020
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

22-
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.
22+
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

2424
In this tutorial, we are going to do the following:
2525

@@ -36,7 +36,7 @@ As for the required knowledge bits and pieces:
3636
* You should understand https://syn.tools/syn/about/features.html[what Project Syn is], and its https://syn.tools/syn/about/architecture.html[architecture].
3737
* You should have already followed the https://docs.syn.tools/syn/tutorials/getting-started.html[Getting Started with Project Syn] tutorial, and be familiar with common Project Syn tasks.
3838

39-
WARNING: This tutorial *was built and tested on a Linux system*; it should, however, be easily ported to macOS, since all tools referenced here are cross-platform.
39+
This tutorial *was built on a Linux system*, and tested in both Linux and macOS; it should, however, be easily ported to other https://en.wikipedia.org/wiki/Unix-like[Unices], since all tools referenced here are cross-platform.
4040

4141
To follow this tutorial you will need quite an array of software in your system:
4242

@@ -54,11 +54,11 @@ To follow this tutorial you will need quite an array of software in your system:
5454

5555
This tutorial project contains a `0_requirements.sh` script which outputs all of your currently installed versions of the aforementioned software packages.
5656

57-
IMPORTANT: The specified version numbers are the minimum required. Also, please make sure that both your GitLab and GitHub accounts must have SSH keys configured.
57+
The specified version numbers are the minimum required. Also, please make sure that *both your GitLab and GitHub accounts must have SSH keys configured.*
5858

5959
== Preparations
6060

61-
Make sure to follow these three steps *before* starting the tutorial:
61+
Follow these three steps *before* starting the tutorial:
6262

6363
. Check all required tools by running the `./0_requirements.sh` script.
6464
. In GitHub, fork the https://github.com/projectsyn/commodore-defaults[commodore-defaults] project to your own personal account.
@@ -98,7 +98,7 @@ This script will launch a new Minikube instance, will apply all the required `ku
9898

9999
It will also expose the Lieutenant API using the https://ngrok.com/[ngrok] reverse proxy tool.
100100

101-
WARNING: You do not need a commercial (paying) ngrok account to use it; just https://ngrok.com/download[download] the version corresponding to your system and make sure it is accessible through your `PATH`.
101+
You do not need a commercial (paying) ngrok account to use it; just https://ngrok.com/download[download] the version corresponding to your system and install it somewhere in your `PATH`.
102102

103103
Once the script has run, you will find two new private repositories in your GitLab account: one named `tutorial-cluster-minikube` and another named `tutorial-tenant`. Project Syn tools use these repositories to perform https://www.gitops.tech/["GitOps"] operations on all the clusters.
104104

@@ -114,7 +114,7 @@ The second step in this tutorial is to bootstrap https://docs.syn.tools/commodor
114114
$ export COMMODORE_SSH_PRIVATE_KEY=~/.ssh/id_rsa
115115
----
116116

117-
IMPORTANT: Do not press the kbd:[Enter] key when prompted with the `If you don't see a command prompt, try pressing enter` message! Instead, type the passphrase of your SSH key.
117+
Do not press the kbd:[Enter] key when prompted with the `If you don't see a command prompt, try pressing enter` message! Instead, type the passphrase of your SSH key.
118118

119119
=== Install Steward on Minikube
120120

@@ -158,7 +158,7 @@ t-muddy-sunset-5530 Tutorial Tenant 49m
158158

159159
Of course, in your case the NAME column will show different, random values. But we can see both clusters and the tenant object, all happily residing inside the realm of our Project Syn installation.
160160

161-
NOTE: For more information, check out the https://syn.tools/lieutenant-operator/explanation/design.html[diagram] in the Project Syn website.
161+
For more information, check out the https://syn.tools/lieutenant-operator/explanation/design.html[diagram] in the Project Syn website.
162162

163163
==== Inspecting the Lieutenant API traffic
164164

@@ -169,9 +169,7 @@ image::ngrok_inspect.png[]
169169

170170
=== Synthesize Kind or Microk8s clusters
171171

172-
IMPORTANT: This is an optional step!
173-
174-
If you feel adventurous enough, and still have enough available RAM in your system, install https://kind.sigs.k8s.io/[kind] or https://microk8s.io/[Microk8s] and run the `./4_synthesize_on_kind.sh` or `./4_synthesize_on_microk8s.sh` scripts, to spin up yet another cluster (or two!) to be added to your current tenant.
172+
This is an optional step! If you feel adventurous enough, and still have enough available RAM in your system, install https://kind.sigs.k8s.io/[kind] or https://microk8s.io/[Microk8s] and run the `./4_synthesize_on_kind.sh` or `./4_synthesize_on_microk8s.sh` scripts, to spin up yet another cluster (or two!) to be added to your current tenant.
175173

176174
== Creating a Commodore Component
177175

@@ -244,7 +242,7 @@ $ commodore catalog compile c-solitary-voice-5640
244242
...
245243
----
246244

247-
NOTE: We must repeat this operation for each cluster, and of course, you should use the cluster IDs you got from the last `kubectl` command above.
245+
We must repeat this operation for each cluster, and of course, you should use the cluster IDs you got from the last `kubectl` command above.
248246

249247
=== Creating a New Commodore Component
250248

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

255253
[source,bash]
256254
----
257-
$ Commodore Component new fortune
255+
$ commodore component new fortune
258256
Agent pid 9
259257
Enter passphrase for /app/.ssh/id_rsa:
260258
Identity added: /app/.ssh/id_rsa (user@domain.com)
@@ -326,7 +324,7 @@ Now that we have written our component, let's compile it to see if it's generati
326324

327325
[source,bash]
328326
----
329-
$ Commodore Component compile dependencies/fortune
327+
$ commodore component compile dependencies/fortune
330328
Agent pid 9
331329
Enter passphrase for /app/.ssh/id_rsa:
332330
Identity added: /app/.ssh/id_rsa (user@domain.com)
@@ -411,7 +409,7 @@ $ git push
411409
$ cd ../../../
412410
----
413411

414-
NOTE: Since we edited the `common.yml` file, the changes will propagate to all clusters.
412+
Since we edited the `common.yml` file, the changes will propagate to all clusters. If you want your changes to apply to just one cluster, edit the corresponding file in the same folder.
415413

416414
=== Deployment
417415

@@ -425,7 +423,7 @@ c-aged-cloud-4988 Kind cluster t-weathered-fire-7929 3m58s
425423
c-late-cloud-248 K3s cluster t-weathered-fire-7929 8m24s
426424
c-solitary-voice-5640 Minikube cluster t-weathered-fire-7929 10m
427425
428-
$ commodore catalog compile c-solitary-voice-5640
426+
$ commodore catalog compile --push c-solitary-voice-5640
429427
Agent pid 9
430428
Enter passphrase for /app/.ssh/id_rsa:
431429
Identity added: /app/.ssh/id_rsa (user@domain.com)
@@ -457,13 +455,13 @@ We have to do this for all clusters!
457455

458456
[source,bash]
459457
----
460-
$ commodore catalog compile c-aged-cloud-4988
458+
$ commodore catalog compile --push c-aged-cloud-4988
461459
Agent pid 9
462460
Enter passphrase for /app/.ssh/id_rsa:
463461
Identity added: /app/.ssh/id_rsa (user@domain.com)
464462
...
465463
466-
$ commodore catalog compile c-late-cloud-248
464+
$ commodore catalog compile --push c-late-cloud-248
467465
...
468466
469467
----
@@ -534,7 +532,7 @@ We are done! You can now remove the clusters in your computer, and also remove t
534532
* Run the `./5_delete.sh` script to deregister and stop all local clusters.
535533
* Remove your clone of `commodore-defaults` on GitHub.
536534

537-
TIP: The GitLab projects `tutorial-tenant`, `tutorial-cluster-minikube`, and `tutorial-cluster-k3s` have been automatically deleted by the Lieutenant Operator.
535+
The GitLab projects `tutorial-tenant`, `tutorial-cluster-minikube`, and `tutorial-cluster-k3s` have been automatically deleted by the Lieutenant Operator.
538536

539537
[source,bash]
540538
----
@@ -569,6 +567,6 @@ I hope this tutorial has given you a good idea of what Commodore Components are,
569567

570568
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.
571569

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.
570+
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. As a next step, we recommend that you read the https://openshift.docs.vshn.ch/oc4/references/projectsyn/developer.html[Commodore Component Developer Guidelines].
573571

574572
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)