瀏覽代碼

1

adv_callback
dengbiao 2 週之前
父節點
當前提交
13402a9853
共有 6 個文件被更改,包括 144 次插入15 次删除
  1. +6
    -6
      Dockerfile-prd
  2. +10
    -9
      k8s/ingress_prd_ddxqapi.ddstaros.com.yaml
  3. +65
    -0
      k8s/ingress_prd_ddxqcjffapi.ddstaros.com.yaml
  4. +21
    -0
      k8s/ingress_prd_ddxqffapi.ddstaros.com.yaml
  5. +21
    -0
      k8s/ingress_prd_ddxqlhffapi.ddstaros.com.yaml
  6. +21
    -0
      k8s/ingress_prd_ddxqyhffapi.ddstaros.com.yaml

+ 6
- 6
Dockerfile-prd 查看文件

@@ -12,8 +12,8 @@ WORKDIR /go/release
# 把全部文件添加到/go/release目录
ADD . .

# 编译:把main.go编译成可执行的二进制文件,命名为zyos
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo -ldflags="-s -w" -installsuffix cgo -o zyos main.go
# 编译:把main.go编译成可执行的二进制文件,命名为egg
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo -ldflags="-s -w" -installsuffix cgo -o egg main.go

FROM ubuntu:xenial as prod
LABEL maintainer="dengbiao"
@@ -25,12 +25,12 @@ RUN rm -f /etc/localtime \
&& ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
# 在build阶段复制可执行的go二进制文件app
COPY --from=build /go/release/zyos ./zyos
COPY --from=build /go/release/egg ./egg

COPY --from=build /go/release/etc/cfg.yml /var/zyos/cfg.yml
COPY --from=build /go/release/etc/cfg.yml /var/egg/cfg.yml

# 启动服务
# CMD ["./zyos","-c","/var/zyos/cfg.yml"]
CMD ["bash","-c","sysctl -w net.ipv4.tcp_tw_reuse=1 && sysctl -w net.ipv4.tcp_fin_timeout=10 && sysctl -w net.ipv4.ip_local_port_range='1024 65535' && sysctl -p && ./zyos -c /var/zyos/cfg.yml"]
# CMD ["./egg","-c","/var/egg/cfg.yml"]
CMD ["bash","-c","sysctl -w net.ipv4.tcp_tw_reuse=1 && sysctl -w net.ipv4.tcp_fin_timeout=10 && sysctl -w net.ipv4.ip_local_port_range='1024 65535' && sysctl -p && ./egg -c /var/egg/cfg.yml"]



k8s/ingress_prd.yaml → k8s/ingress_prd_ddxqapi.ddstaros.com.yaml 查看文件

@@ -1,20 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: egg-app-ddxqapi.ddstaros.com
namespace: egg
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubesphere.io/creator: dengbiao
name: advertisement
namespace: advertisement
kubesphere.io/creator: admin
spec:
ingressClassName: nginx
rules:
- host: '*.adcms.zhiyingos.cn'
- host: ddxqapi.ddstaros.com
http:
paths:
- backend:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: advertisement
name: egg-app
port:
number: 80
path: /
pathType: ImplementationSpecific

+ 65
- 0
k8s/ingress_prd_ddxqcjffapi.ddstaros.com.yaml 查看文件

@@ -0,0 +1,65 @@
# 当前域名
debug: true
curldebug: true
prd: true
local: false
# 服务器参数
srv_addr: ':4011'
# 缓存
redis_addr: 'r-bp1ds703d4evh588uf.redis.rds.aliyuncs.com:6379'
redis_password: ''

db:
host: 'pc-bp1r00x3256zw9b35.rwlb.rds.aliyuncs.com:3306'
name: 'egg'
user: 'zhios'
psw: 'ZHIoscnfnuo123@'
show_log: true
max_lifetime: 30
max_open_conns: 100
max_idle_conns: 100
path: 'tmp/%s.log'

im_db:
host: 'pc-bp1r00x3256zw9b35.rwlb.rds.aliyuncs.com:3306'
name: 'egg-im'
user: 'zhios'
psw: 'ZHIoscnfnuo123@'
show_log: true
max_lifetime: 30
max_open_conns: 100
max_idle_conns: 100
path: 'tmp/%s.log'

# 日志
log:
app_name: 'applet'
level: 'debug' # 普通日志级别 #debug, info, warn, fatal, panic
is_stdout: true
time_format: 'standard' # sec, second, milli, nano, standard, iso
encoding: 'console'
is_file_out: true
file_dir: './tmp/'
file_max_size: 256
file_max_age: 1
file_name: 'debug.log'

# 连接RabbitMq
mq:
host: '116.62.62.35'
port: '5672'
user: 'zhios'
pwd: 'ZHIoscnfnuo123'

es:
url: 'http://120.55.48.175:9200'
user: 'elastic'
pwd: 'fnuo123'

im_business_rpc:
url: im-rpc-business.izhim.com
port: 1005

im_logic_rpc:
url: im-rpc-logic.izhim.com
port: 1008

+ 21
- 0
k8s/ingress_prd_ddxqffapi.ddstaros.com.yaml 查看文件

@@ -0,0 +1,21 @@
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: egg-app-ddxqffapi.ddstaros.com
namespace: egg
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubesphere.io/creator: admin
spec:
ingressClassName: nginx
rules:
- host: ddxqffapi.ddstaros.com
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: egg-app
port:
number: 80

+ 21
- 0
k8s/ingress_prd_ddxqlhffapi.ddstaros.com.yaml 查看文件

@@ -0,0 +1,21 @@
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: egg-app-ddxqlhffapi.ddstaros.com
namespace: egg
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubesphere.io/creator: admin
spec:
ingressClassName: nginx
rules:
- host: ddxqlhffapi.ddstaros.com
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: egg-app
port:
number: 80

+ 21
- 0
k8s/ingress_prd_ddxqyhffapi.ddstaros.com.yaml 查看文件

@@ -0,0 +1,21 @@
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: egg-app-ddxqyhffapi.ddstaros.com
namespace: egg
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubesphere.io/creator: admin
spec:
ingressClassName: nginx
rules:
- host: ddxqyhffapi.ddstaros.com
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: egg-app
port:
number: 80

Loading…
取消
儲存