-
Notifications
You must be signed in to change notification settings - Fork 46
docs: fix a couple of minor docs typos/mistakes #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -526,7 +526,7 @@ nginx = Nginx { | |
```python | ||
nginx = NginxProd { | ||
labels.run = "my-nginx" | ||
labels.env = "pre-prod" | ||
labels.env = "prod" | ||
} | ||
``` | ||
|
||
|
@@ -575,10 +575,10 @@ Now, we can complete the declaration of the server configuration through the Dep | |
|
||
However, usually, the actual situation is more complicated, and the deployment may have a variety of optional variable accessories. | ||
|
||
For example, we want to support a persistent volume claim based on an existing schema, as a reusable Kubernetes schema. In this case, we can just wrapper it with a `mixin` and a `protocol` as follows: | ||
For example, we want to support a persistent volume claim based on an existing schema, as a reusable Kubernetes schema. In this case, we can just wrap it with a `mixin` and a `protocol` as follows: | ||
|
||
```python | ||
import k8spkg.api.core.v1 | ||
import k8s.api.core.v1 | ||
|
||
protocol PVCProtocol: | ||
pvc?: {str:} | ||
|
@@ -604,6 +604,12 @@ mixin PersistentVolumeClaimMixin for PVCProtocol: | |
} | ||
``` | ||
|
||
> Note: for the `k8s.api.core.v1` import to work, we need to initialize a module and add the `k8s` module as a dependency: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the first time in this doc where external dependencies are used. Perhaps it's worth mentioning how to run this example. |
||
> ```bash | ||
> kcl mod init | ||
> kcl mod add k8s | ||
> ``` | ||
|
||
With this PersistentVolumeClaimMixin, we define a PVC schema with a clear `user interface`, and use Kubernetes PVC as an implementation. Then, we can define a server schema with Deployment schema, and PVC mixin schema. | ||
|
||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -450,7 +450,7 @@ _priorityCpuMap = { | |
"3" = 1024 | ||
} | ||
# Using a dict to simplify logic and the default value is 2048 | ||
_cpu = _priorityCpuMap[_priority] or 2048 | ||
_cpu = _priorityCpuMap[str(_priority)] or 2048 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This example would originally always return 2048 regardless of |
||
_name = "nginx" | ||
# exported variables | ||
cpu = _cpu | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this package no longer exists