apiVersion: v1 kind: Template metadata: name: easy-mock objects: - apiVersion: v1 kind: ServiceAccount metadata: name: easymock - apiVersion: v1 kind: DeploymentConfig metadata: labels: app: easy-mock name: easy-mock spec: replicas: 1 selector: app: easy-mock deploymentconfig: easy-mock template: metadata: labels: app: easy-mock deploymentconfig: easy-mock spec: containers: - image: blackcater/easy-mock:1.6.0 imagePullPolicy: IfNotPresent name: easy-mock ports: - containerPort: 7300 protocol: TCP volumeMounts: - mountPath: /easy-mock/config name: easy-mock-t75hs readOnly: true dnsPolicy: ClusterFirst restartPolicy: Always volumes: - configMap: defaultMode: 420 name: easy-mock name: easy-mock-t75hs serviceAccount: easymock triggers: - type: ConfigChange - apiVersion: v1 kind: DeploymentConfig metadata: labels: app: easy-mock name: mongo spec: replicas: 1 selector: app: mongo deploymentconfig: mongo template: metadata: labels: app: mongo deploymentconfig: mongo spec: containers: - image: mongo:4.1 imagePullPolicy: IfNotPresent name: mongo ports: - containerPort: 27017 protocol: TCP resources: {} volumeMounts: - mountPath: /data/configdb name: mongo-1 - mountPath: /data/db name: mongo-2 serviceAccount: easymock dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 volumes: - emptyDir: {} name: mongo-1 - name: mongo-2 persistentVolumeClaim: claimName: mongodb test: false triggers: - type: ConfigChange - apiVersion: v1 kind: DeploymentConfig metadata: labels: app: easy-mock name: redis spec: replicas: 1 selector: app: redis deploymentconfig: redis template: metadata: labels: app: redis deploymentconfig: redis spec: containers: - image: docker.io/redis:5 imagePullPolicy: IfNotPresent name: redis ports: - containerPort: 6379 protocol: TCP volumeMounts: - mountPath: /data name: redis-volume-1 serviceAccount: easymock volumes: - emptyDir: {} name: redis-volume-1 triggers: - type: ConfigChange - apiVersion: v1 kind: Service metadata: labels: app: easy-mock name: easy-mock spec: ports: - name: 7300-tcp port: 7300 protocol: TCP targetPort: 7300 selector: deploymentconfig: easy-mock sessionAffinity: None type: ClusterIP - apiVersion: v1 kind: Service metadata: labels: app: easy-mock name: mongo spec: ports: - name: 27017-tcp port: 27017 protocol: TCP targetPort: 27017 selector: deploymentconfig: mongo sessionAffinity: None type: ClusterIP - apiVersion: v1 kind: Service metadata: labels: app: easy-mock name: redis spec: ports: - name: 6379-tcp port: 6379 protocol: TCP targetPort: 6379 selector: app: redis deploymentconfig: redis sessionAffinity: None type: ClusterIP - apiVersion: v1 kind: Route metadata: labels: app: easy-mock name: easy-mock spec: port: targetPort: 7300-tcp to: kind: Service name: easy-mock weight: 100 - apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mongodb spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi - apiVersion: v1 data: default.json: "{\r\n \"port\": 7300,\r\n \"host\": \"0.0.0.0\",\r\n \"pageSize\": 30,\r\n \"proxy\": false,\r\n \"db\": \"mongodb://mongo/easy-mock\",\r\n \ \"unsplashClientId\": \"\",\r\n \"redis\": {\r\n \"keyPrefix\": \"[Easy Mock]\",\r\n \"port\": 6379,\r\n \"host\": \"redis\",\r\n \"password\": \"\",\r\n \"db\": 0\r\n },\r\n \"blackList\": {\r\n \"projects\": [], // projectId,例:\"5a4495e16ef711102113e500\"\r\n \"ips\": [] // ip,例:\"127.0.0.1\"\r\n \ },\r\n \"rateLimit\": { // https://github.com/koajs/ratelimit\r\n \"max\": 1000,\r\n \"duration\": 1000\r\n },\r\n \"jwt\": {\r\n \"expire\": \"14 days\",\r\n \"secret\": \"shared-secret\"\r\n },\r\n \"upload\": {\r\n \"types\": [\".jpg\", \".jpeg\", \".png\", \".gif\", \".json\", \".yml\", \".yaml\"],\r\n \ \"size\": 5242880,\r\n \"dir\": \"../public/upload\",\r\n \"expire\": {\r\n \"types\": [\".json\", \".yml\", \".yaml\"],\r\n \"day\": -1\r\n \ }\r\n },\r\n \"ldap\": {\r\n \"server\": \"\", // 设置 server 代表启用 LDAP 登录。例:\"ldap://localhost:389\" 或 \"ldaps://localhost:389\"(使用 SSL)\r\n \"bindDN\": \"\", // 用户名,例:\"cn=admin,dc=example,dc=com\"\r\n \"password\": \"\",\r\n \"filter\": {\r\n \"base\": \"\", // 查询用户的路径,例:\"dc=example,dc=com\"\r\n \"attributeName\": \"\" // 查询字段,例:\"mail\"\r\n }\r\n },\r\n \"fe\": {\r\n \"copyright\": \"\",\r\n \"storageNamespace\": \"easy-mock_\",\r\n \"timeout\": 25000,\r\n \ \"publicPath\": \"/dist/\"\r\n }\r\n}" kind: ConfigMap metadata: name: easy-mock