Skip to content

Commit

Permalink
build pay service cluter image
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Oct 16, 2023
1 parent b5ba4c1 commit 496c626
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
17 changes: 17 additions & 0 deletions service/pay/deploy/Kubefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM scratch
COPY registry registry
COPY manifests manifests

ENV DEFAULT_NAMESPACE sealos
ENV WECHAT_APPID
ENV WECHAT_MCHAPIV3KEY
ENV WECHAT_MCHID
ENV WECHAT_PRIVATE_KEY
ENV MONGODB_URI
ENV STRIPE_API_KEY
ENV STRIPE_CURRENCY
ENV STRIPE_SUCCESS_POSTFIX
ENV STRIPE_CANCEL_POSTFIX
ENV MCH_CERTIFICATE_SERIAL_NUMBER

CMD ["( kubectl create -f manifests/mongo-secret.yaml -n $DEFAULT_NAMESPACE || true ) && kubectl apply -f manifests/deploy.yaml"]
51 changes: 51 additions & 0 deletions service/pay/deploy/manifests/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pay-service
cloud.sealos.io/app-deploy-manager: pay-service
name: pay-service
namespace: sealos
spec:
progressDeadlineSeconds: 600
replicas: 3
revisionHistoryLimit: 1
selector:
matchLabels:
app: pay-service
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: pay-service
spec:
containers:
- envFrom:
- secretRef:
name: pay-secret
optional: true
image: ghcr.io/labring/sealos-pay-service:latest
imagePullPolicy: Always
name: pay-service
ports:
- containerPort: 2333
name: kxfckwudzwir
protocol: TCP
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 50m
memory: 25Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
16 changes: 16 additions & 0 deletions service/pay/deploy/manifests/pay-secret.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Secret
metadata:
name: pay-secret
namespace: {{ .DEFAULT_NAMESPACE }}
stringData:
AppID: {{ default "" .WECHAT_APPID }}
MchAPIv3Key: {{ default "" .WECHAT_MCHAPIV3KEY }}
MchCertificateSerialNumber: {{ default "" .MCH_CERTIFICATE_SERIAL_NUMBER }}
MchID: {{ default "" .WECHAT_MCHID }}
STRIPE_CANCEL_POSTFIX: {{ default "" .STRIPE_CANCEL_POSTFIX }}
STRIPE_SUCCESS_POSTFIX: {{ default "" .STRIPE_SUCCESS_POSTFIX }}
STRIPE_CURRENCY: {{ default "" .STRIPE_CURRENCY }}
STRIPE_API_KEY: {{ default "" .STRIPE_API_KEY }}
WechatPrivateKey: {{ default "" .WECHAT_PRIVATE_KEY }}
dburi: {{ default "" .MONGODB_URI }}

0 comments on commit 496c626

Please sign in to comment.