Skip to content

Commit

Permalink
fix Server model; add redis components for guestbook app (#82)
Browse files Browse the repository at this point in the history
* add name attribute on Server model; add redis components for guestbook app

* update server model: remove boilerplate

* update server label key
  • Loading branch information
amyXia1994 authored Jan 10, 2023
1 parent 2bc8594 commit 11620a1
Show file tree
Hide file tree
Showing 43 changed files with 784 additions and 278 deletions.
4 changes: 2 additions & 2 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"customizations": {
"codespaces": {
"openFiles": [
"appops/guestbook-frontend/dev/main.k",
"appops/guestbook-frontend/base/base.k"
"appops/guestbook/dev/main.k",
"appops/guestbook/base/base.k"
]
}
},
Expand Down
4 changes: 3 additions & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Konfig,也叫做 Kusion Model,是 KusionStack 中预置的、使用 KCL 描
├── Makefile # 通过 Makefile 封装常用命令
├── README.md # 配置大库说明
├── appops # 应用运维目录,用来放置所有应用的 KCL 运维配置
│ ├── guestbook-frontend
│ ├── clickhouse-operator
│ ├── code-city
│ ├── guestbook
│ ├── http-echo
│ └── nginx-example
├── base # Kusion Model 模型库
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ The overall structure of the configuration library is as follows:
├── Makefile # use Makefile to encapsulate common commands
├── README.md # configuration library instructions
├── appops # application operation and maintenance directory
│ ├── guestbook-frontend
│ ├── clickhouse-operator
│ ├── code-city
│ ├── guestbook
│ ├── http-echo
│ └── nginx-example
├── base # Kusion Model repository
Expand Down
36 changes: 0 additions & 36 deletions appops/guestbook-frontend/base/base.k

This file was deleted.

75 changes: 0 additions & 75 deletions appops/guestbook-frontend/dev/ci-test/stdout.golden.yaml

This file was deleted.

75 changes: 0 additions & 75 deletions appops/guestbook-frontend/prod/ci-test/stdout.golden.yaml

This file was deleted.

75 changes: 0 additions & 75 deletions appops/guestbook-frontend/test/ci-test/stdout.golden.yaml

This file was deleted.

File renamed without changes.
File renamed without changes.
68 changes: 68 additions & 0 deletions appops/guestbook/base/base.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import base.pkg.kusion_models.kube.frontend
import base.pkg.kusion_models.kube.frontend.container
import base.pkg.kusion_models.kube.frontend.service
import base.pkg.kusion_models.kube.templates.resource as res_tpl

# Application Configuration
guestbookFrontend: frontend.Server {
name = "frontend"
# Main Container Configuration
mainContainer = container.Main {
name = "php-redis"
env = [
{
name = "GET_HOSTS_FROM"
value = "dns"
}
]
ports = [{containerPort = 80}]
}
schedulingStrategy.resource = res_tpl.tiny
services = [
service.Service {
ports = [
{
"port" = 80
}
]
}
]
}

redisLeader: frontend.Server {
name = "redis-leader"
# Main Container Configuration
mainContainer = container.Main {
ports = [{containerPort = 6379}]
}
image = "docker.io/redis:6.0.5"
schedulingStrategy.resource = res_tpl.tiny
services = [
service.Service {
ports = [
{
"port" = 6379
}
]
}
]
}

redisFollower: frontend.Server {
name = "redis-follower"
# Main Container Configuration
mainContainer = container.Main {
ports = [{containerPort = 6379}]
}
image = "gcr.io/google_samples/gb-redis-follower:v2"
schedulingStrategy.resource = res_tpl.tiny
services = [
service.Service {
ports = [
{
"port" = 6379
}
]
}
]
}
File renamed without changes.
Loading

0 comments on commit 11620a1

Please sign in to comment.