1、拉取uniswap源码
github地址
2、编写Dockerfile并打镜像
# Set the base image
FROM node:18.10.0
# WORKDIR /usr/src/app/
WORKDIR /home/gateway
# Copy files
COPY ./ /home/gateway/
# Dockerfile author / maintainer
LABEL maintainer="Michael Feng <mike@hummingbot.org>"
# Build arguments
LABEL branch=${BRANCH}
LABEL commit=${COMMIT}
LABEL date=${BUILD_DATE}
# Set ENV variables
ENV COMMIT_BRANCH=${BRANCH}
ENV COMMIT_SHA=${COMMIT}
ENV BUILD_DATE=${DATE}
ENV INSTALLATION_TYPE=docker
# Create mount points
RUN mkdir -p /home/gateway/conf /home/gateway/logs /home/gateway/db /home/gateway/certs /home/gateway/conf/lists
COPY src/templates/lists/*.json /home/gateway/conf/lists/
COPY src/templates/*.yml /home/gateway/conf/
#COPY certs/*.pem /home/gateway/certs/
# Install dependencies and compile
RUN yarn install --frozen-lockfile
RUN yarn build
# Expose port 15888 - note that docs port is 8080
EXPOSE 15888
# Set the default command to run when starting the container
CMD yarn run start
3、创建pem证书文件(因为创建证书需要第三方工具,这边就给出一份创建好了的证书)
k8s创建configmap yaml文件如下
uniswap-gateway-key.yml
---
apiVersion: v1
data:
ca_cert.pem: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4VENDQWRtZ0F3SUJBZ0lVUk5jSm1FR3FGK095bGVaZ003TnNUcWhVUEprd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0tERVNNQkFHQTFVRUNnd0piRzlqWVd4b2IzTjBNUkl3RUFZRFZRUUREQWxzYjJOaGJHaHZjM1F3SGhjTgpNak13T1RBeE1USTBNekE1V2hjTk1qUXdPRE14TVRJME16QTVXakFvTVJJd0VBWURWUVFLREFsc2IyTmhiR2h2CmMzUXhFakFRQmdOVkJBTU1DV3h2WTJGc2FHOXpkRENDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0MKQVFvQ2dnRUJBS1g5T2poNkV0NkdwZmp6b2VjNEZKS2IwRDJ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JVkxMeWRNRWIKUXZCSUJpTWhGOFRxUnBIS01qTmxuMjVQdy9nODhnS1RHQjZ1czAxbzB6MUR4dkpvTjN6NTdXWlRtaEJ6aGhVMwpFcjQ2MThyRWU3V2VRNVdLZ1pmZTREMTFqTW8xZFJvSmxhODcxWHdkYmI2eS9pMWpQbzVjbXdRbDN3Vm5aT0JjCi9qWWN0QnE0eHg5cFBDWGhLV210eTgvdDRsQ2RIT0gwTUNURlJVYkpJaFl5d3UzbHZFQjFKcHBnM3pVVWlESTMKQ3Z4eHR1YWJ6QXZtaHNaZ1VFUGFRcHNKeHhhMmxUN3NnaGZUVDNjR095TmtqV2JKTFZYWXBLV0MrdDBMRTJDRAozYVZXVXFYUzB1MElaeUNrYVpIMktuWHROcW1KZzhqUFYvRkE4S3I2K3grcS9MRUpWZDM4eXg5VytKNXRzQlhSCnFCckc5YWFZaTgyRUtqNTY2andIVHpBTE01cDh1QzRMbjdPUFRmQmNlUDc1alM4dk9WcDdhek1QY25BVlNPcTIKUzcvcDlZVUg0em5LekkvRnllZFk3TXU3WWxvUEtXZXRDUzVUcFpMVXFaTlkzRFhOS1k4YXpIcm9XRTBoWnpzdQpjN1BIanVRMk5qdUREdDdacS9FeFVBdnN5MXQvOWFLK0VKcFFFcVhFdGZtQ0Q1UU02TFU0TEZ4d3Y3cE5QMDg1CkY5c3NqVlpraldmaGZ3OCs1dXNaSXF4Q2k2clBVcHd2WnVTcU8rd29PNDN5UzM0L043TDdUNHVDdHVzRTNFaVMKTjErTS9lQlhQSUpzU1R1RlpFdGZleXlOaEduVk15WlIvdTNyTmVud2hJTEcrUkxOakNQQ2JiSVVzaG8xejBQVgotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQ==
immutable: false
kind: Secret
metadata:
name: uniswap-gateway-key
namespace: biking
resourceVersion: '102621410'
type: Opaque
4、编写创建uniswap.yaml文件
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
k8s.kuboard.cn/displayName: uniswap-node
labels:
k8s.kuboard.cn/layer: gateway
k8s.kuboard.cn/name: uniswap-node
name: gateway-node
namespace: uniswap
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s.kuboard.cn/name: uniswap-node
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
k8s.kuboard.cn/name: uniswap-node
spec:
containers:
- command:
- yarn
- start
- '--passphrase=Welcome123'
env:
- name: TZ
value: Asia/Shanghai
- name: NACOS
value: X.X.X.X
image: 'registry-intl.cn-hongkong.aliyuncs.com/abc/uniswap-node:v1.0'
imagePullPolicy: Always
name: gateway-node
ports:
- containerPort: 15888
name: msag7
protocol: TCP
- containerPort: 8080
name: dfdg
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /home/gateway/logs
name: volume-miafx
subPath: gateway-node
- mountPath: /home/gateway/certs
name: volume-xw5yj
workingDir: /home/gateway
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: harbor-secret
- name: acr-secret
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: volume-miafx
persistentVolumeClaim:
claimName: uniswap-logs
- name: volume-xw5yj
secret:
defaultMode: 420
secretName: uniswap-gateway-key
---
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
k8s.kuboard.cn/layer: gateway
k8s.kuboard.cn/name: uniswap-node
name: uniswap-node
namespace: biking
resourceVersion: '90935018'
spec:
ports:
- name: kjmfca
port: 15888
protocol: TCP
targetPort: 15888
- name: zby2ps
port: 8080
protocol: TCP
targetPort: 8080
selector:
k8s.kuboard.cn/name: uniswap-node
sessionAffinity: None
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/cors-allow-headers: >-
DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
nginx.ingress.kubernetes.io/cors-allow-methods: 'GET, POST, PUT, DELETE, OPTIONS'
nginx.ingress.kubernetes.io/cors-allow-origin: '*'
nginx.ingress.kubernetes.io/cors-expose-headers: 'Content-Length,Content-Type'
nginx.ingress.kubernetes.io/enable-cors: 'true'
nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'
nginx.ingress.kubernetes.io/from-to-www-redirect: 'false'
labels:
k8s.kuboard.cn/layer: gateway
k8s.kuboard.cn/name: uniswap-node
name: gateway-node
namespace: biking
resourceVersion: '90938206'
spec:
ingressClassName: nginx
rules:
- host: uniswap-node.abc.com
http:
paths:
- backend:
service:
name: uniswap-node
port:
number: 15888
path: /
pathType: Prefix
tls:
- hosts:
- uniswap-node.abc.com
secretName: abc.com-ssl
5、启动好了uniswap时,我们在登录容器内部后通过curl进行测试
curl -s -X GET -k --key certs/server_key.pem --cert certs/server_cert.pem https://localhost:15888/
Enter PEM pass phrase: (Welcome123)
{"status":"ok"}