Skip to content

Commit 66ec959

Browse files
cehmpvl
authored andcommitted
doc/tutorial/kubernetes: fix typos
Change-Id: Ie96345c264aceebd0117d0b6fecdd4fcef9c0053 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2560 Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent c3d0b48 commit 66ec959

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

doc/tutorial/kubernetes/README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ in subdirectories.
1010
This is a common pattern.
1111
The `cue` tooling has been optimized for this use case.
1212

13-
In this tutorial we will address the folowing topics:
13+
In this tutorial we will address the following topics:
1414

1515
1. convert the given YAML files to CUE
1616
1. hoist common patterns to parent directories
@@ -99,7 +99,7 @@ Many of the files contain more than one Kubernetes object.
9999
Moreover, we are creating a single configuration that contains all objects
100100
of all files.
101101
We need to organize all Kubernetes objects such that each is individually
102-
identifyable within a single configuration.
102+
identifiable within a single configuration.
103103
We do so by defining a different struct for each type putting each object
104104
in this respective struct keyed by its name.
105105
This allows objects of different types to share the same name,
@@ -464,14 +464,14 @@ $ cue fmt
464464
```
465465

466466
The common configuration has been factored out into `_spec`.
467-
We introducded `_name` to aid both specifying and referring
467+
We introduced `_name` to aid both specifying and referring
468468
to the name of an object.
469469
For completeness, we added `configMap` as a top-level entry.
470470

471471
Note that we have not yet removed the old definition of deployment.
472472
This is fine.
473473
As it is equivalent to the new one, unifying them will have no effect.
474-
We leave its removal as an excersize to the reader.
474+
We leave its removal as an exercise to the reader.
475475

476476
Next we observe that all deployments, stateful sets and daemon sets have
477477
an accompanying service which shares many of the same fields.
@@ -505,8 +505,8 @@ $ cue fmt
505505
```
506506

507507
This example introduces a few new concepts.
508-
Open-ended lists are indicated with an elipsis (`...`).
509-
The value following an elipsis is unified with any subsequent elements and
508+
Open-ended lists are indicated with an ellipsis (`...`).
509+
The value following an ellipsis is unified with any subsequent elements and
510510
defines the "type", or template, for additional list elements.
511511

512512
The `Port` declaration is an alias.
@@ -515,7 +515,7 @@ They can be used to make shadowed fields visible within nested scopes or,
515515
in this case, to reduce boilerplate without introducing new fields.
516516

517517
Finally, this example introduces list and field comprehensions.
518-
List comprehensions are analoguous to list comprehensions found in other
518+
List comprehensions are analogous to list comprehensions found in other
519519
languages.
520520
Field comprehensions allow inserting fields in structs.
521521
In this case, the field comprehension adds a namesake service for any
@@ -524,7 +524,7 @@ Field comprehensions can also be used to add a field conditionally.
524524

525525

526526
Specifying the `targetPort` is not necessary, but since many files define it,
527-
defining it here will allow those defintitions to be removed
527+
defining it here will allow those definitions to be removed
528528
using `cue trim`.
529529
We add an option `_export` for ports defined in containers to specify whether
530530
to include them in the service and explicitly set this to false
@@ -558,14 +558,14 @@ $ cue trim ./...
558558
$ find . | grep kube.cue | xargs wc | tail -1
559559
1129 2270 22073 total
560560
```
561-
This is after removing the rewriten and now redundant deployment definition.
561+
This is after removing the rewritten and now redundant deployment definition.
562562

563563
We shaved off almost another 100 lines, even after adding the template.
564564
You can verify that the service definitions are now gone in most of the files.
565565
What remains is either some additional configuration, or inconsistencies that
566566
should probably be cleaned up.
567567

568-
But we have another trick up our sleave.
568+
But we have another trick up our sleeve.
569569
With the `-s` or `--simplify` option we can tell `trim` or `fmt` to collapse
570570
structs with a single element onto a single line. For instance:
571571

@@ -650,10 +650,10 @@ $ find . | grep kube.cue | xargs wc | tail -1
650650
931 2052 19624 total
651651
```
652652

653-
Antoher 40 lines removed.
653+
Another 40 lines removed.
654654
We may have gotten used to larger reductions, but at this point there is just
655655
not much left to remove: in some of the frontend files there are only 4 lines
656-
of confiugration left.
656+
of configuration left.
657657

658658

659659
#### Directory `kitchen`
@@ -736,7 +736,7 @@ This template definition is not ideal: the definitions are positional, so if
736736
configurations were to define the disks in a different order, there would be
737737
no reuse or even conflicts.
738738
Also note that in order to deal with this restriction, almost all field values
739-
are just default values and can be overriden by instances.
739+
are just default values and can be overridden by instances.
740740
A better way would be define a map of volumes,
741741
similarly to how we organized the top-level Kubernetes objects,
742742
and then generate these two sections from this map.
@@ -765,7 +765,7 @@ We also reduced the configuration by a sizeable amount once more.
765765

