Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 63 additions & 2 deletions hack/kubernetes/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,68 @@ data:
runmode = prod
autorender = false
copyrequestbody = true
StaticDir = public:static
EnableDocs = true
EnableAdmin = true
# ... add your config
StaticDir = public:static
# Custom config
ShowSql = false
## if enable username and password login
EnableDBLogin = true
# token, generate jwt token
RsaPrivateKey = "./apikey/rsa-private.pem"
RsaPublicKey = "./apikey/rsa-public.pem"
# token end time. second
TokenLifeTime=86400

# kubernetes labels config
AppLabelKey= wayne-app
NamespaceLabelKey = wayne-ns
PodAnnotationControllerKindLabelKey = wayne.cloud/controller-kind

# database configuration:
## mysql
DBName = "wayne"
DBTns = "tcp(127.0.0.1:3306)"
DBUser = "root"
DBPasswd = "root"
DBLoc = "Asia%2FShanghai"
DBConnTTL = 30

# web shell auth
appKey = "860af247a91a19b2368d6425797921c6"

# Set demo namespace and group id
DemoGroupId = "1"
DemoNamespaceId = "1"

# Sentry
LogLevel = "4"
SentryEnable = false
SentryDSN = ""
SentryLogLevel = "4"

# Robin
EnableRobin = false

# api-keys
EnableApiKeys = true

# Bus
BusEnable = true
BusRabbitMQURL = "amqp://guest:guest@127.0.0.1:5672"

# other
# Use Canary/Production Update
# If set app metaData {"mode":"beta"},the app will auto redirect to BetaUrl
BetaUrl = "https://beta.wayne.cloud"
AppUrl = "https://www.wayne.cloud"

# oauth2
RedirectUrl = "https://www.wayne.cloud"

[auth.qihoo]
enabled = false
#ldap config
#enable ldap login
[auth.ldap]
enabled = false
129 changes: 113 additions & 16 deletions hack/kubernetes/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,129 @@ spec:
labels:
app: infra-wayne
spec:
volumes:
- name: config
configMap:
name: infra-wayne
containers:
- readinessProbe:
failureThreshold: 3
- name: wayne
image: '360cloud/wayne:latest'
command:
- /opt/wayne/backend
- apiserver
env:
- name: GOPATH # app.conf runmode = dev must set GOPATH
value: /go
resources:
limits:
cpu: '0.5'
memory: 1Gi
requests:
cpu: '0.5'
memory: 1Gi
volumeMounts:
- name: config
mountPath: /opt/wayne/conf/
readinessProbe:
httpGet:
path: healthz
port: 8080
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
periodSeconds: 10
failureThreshold: 3
imagePullPolicy: Always
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: infra-wayne-woker
namespace: default
labels:
app: infra-wayne-woker
spec:
replicas: 1
selector:
matchLabels:
app: infra-wayne-woker
template:
metadata:
labels:
app: infra-wayne-woker
spec:
volumes:
- name: config
configMap:
name: infra-wayne
containers:
- name: wayne
image: '360cloud/wayne:latest'
command:
- /opt/wayne/backend
- apiserver
image: 360cloud/wayne:latest
name: wayne
- /opt/wayne/backend
args:
- worker
- '-t'
- AuditWorker
- '-c'
- '1'
env:
- name: GOPATH
value: /go
resources:
limits:
cpu: "2"
memory: 4Gi
cpu: '0.5'
memory: 0.5Gi
requests:
cpu: "1"
memory: 2Gi
cpu: '0.5'
memory: 0.5Gi
volumeMounts:
- mountPath: /opt/wayne/conf/
name: config
- name: config
mountPath: /opt/wayne/conf/
imagePullPolicy: Always
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: infra-wayne-webhook
namespace: default
labels:
app: infra-wayne-webhook
spec:
replicas: 1
selector:
matchLabels:
app: infra-wayne-webhook
template:
metadata:
labels:
app: infra-wayne-webhook
spec:
volumes:
- name: config
configMap:
name: infra-wayne
name: infra-wayne
containers:
- name: wayne
image: '360cloud/wayne:latest'
command:
- /opt/wayne/backend
args:
- worker
- '-t'
- WebhookWorker
- '-c'
- '1'
env:
- value: /go
name: GOPATH
resources:
limits:
cpu: '0.5'
memory: 0.5Gi
requests:
cpu: '0.5'
memory: 0.5Gi
volumeMounts:
- name: config
mountPath: /opt/wayne/conf/
imagePullPolicy: Always

34 changes: 17 additions & 17 deletions src/backend/conf/app.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
appname = wayne
httpport = 8080
runmode = dev
runmode = prod
autorender = false
copyrequestbody = true
EnableDocs = true
Expand All @@ -23,25 +23,25 @@ PodAnnotationControllerKindLabelKey = wayne.cloud/controller-kind

# database configuration:
## mysql
DBName = "${DB_NAME||wayne}"
DBTns = "${DB_TNS||tcp(127.0.0.1:3306)}"
DBUser = "${DB_USER||root}"
DBPasswd = "${DB_PASSWD||root}"
DBLoc = "${DB_LOC||Asia%2FShanghai}"
DBName = "wayne"
DBTns = "tcp(127.0.0.1:3306)"
DBUser = "root"
DBPasswd = "root"
DBLoc = "Asia%2FShanghai"
DBConnTTL = 30

# web shell auth
appKey = "860af247a91a19b2368d6425797921c6"

# Set demo namespace and group id
DemoGroupId = "${DEMO_GROUP_ID||1}"
DemoNamespaceId = "${DEMO_NAMESPACE_ID||1}"
DemoGroupId = "1"
DemoNamespaceId = "1"

# Sentry
LogLevel = "${LOG_LEVEL||4}"
LogLevel = "4"
SentryEnable = false
SentryDSN = "${SENTRY_DSN}"
SentryLogLevel = "${SENTRY_LOGLEVEL||4}"
SentryDSN = ""
SentryLogLevel = "4"

# Robin
EnableRobin = false
Expand All @@ -51,16 +51,16 @@ EnableApiKeys = true

# Bus
BusEnable = false
BusRabbitMQURL = "${MQ_URL||amqp://guest:guest@rabbitmq:5672}"
BusRabbitMQURL = "amqp://guest:guest@127.0.0.1:5672"

# other
# 采用Canary/Production上线模式
# 如果项目配置了metaData {"mode":"beta"},则跳转到beta域名
BetaUrl = "${BETA_URL||https://beta.wayne.cloud}"
AppUrl = "${APP_URL||https://www.wayne.cloud}"
# Use Canary/Production Update
# If set app metaData {"mode":"beta"},the app will auto redirect to BetaUrl
BetaUrl = "https://beta.wayne.cloud"
AppUrl = "https://www.wayne.cloud"

# oauth2
RedirectUrl = "${REDIRECT_URL||https://www.wayne.cloud}"
RedirectUrl = "https://www.wayne.cloud"

[auth.qihoo]
enabled = false
Expand Down