Skip to content

Commit

Permalink
refactor: code org
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Mar 26, 2024
1 parent 40ddcd2 commit ade147b
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ kcl run
## Test

```shell
kcl test
kcl test ./...
```
File renamed without changes.
103 changes: 103 additions & 0 deletions docs/flask_manifests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# flask_manifests

## Index

- app
- [App](#app)
- [Container](#container)
- [ContainerPort](#containerport)
- [Env](#env)
- [Port](#port)
- [Resource](#resource)
- [Service](#service)
- [Volume](#volume)

## Schemas

### App

The application model.

#### Attributes

| name | type | description | default value |
| --- | --- | --- | --- |
|**containers**|{str:[Container](#container)}|||
|**labels**|{str:str}||{app = name}|
|**name** `required`|str|||
|**replicas** `required`|int||1|
|**service**|[Service](#service)|||
### Container

The container model.

#### Attributes

| name | type | description | default value |
| --- | --- | --- | --- |
|**args**|[str]|||
|**command**|[str]|||
|**env**|[[Env](#env)]|||
|**image** `required`|str|||
|**ports** `required`|[[ContainerPort](#containerport)]|||
|**resources**|[Resource](#resource)|||
|**volumes**|[[Volume](#volume)]|||
### ContainerPort

The container port model.

#### Attributes

| name | type | description | default value |
| --- | --- | --- | --- |
|**containerPort** `required`|int|||
|**name**|str|||
|**protocol** `required`|"TCP" | "UDP" | "SCTP"||"TCP"|
### Env

#### Attributes

| name | type | description | default value |
| --- | --- | --- | --- |
|**name** `required`|str|||
|**value** `required`|str|||
### Port

The port model.

#### Attributes

| name | type | description | default value |
| --- | --- | --- | --- |
|**port** `required`|int|||
|**protocol** `required`|"TCP" | "UDP" | "SCTP"||"TCP"|
|**targetPort**|int | str|||
### Resource

#### Attributes

| name | type | description | default value |
| --- | --- | --- | --- |
|**limits**|{str:}|||
|**requests**|{str:}|||
### Service

The service model.

#### Attributes

| name | type | description | default value |
| --- | --- | --- | --- |
|**ports** `required`|[[Port](#port)]|||
|**type**|str|||
### Volume

#### Attributes

| name | type | description | default value |
| --- | --- | --- | --- |
|**path** `required`|str|||
|**readOnly**|bool||False|
|**source** `required`|str|||
|**target** `required`|str|||
<!-- Auto generated by kcl-doc tool, please do not edit. -->
2 changes: 1 addition & 1 deletion kcl.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name = "flask_manifests"
version = "0.0.1"

[profile]
entries = ["main.k", "kubernetes_render.k"]
entries = ["main.k", "render/k8s/kubernetes_render.k"]

2 changes: 1 addition & 1 deletion main.k
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import app

config = app.App {
name = "flask-demo"
containers: {
Expand All @@ -10,4 +11,3 @@ config = app.App {
service: {ports = [{port = 5000, targetPort = 5000}]}
service: {type = "NodePort"}
}

2 changes: 1 addition & 1 deletion kubernetes_render.k → render/k8s/kubernetes_render.k
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import manifests

import .app
import app

# Convert the `App` model into Kubernetes Deployment and Service Manifests
kubernetesRender = lambda a: app.App {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import manifests

import app

# Convert the `App` model into Kubernetes Deployment and Service Manifests
Expand Down

0 comments on commit ade147b

Please sign in to comment.