766766
However, on closer inspection of the remaining files we see a lot of remaining
767767
fields in the disk specifications as a result of inconsistent naming.
768-
Reducing configurations like we did in this excersize exposes inconsistencies.
768+
Reducing configurations like we did in this exercise exposes inconsistencies.
769769
The inconsistencies can be removed by simply deleting the overrides in the
770770
specific configuration.
771771
Leaving them as is gives a clear signal that a configuration is inconsistent.
@@ -774,7 +774,7 @@ Leaving them as is gives a clear signal that a configuration is inconsistent.
774774
### Conclusion of Quick 'n Dirty tutorial
775775

776776
There is still some gain to be made with the other directories.
777-
At nearly a 1000-line, or 55%, reduction, we leave the rest as an excersize to
777+
At nearly a 1000-line, or 55%, reduction, we leave the rest as an exercise to
778778
the reader.
779779

780780
We have shown how CUE can be used to reduce boilerplate, enforce consistencies,
@@ -920,7 +920,7 @@ values.
920920
The result may contain conflicts, such as our top-level `_component` field,
921921
but our per-type maps of Kubernetes objects should be free of conflict
922922
(if there is, we have a problem with Kubernetes down the line).
923-
A merge thus gives us a unfied view of all objects.
923+
A merge thus gives us a unified view of all objects.
924924

925925
```
926926
$ cue ls ./...
@@ -1010,7 +1010,7 @@ EOF
10101010
This command has two tasks, named `kube` and `display`.
10111011
The `display` task depends on the output of the `kube` task.
10121012
The `cue` tool does a static analysis of the dependencies and runs all
1013-
tasks which depencies are satisfied in parallel while blocking tasks
1013+
tasks which dependencies are satisfied in parallel while blocking tasks
10141014
for which an input is missing.
10151015

10161016
```
@@ -1088,7 +1088,7 @@ In the next sections we will show how to get there.
10881088

10891089
### Outline
10901090

1091-
The basic premis of our configuration is to maintain two configurations,
1091+
The basic premise of our configuration is to maintain two configurations,
10921092
a simple and abstract one, and one compatible with Kubernetes.
10931093
The Kubernetes version is automatically generated from the simple configuration.
10941094
Each simplified object has a `kubernetes` section that get gets merged into
@@ -1124,7 +1124,7 @@ Overall, the code modeling our services and the code generating the kubernetes
11241124
code is separated, while still allowing to inject Kubernetes-specific
11251125
data into our general model.
11261126
At the same time, we can add additional information to our model without
1127-
it ending up in the Kubernetes defintions causing it to barf.
1127+
it ending up in the Kubernetes definitions causing it to barf.
11281128

11291129

11301130
### Deployment Definition
@@ -1152,7 +1152,7 @@ This also eliminates the need for `_spec`.
11521152

11531153
The next step is to pull common fields, such as `image` to the top level.
11541154

1155-
Arguments can be specied as a map.
1155+
Arguments can be specified as a map.
11561156
```
11571157
arg <Key>: string
11581158
args: [ "-\(k)=\(v)" for k, v in arg ] | [...string]
@@ -1268,7 +1268,7 @@ part of this exercise.
12681268
That said, most CUE users will never have to resort to this level of CUE
12691269
to write configurations.
12701270
For instance, none of the files in the subdirectories contain comprehensions,
1271-
not even the template files in these directores (such as `kitchen/kube.cue`).
1271+
not even the template files in these directories (such as `kitchen/kube.cue`).
12721272
Furthermore, none of the configuration files in any of the
12731273
leaf directories contain string interpolations.
12741274

@@ -1284,23 +1284,23 @@ $ find . | grep kube.cue | xargs wc | tail -1
12841284
```
12851285
This does not count our conversion templates.
12861286
Assuming that the top-level templates are reusable, and if we don't count them
1287-
for both approaches, the manual approach shaves off about anoter 150 lines.
1287+
for both approaches, the manual approach shaves off about another 150 lines.
12881288
If we count the templates as well, the two approaches are roughly equal.
12891289

12901290

12911291
### Conclusions Manual Configuration
12921292

12931293
We have shown that we can further compact a configuration by manually
12941294
optimizing template files.
1295-
However, we have also shown that the manual optimizition only gives
1295+
However, we have also shown that the manual optimization only gives
12961296
a marginal benefit with respect to the quick-and-dirty semi-automatic reduction.
1297-
The benefits for the manual definition largely lies in the orginazational
1297+
The benefits for the manual definition largely lies in the organizational
12981298
flexibility one gets.
12991299

13001300
Manually tailoring your configurations allows creating an abstraction layer
13011301
between logical definitions and Kubernetes-specific definitions.
13021302
At the same time, CUE's order independence
1303-
makes it easy to mix in low-level Kubernetes configuration whereever it is
1303+
makes it easy to mix in low-level Kubernetes configuration wherever it is
13041304
convenient and applicable.
13051305

13061306
Manual tailoring also allows us to add our own definitions without breaking

0 commit comments

Comments
 (0)