Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tke-eos
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
tke-eos
Commits
fbd45b87
Commit
fbd45b87
authored
May 31, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂存
parent
1c73cc60
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
210 additions
and
180 deletions
+210
-180
service.js
app/service.js
+19
-15
service.js
kubeService/service.js
+7
-9
index.js
middleware/error/index.js
+1
-1
package-lock.json
package-lock.json
+4
-62
package.json
package.json
+0
-1
index.js
yamls/index.js
+6
-0
java.yaml
yamls/java.yaml
+62
-0
mysql.pvc.yaml
yamls/mysql.pvc.yaml
+12
-12
rabbitmq.pvc.yaml
yamls/rabbitmq.pvc.yaml
+13
-13
redis.pvc.yaml
yamls/redis.pvc.yaml
+12
-12
ui.node.yaml
yamls/ui.node.yaml
+62
-0
ui.yaml
yamls/ui.yaml
+0
-43
zookeeper.pvc.yaml
yamls/zookeeper.pvc.yaml
+12
-12
No files found.
app/service.js
View file @
fbd45b87
...
...
@@ -47,31 +47,34 @@ router.get('/', async (ctx) => {
const
createService
=
async
(
ctx
)
=>
{
const
{
type
,
serviceName
,
namespace
,
image
,
system_name
,
domain
,
label
,
debug
,
type
,
serviceName
,
namespace
,
system_name
,
domain
,
label
,
}
=
ctx
.
request
.
body
logger
.
info
(
'
创建服务
'
,
ctx
.
request
.
body
)
if
(
label
===
'
base
'
)
{
await
serviceCreate
(
namespace
,
serviceName
,
image
,
label
)
// 资源限制
const
resources
=
projectConfig
[
serviceName
]
||
defaultConfig
[
type
]
logger
.
info
(
'
资源限制
'
,
JSON
.
stringify
(
resources
))
const
data
=
ctx
.
request
.
body
data
.
resources
=
resources
if
(
label
===
'
base
'
||
label
===
'
ui
'
||
label
===
'
node
'
)
{
await
serviceCreate
(
data
)
if
(
label
!==
'
base
'
)
{
if
(
serviceName
===
'
xyqb-user2
'
)
{
await
ingressCreate
(
namespace
,
'
xyqb-user2-2
'
,
'
passportapi2
'
)
}
await
ingressCreate
(
namespace
,
serviceName
,
domain
)
}
ctx
.
body
=
ctx
.
ok
(
'
创建成功
'
)
return
}
const
data
=
{
serviceName
,
namespace
,
image
,
system_name
,
debug
,
}
if
(
!
system_name
)
{
// ui abTest的时候不一样
data
.
system_name
=
serviceName
}
// 资源限制
const
resources
=
projectConfig
[
data
.
system_name
]
||
defaultConfig
[
type
]
logger
.
info
(
'
资源限制
'
,
JSON
.
stringify
(
resources
))
data
.
resources
=
resources
const
template
=
templates
[
type
].
replace
(
/{{
([
A-Za-z0-9_
\.]
+
)
}}/g
,
function
()
{
if
(
_
.
get
(
data
,
arguments
[
1
],
null
)
===
null
)
{
throw
new
Error
(
`缺少模板所需变量:
${
arguments
[
1
]}
`
)
...
...
@@ -115,6 +118,7 @@ router.post('/details', async (ctx) => {
const
data
=
await
ctx
.
cluster
.
service_get
(
ctx
.
request
.
body
.
serviceName
,
ctx
.
request
.
body
.
namespace
)
ctx
.
body
=
ctx
.
ok
(
Object
.
assign
({},
data
,
{
lanIp
}))
})
router
.
post
(
'
/delete
'
,
async
(
ctx
)
=>
{
await
ctx
.
cluster
.
service_delete
(
ctx
.
request
.
body
.
serviceName
,
ctx
.
request
.
body
.
namespace
)
if
(
ctx
.
request
.
body
.
serviceName
===
'
xyqb-user2
'
)
{
...
...
kubeService/service.js
View file @
fbd45b87
...
...
@@ -15,15 +15,9 @@ const client = new Client({
const
serviceGet
=
async
(
namespace
,
serviceName
)
=>
client
.
api
.
v1
.
namespaces
(
namespace
).
services
(
serviceName
).
get
()
const
podGet
=
async
namespace
=>
client
.
api
.
v1
.
namespaces
(
namespace
).
pods
.
get
()
const
serviceCreate
=
async
(
namespace
,
serviceName
,
image
)
=>
{
const
data
=
{
namespace
,
app
:
serviceName
,
image
,
}
const
pvcName
=
`
${
serviceName
}
-
${
namespace
}
`
const
yamlManifest
=
yamls
[
serviceName
].
replace
(
/{{
([
A-Za-z0-9_
\.]
+
)
}}/g
,
function
()
{
const
serviceCreate
=
async
(
data
)
=>
{
const
{
type
,
namespace
,
serviceName
}
=
data
const
yamlManifest
=
yamls
[
type
].
replace
(
/{{
([
A-Za-z0-9_
\.]
+
)
}}/g
,
function
()
{
if
(
_
.
get
(
data
,
arguments
[
1
],
null
)
===
null
)
{
throw
new
Error
(
`缺少模板所需变量:
${
arguments
[
1
]}
`
)
}
...
...
@@ -34,7 +28,10 @@ const serviceCreate = async (namespace, serviceName, image) => {
for
(
const
item
of
yamlArray
)
{
const
jsonObj
=
yaml
.
load
(
item
);
console
.
log
(
JSON
.
stringify
(
jsonObj
))
let
pvc
let
pvcName
switch
(
jsonObj
.
kind
)
{
case
'
Service
'
:
...
...
@@ -46,6 +43,7 @@ const serviceCreate = async (namespace, serviceName, image) => {
break
;
case
'
PersistentVolumeClaim
'
:
pvcName
=
`
${
serviceName
}
-
${
namespace
}
`
pvc
=
await
client
.
api
.
v1
.
namespaces
(
namespace
).
persistentvolumeclaims
.
get
()
pvc
=
pvc
.
body
.
items
.
filter
(
item
=>
item
.
metadata
.
name
===
pvcName
)
if
(
!
pvc
.
length
)
{
...
...
middleware/error/index.js
View file @
fbd45b87
const
logger
=
require
(
'
log4js
'
).
getLogger
(
'
error
'
)
const
logger
=
require
(
'
koa-log4
'
).
getLogger
(
'
error
'
)
module
.
exports
=
function
()
{
return
async
function
(
ctx
,
next
)
{
...
...
package-lock.json
View file @
fbd45b87
...
...
@@ -178,14 +178,6 @@
"integrity"
:
"sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg=="
,
"dev"
:
true
},
"async"
:
{
"version"
:
"2.6.2"
,
"resolved"
:
"http://npmprivate.quantgroups.com/async/-/async-2.6.2.tgz"
,
"integrity"
:
"sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg=="
,
"requires"
:
{
"lodash"
:
"^4.17.11"
}
},
"async-each"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"http://registry.npm.taobao.org/async-each/download/async-each-1.0.1.tgz"
,
...
...
@@ -704,11 +696,6 @@
"assert-plus"
:
"^1.0.0"
}
},
"date-format"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"http://npmprivate.quantgroups.com/date-format/-/date-format-2.0.0.tgz"
,
"integrity"
:
"sha512-M6UqVvZVgFYqZL1SfHsRGIQSz3ZL+qgbsV5Lp1Vj61LZVYuEwcMXYay7DRDtYs2HQQBK5hQtQ0fD9aEJ89V0LA=="
},
"debug"
:
{
"version"
:
"3.1.0"
,
"resolved"
:
"http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz"
,
...
...
@@ -1424,7 +1411,8 @@
"flatted"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"http://npmprivate.quantgroups.com/flatted/-/flatted-2.0.0.tgz"
,
"integrity"
:
"sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg=="
"integrity"
:
"sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg=="
,
"dev"
:
true
},
"fluent-openapi"
:
{
"version"
:
"1.0.0"
,
...
...
@@ -1478,16 +1466,6 @@
"readable-stream"
:
"^2.0.0"
}
},
"fs-extra"
:
{
"version"
:
"7.0.1"
,
"resolved"
:
"http://npmprivate.quantgroups.com/fs-extra/-/fs-extra-7.0.1.tgz"
,
"integrity"
:
"sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw=="
,
"requires"
:
{
"graceful-fs"
:
"^4.1.2"
,
"jsonfile"
:
"^4.0.0"
,
"universalify"
:
"^0.1.0"
}
},
"fs.realpath"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"http://npmprivate.quantgroups.com/fs.realpath/-/fs.realpath-1.0.0.tgz"
,
...
...
@@ -2126,7 +2104,8 @@
"graceful-fs"
:
{
"version"
:
"4.1.15"
,
"resolved"
:
"http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.1.15.tgz"
,
"integrity"
:
"sha1-/7cD4QZuig7qpMi4C6klPu77+wA="
"integrity"
:
"sha1-/7cD4QZuig7qpMi4C6klPu77+wA="
,
"dev"
:
true
},
"har-schema"
:
{
"version"
:
"2.0.0"
,
...
...
@@ -2726,14 +2705,6 @@
"resolved"
:
"http://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz"
,
"integrity"
:
"sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
},
"jsonfile"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"http://npmprivate.quantgroups.com/jsonfile/-/jsonfile-4.0.0.tgz"
,
"integrity"
:
"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss="
,
"requires"
:
{
"graceful-fs"
:
"^4.1.6"
}
},
"jsprim"
:
{
"version"
:
"1.4.1"
,
"resolved"
:
"http://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz"
,
...
...
@@ -2973,18 +2944,6 @@
"resolved"
:
"http://npmprivate.quantgroups.com/lodash.merge/-/lodash.merge-4.6.1.tgz"
,
"integrity"
:
"sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ=="
},
"log4js"
:
{
"version"
:
"4.0.2"
,
"resolved"
:
"http://npmprivate.quantgroups.com/log4js/-/log4js-4.0.2.tgz"
,
"integrity"
:
"sha512-KE7HjiieVDPPdveA3bJZSuu0n8chMkFl8mIoisBFxwEJ9FmXe4YzNuiqSwYUiR1K8q8/5/8Yd6AClENY1RA9ww=="
,
"requires"
:
{
"date-format"
:
"^2.0.0"
,
"debug"
:
"^3.1.0"
,
"flatted"
:
"^2.0.0"
,
"rfdc"
:
"^1.1.2"
,
"streamroller"
:
"^1.0.1"
}
},
"long"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"http://npmprivate.quantgroups.com/long/-/long-4.0.0.tgz"
,
...
...
@@ -4325,18 +4284,6 @@
"resolved"
:
"http://registry.npm.taobao.org/statuses/download/statuses-1.5.0.tgz"
,
"integrity"
:
"sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
"streamroller"
:
{
"version"
:
"1.0.3"
,
"resolved"
:
"http://npmprivate.quantgroups.com/streamroller/-/streamroller-1.0.3.tgz"
,
"integrity"
:
"sha512-P7z9NwP51EltdZ81otaGAN3ob+/F88USJE546joNq7bqRNTe6jc74fTBDyynxP4qpIfKlt/CesEYicuMzI0yJg=="
,
"requires"
:
{
"async"
:
"^2.6.1"
,
"date-format"
:
"^2.0.0"
,
"debug"
:
"^3.1.0"
,
"fs-extra"
:
"^7.0.0"
,
"lodash"
:
"^4.17.10"
}
},
"strict-uri-encode"
:
{
"version"
:
"1.1.0"
,
"resolved"
:
"http://npmprivate.quantgroups.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz"
,
...
...
@@ -4664,11 +4611,6 @@
"crypto-random-string"
:
"^1.0.0"
}
},
"universalify"
:
{
"version"
:
"0.1.2"
,
"resolved"
:
"http://npmprivate.quantgroups.com/universalify/-/universalify-0.1.2.tgz"
,
"integrity"
:
"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
},
"unpipe"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"http://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz"
,
...
...
package.json
View file @
fbd45b87
...
...
@@ -12,7 +12,6 @@
"
koa-router
"
:
"
^7.4.0
"
,
"
kubernetes-client
"
:
"
^6.3.2
"
,
"
lodash
"
:
"
^4.17.11
"
,
"
log4js
"
:
"
^4.0.2
"
,
"
lru-cache
"
:
"
^5.1.1
"
,
"
request
"
:
"
^2.88.0
"
},
...
...
yamls/index.js
View file @
fbd45b87
...
...
@@ -4,10 +4,16 @@ const mysql = fs.readFileSync('yamls/mysql.pvc.yaml', 'utf8')
const
redis
=
fs
.
readFileSync
(
'
yamls/redis.pvc.yaml
'
,
'
utf8
'
)
const
rabbitmq
=
fs
.
readFileSync
(
'
yamls/rabbitmq.pvc.yaml
'
,
'
utf8
'
)
const
zookeeper
=
fs
.
readFileSync
(
'
yamls/zookeeper.pvc.yaml
'
,
'
utf8
'
)
const
ui
=
fs
.
readFileSync
(
'
yamls/ui.node.yaml
'
,
'
utf8
'
)
const
node
=
fs
.
readFileSync
(
'
yamls/ui.node.yaml
'
,
'
utf8
'
)
const
java
=
fs
.
readFileSync
(
'
yamls/java.yaml
'
,
'
utf8
'
)
module
.
exports
=
{
mysql
,
redis
,
rabbitmq
,
zookeeper
,
ui
,
node
,
java
,
}
yamls/java.yaml
0 → 100644
View file @
fbd45b87
apiVersion
:
apps/v1beta1
kind
:
Deployment
metadata
:
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
labels
:
type
:
{{
label
}}
qcloud-app
:
{{
serviceName
}}
spec
:
replicas
:
1
selector
:
matchLabels
:
qcloud-app
:
{{
serviceName
}}
strategy
:
type
:
Recreate
template
:
metadata
:
labels
:
qcloud-app
:
{{
serviceName
}}
spec
:
revisionHistoryLimit
:
1
containers
:
-
name
:
{{
serviceName
}}
image
:
ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy
:
Always
volumeMounts
:
env
:
-
name
:
NAMESPACE
value
:
{{
namespace
}}
-
name
:
DEBUG
value
:
{{
debug
}}
resources
:
requests
:
cpu
:
{{
resources.cpu.request
}}
m
memory
:
{{
resources.memory.request
}}
Mi
limits
:
cpu
:
{{
resources.cpu.limit
}}
m
memory
:
{{
resources.memory.limit
}}
Mi
restartPolicy
:
Always
dnsPolicy
:
ClusterFirst
imagePullSecrets
:
-
name
:
qcloudregistrykey
-
name
:
tencenthubkey
---
apiVersion
:
v1
kind
:
Service
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
type
:
NodePort
ports
:
-
name
:
http
port
:
80
targetPort
:
80
selector
:
qcloud-app
:
{{
serviceName
}}
yamls/mysql.pvc.yaml
View file @
fbd45b87
kind
:
PersistentVolumeClaim
apiVersion
:
v1
metadata
:
name
:
{{
app
}}
-{{namespace}}
name
:
{{
serviceName
}}
-{{namespace}}
namespace
:
{{
namespace
}}
spec
:
storageClassName
:
cbs
...
...
@@ -18,26 +18,26 @@ kind: Deployment
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
app
}}
name
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
replicas
:
1
revisionHistoryLimit
:
1
selector
:
matchLabels
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
strategy
:
type
:
Recreate
template
:
metadata
:
labels
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
spec
:
containers
:
-
image
:
ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy
:
Always
name
:
{{
app
}}
name
:
{{
serviceName
}}
resources
:
requests
:
memory
:
400Mi
...
...
@@ -56,11 +56,11 @@ spec:
value
:
qa
volumeMounts
:
-
mountPath
:
"
/var/lib/mysql"
name
:
{{
app
}}
name
:
{{
serviceName
}}
volumes
:
-
name
:
{{
app
}}
-
name
:
{{
serviceName
}}
persistentVolumeClaim
:
claimName
:
{{
app
}}
-{{namespace}}
claimName
:
{{
serviceName
}}
-{{namespace}}
imagePullSecrets
:
-
name
:
qcloudregistrykey
-
name
:
tencenthubkey
...
...
@@ -74,8 +74,8 @@ kind: Service
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
app
}}
name
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
type
:
NodePort
...
...
@@ -84,4 +84,4 @@ spec:
port
:
3306
targetPort
:
3306
selector
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
yamls/rabbitmq.pvc.yaml
View file @
fbd45b87
kind
:
PersistentVolumeClaim
apiVersion
:
v1
metadata
:
name
:
{{
app
}}
-{{namespace}}
name
:
{{
serviceName
}}
-{{namespace}}
namespace
:
{{
namespace
}}
spec
:
storageClassName
:
cbs
...
...
@@ -18,28 +18,28 @@ kind: Deployment
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
app
}}
name
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
replicas
:
1
revisionHistoryLimit
:
1
selector
:
matchLabels
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
strategy
:
type
:
Recreate
template
:
metadata
:
labels
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
spec
:
# hostname固定,容器重置后数据持久化才能正常
hostname
:
{{
app
}}
-{{namespace}}
hostname
:
{{
serviceName
}}
-{{namespace}}
containers
:
-
image
:
ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy
:
IfNotPresent
name
:
{{
app
}}
name
:
{{
serviceName
}}
resources
:
requests
:
memory
:
100Mi
...
...
@@ -54,13 +54,13 @@ spec:
value
:
qatest
# 数据持久化
volumeMounts
:
-
name
:
{{
app
}}
-
name
:
{{
serviceName
}}
mountPath
:
"
/var/lib/rabbitmq"
volumes
:
-
name
:
{{
app
}}
-
name
:
{{
serviceName
}}
persistentVolumeClaim
:
claimName
:
{{
app
}}
-{{namespace}}
claimName
:
{{
serviceName
}}
-{{namespace}}
imagePullSecrets
:
-
name
:
qcloudregistrykey
-
name
:
tencenthubkey
...
...
@@ -74,8 +74,8 @@ kind: Service
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
app
}}
name
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
type
:
NodePort
...
...
@@ -89,4 +89,4 @@ spec:
port
:
15672
targetPort
:
15672
selector
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
yamls/redis.pvc.yaml
View file @
fbd45b87
kind
:
PersistentVolumeClaim
apiVersion
:
v1
metadata
:
name
:
{{
app
}}
-{{namespace}}
name
:
{{
serviceName
}}
-{{namespace}}
namespace
:
{{
namespace
}}
spec
:
storageClassName
:
cbs
...
...
@@ -18,26 +18,26 @@ kind: Deployment
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
app
}}
name
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
replicas
:
1
revisionHistoryLimit
:
1
selector
:
matchLabels
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
strategy
:
type
:
Recreate
template
:
metadata
:
labels
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
spec
:
containers
:
-
image
:
ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy
:
Always
name
:
{{
app
}}
name
:
{{
serviceName
}}
resources
:
requests
:
memory
:
40Mi
...
...
@@ -47,11 +47,11 @@ spec:
cpu
:
500m
volumeMounts
:
-
mountPath
:
"
/data"
name
:
{{
app
}}
name
:
{{
serviceName
}}
volumes
:
-
name
:
{{
app
}}
-
name
:
{{
serviceName
}}
persistentVolumeClaim
:
claimName
:
{{
app
}}
-{{namespace}}
claimName
:
{{
serviceName
}}
-{{namespace}}
imagePullSecrets
:
-
name
:
qcloudregistrykey
-
name
:
tencenthubkey
...
...
@@ -65,8 +65,8 @@ kind: Service
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
app
}}
name
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
type
:
NodePort
...
...
@@ -87,4 +87,4 @@ spec:
port
:
6383
targetPort
:
6383
selector
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
yamls/ui.node.yaml
0 → 100644
View file @
fbd45b87
apiVersion
:
apps/v1beta1
kind
:
Deployment
metadata
:
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
labels
:
type
:
{{
label
}}
qcloud-app
:
{{
serviceName
}}
spec
:
replicas
:
1
selector
:
matchLabels
:
qcloud-app
:
{{
serviceName
}}
strategy
:
type
:
Recreate
template
:
metadata
:
labels
:
qcloud-app
:
{{
serviceName
}}
spec
:
revisionHistoryLimit
:
1
containers
:
-
name
:
{{
serviceName
}}
image
:
ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy
:
Always
volumeMounts
:
env
:
-
name
:
NAMESPACE
value
:
{{
namespace
}}
-
name
:
DEBUG
value
:
{{
debug
}}
resources
:
requests
:
cpu
:
{{
resources.cpu.request
}}
m
memory
:
{{
resources.memory.request
}}
Mi
limits
:
cpu
:
{{
resources.cpu.limit
}}
m
memory
:
{{
resources.memory.limit
}}
Mi
restartPolicy
:
Always
dnsPolicy
:
ClusterFirst
imagePullSecrets
:
-
name
:
qcloudregistrykey
-
name
:
tencenthubkey
---
apiVersion
:
v1
kind
:
Service
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
type
:
NodePort
ports
:
-
name
:
http
port
:
80
targetPort
:
80
selector
:
qcloud-app
:
{{
serviceName
}}
yamls/ui.yaml
deleted
100644 → 0
View file @
1c73cc60
apiVersion
:
extensions/v1beta1
kind
:
Deployment
metadata
:
name
:
{{
app
}}
namespace
:
{{
namespace
}}
labels
:
qcloud-app
:
{{
app
}}
spec
:
replicas
:
1
selector
:
matchLabels
:
qcloud-app
:
{{
app
}}
strategy
:
type
:
Recreate
template
:
metadata
:
labels
:
qcloud-app
:
{{
app
}}
spec
:
revisionHistoryLimit
:
2
containers
:
-
image
:
ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy
:
Always
name
:
{{
app
}}
resources
:
requests
:
memory
:
64Mi
limits
:
memory
:
256Mi
securityContext
:
privileged
:
false
terminationMessagePath
:
/dev/termination-log
-
name
:
NAMESPACE
valueFrom
:
fieldRef
:
fieldPath
:
metadata.namespace
ports
:
-
containerPort
:
80
restartPolicy
:
Always
dnsPolicy
:
ClusterFirst
volumes
:
-
name
:
logs-vol
emptyDir
:
{}
yamls/zookeeper.pvc.yaml
View file @
fbd45b87
kind
:
PersistentVolumeClaim
apiVersion
:
v1
metadata
:
name
:
{{
app
}}
-{{namespace}}
name
:
{{
serviceName
}}
-{{namespace}}
namespace
:
{{
namespace
}}
spec
:
storageClassName
:
cbs
...
...
@@ -18,26 +18,26 @@ kind: Deployment
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
app
}}
name
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
replicas
:
1
revisionHistoryLimit
:
1
selector
:
matchLabels
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
strategy
:
type
:
Recreate
template
:
metadata
:
labels
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
spec
:
containers
:
-
image
:
ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy
:
Always
name
:
{{
app
}}
name
:
{{
serviceName
}}
resources
:
requests
:
memory
:
100Mi
...
...
@@ -47,16 +47,16 @@ spec:
cpu
:
500m
volumeMounts
:
-
mountPath
:
"
/var/lib/zookeeper"
name
:
{{
app
}}
name
:
{{
serviceName
}}
env
:
-
name
:
ZOO_USER
value
:
zookeeper
# - name: ZOO_PORT
# value: 2181
volumes
:
-
name
:
{{
app
}}
-
name
:
{{
serviceName
}}
persistentVolumeClaim
:
claimName
:
{{
app
}}
-{{namespace}}
claimName
:
{{
serviceName
}}
-{{namespace}}
imagePullSecrets
:
-
name
:
qcloudregistrykey
-
name
:
tencenthubkey
...
...
@@ -71,8 +71,8 @@ kind: Service
metadata
:
labels
:
type
:
base
qcloud-app
:
{{
app
}}
name
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
name
:
{{
serviceName
}}
namespace
:
{{
namespace
}}
spec
:
type
:
NodePort
...
...
@@ -84,4 +84,4 @@ spec:
port
:
9090
targetPort
:
9090
selector
:
qcloud-app
:
{{
app
}}
qcloud-app
:
{{
serviceName
}}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment