commit d97eddf8d8f7d38cea1b2cce844891f3f27f8b55 Author: liukun <718526027@163.com> Date: Wed Jun 26 20:03:45 2024 +0800 doris 的deploy diff --git a/doris/be-deploy.yaml b/doris/be-deploy.yaml new file mode 100644 index 0000000..d56da2a --- /dev/null +++ b/doris/be-deploy.yaml @@ -0,0 +1,285 @@ +apiVersion: v1 +kind: Service +metadata: + name: doriscluster-helm-be-service + namespace: doris +spec: + clusterIP: 10.1.30.236 + clusterIPs: + - 10.1.30.236 + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - name: be-port + port: 9060 + protocol: TCP + targetPort: 9060 + - name: webserver-port + port: 8040 + protocol: TCP + targetPort: 8040 + - name: heartbeat-port + port: 9050 + protocol: TCP + targetPort: 9050 + - name: brpc-port + port: 8060 + protocol: TCP + targetPort: 8060 + selector: + app.doris.ownerreference/name: doriscluster-helm-be + app.kubernetes.io/component: be + sessionAffinity: ClientIP + sessionAffinityConfig: + clientIP: + timeoutSeconds: 10800 + type: ClusterIP + +--- +apiVersion: v1 +kind: Service +metadata: + name: doriscluster-helm-be-internal + namespace: doris +spec: + clusterIP: None + clusterIPs: + - None + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - name: heartbeat-port + port: 9050 + protocol: TCP + targetPort: 9050 + publishNotReadyAddresses: true + selector: + app.doris.ownerreference/name: doriscluster-helm-be + app.kubernetes.io/component: be + sessionAffinity: None + type: ClusterIP + +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: doriscluster-helm-be + namespace: doris +spec: + podManagementPolicy: Parallel + replicas: 2 + revisionHistoryLimit: 5 + selector: + matchLabels: + app.doris.ownerreference/name: doriscluster-helm-be + app.kubernetes.io/component: be + serviceName: doriscluster-helm-be-internal + template: + metadata: + creationTimestamp: null + labels: + app.doris.cluster: doriscluster-helm + app.doris.ownerreference/name: doriscluster-helm-be + app.kubernetes.io/component: be + name: doriscluster-helm-be + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/component + operator: In + values: + - be + topologyKey: kubernetes.io/hostname + weight: 20 + - podAffinityTerm: + labelSelector: + matchLabels: + kubernetes.io/hostname: fe + topologyKey: kubernetes.io/hostname + weight: 80 + containers: + - args: + - sysctl -w vm.max_map_count=2000000; swapoff -a;/opt/apache-doris/be_entrypoint.sh + $(ENV_FE_ADDR); + command: + - /bin/sh + - -c + - -- + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: HOST_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.hostIP + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: CONFIGMAP_MOUNT_PATH + value: /etc/doris + - name: USER + value: root + - name: PASSWD + value: iEEmoo168! + - name: DORIS_ROOT + value: /opt/apache-doris + - name: ENV_FE_ADDR + value: doriscluster-helm-fe-service + - name: FE_QUERY_PORT + value: "9030" + image: selectdb/doris.be-ubuntu:2.0.3 + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - /opt/apache-doris/be_prestop.sh + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 80 + periodSeconds: 5 + successThreshold: 1 + tcpSocket: + port: 9050 + timeoutSeconds: 180 + name: be + ports: + - containerPort: 9060 + name: be-port + protocol: TCP + - containerPort: 8040 + name: webserver-port + protocol: TCP + - containerPort: 9050 + name: heartbeat-port + protocol: TCP + - containerPort: 8060 + name: brpc-port + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /api/health + port: 8040 + scheme: HTTP + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 1 + resources: + limits: + cpu: "4" + memory: 4Gi + requests: + cpu: "2" + memory: 4Gi + securityContext: + privileged: true + startupProbe: + failureThreshold: 60 + periodSeconds: 5 + successThreshold: 1 + tcpSocket: + port: 9050 + timeoutSeconds: 1 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /etc/podinfo + name: podinfo + - mountPath: /opt/apache-doris/be/storage + name: be-storage + - mountPath: /opt/apache-doris/be/log + name: be-log + dnsPolicy: ClusterFirst + initContainers: + - args: + - -c + - sysctl -w vm.max_map_count=2000000 && swapoff -a + command: + - /bin/sh + image: selectdb/alpine:latest + imagePullPolicy: IfNotPresent + name: default-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - name: be-storage + persistentVolumeClaim: + claimName: be-storage + - name: be-log + persistentVolumeClaim: + claimName: be-log + - downwardAPI: + defaultMode: 420 + items: + - fieldRef: + apiVersion: v1 + fieldPath: metadata.labels + path: labels + - fieldRef: + apiVersion: v1 + fieldPath: metadata.annotations + path: annotations + name: podinfo + updateStrategy: + rollingUpdate: + partition: 0 + type: RollingUpdate + volumeClaimTemplates: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + name: be-storage + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 50Gi + storageClassName: cfs + volumeMode: Filesystem + status: + phase: Pending + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + name: be-log + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: cfs + volumeMode: Filesystem + status: + phase: Pending + diff --git a/doris/fe-deploy.yaml b/doris/fe-deploy.yaml new file mode 100644 index 0000000..3756a28 --- /dev/null +++ b/doris/fe-deploy.yaml @@ -0,0 +1,259 @@ +apiVersion: v1 +kind: Service +metadata: + name: doriscluster-helm-fe-service + namespace: doris +spec: + clusterIP: 10.1.22.81 + clusterIPs: + - 10.1.22.81 + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - name: http-port + port: 8030 + protocol: TCP + targetPort: 8030 + - name: rpc-port + port: 9020 + protocol: TCP + targetPort: 9020 + - name: query-port + port: 9030 + protocol: TCP + targetPort: 9030 + - name: edit-log-port + port: 9010 + protocol: TCP + targetPort: 9010 + selector: + app.doris.ownerreference/name: doriscluster-helm-fe + app.kubernetes.io/component: fe + sessionAffinity: ClientIP + sessionAffinityConfig: + clientIP: + timeoutSeconds: 10800 + type: ClusterIP + +--- +apiVersion: v1 +kind: Service +metadata: + name: doriscluster-helm-fe-internal + namespace: doris +spec: + clusterIP: None + clusterIPs: + - None + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - name: query-port + port: 9030 + protocol: TCP + targetPort: 9030 + publishNotReadyAddresses: true + selector: + app.doris.ownerreference/name: doriscluster-helm-fe + app.kubernetes.io/component: fe + sessionAffinity: None + type: ClusterIP + +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: doriscluster-helm-fe + namespace: doris +spec: + podManagementPolicy: Parallel + replicas: 1 + revisionHistoryLimit: 5 + selector: + matchLabels: + app.doris.ownerreference/name: doriscluster-helm-fe + app.kubernetes.io/component: fe + serviceName: doriscluster-helm-fe-internal + template: + metadata: + creationTimestamp: null + labels: + app.doris.cluster: doriscluster-helm + app.doris.ownerreference/name: doriscluster-helm-fe + app.kubernetes.io/component: fe + name: doriscluster-helm-fe + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/component + operator: In + values: + - fe + topologyKey: kubernetes.io/hostname + weight: 20 + containers: + - args: + - $(ENV_FE_ADDR) + command: + - /opt/apache-doris/fe_entrypoint.sh + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: HOST_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.hostIP + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: CONFIGMAP_MOUNT_PATH + value: /etc/doris + - name: USER + value: root + - name: DORIS_ROOT + value: /opt/apache-doris + - name: ENV_FE_ADDR + value: doriscluster-helm-fe-service + - name: FE_QUERY_PORT + value: "9030" + - name: ELECT_NUMBER + value: "3" + image: selectdb/doris.fe-ubuntu:2.0.3 + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - /opt/apache-doris/fe_prestop.sh + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 80 + periodSeconds: 5 + successThreshold: 1 + tcpSocket: + port: 9030 + timeoutSeconds: 180 + name: fe + ports: + - containerPort: 8030 + name: http-port + protocol: TCP + - containerPort: 9020 + name: rpc-port + protocol: TCP + - containerPort: 9030 + name: query-port + protocol: TCP + - containerPort: 9010 + name: edit-log-port + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /api/health + port: 8030 + scheme: HTTP + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 1 + resources: + limits: + cpu: "4" + memory: 4Gi + requests: + cpu: "2" + memory: 4Gi + startupProbe: + failureThreshold: 60 + periodSeconds: 5 + successThreshold: 1 + tcpSocket: + port: 9030 + timeoutSeconds: 1 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /etc/podinfo + name: podinfo + - mountPath: /opt/apache-doris/fe/doris-meta + name: fe-meta + - mountPath: /opt/apache-doris/fe/log + name: fe-log + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - name: fe-meta + persistentVolumeClaim: + claimName: fe-meta + - name: fe-log + persistentVolumeClaim: + claimName: fe-log + - downwardAPI: + defaultMode: 420 + items: + - fieldRef: + apiVersion: v1 + fieldPath: metadata.labels + path: labels + - fieldRef: + apiVersion: v1 + fieldPath: metadata.annotations + path: annotations + name: podinfo + updateStrategy: + rollingUpdate: + partition: 0 + type: RollingUpdate + volumeClaimTemplates: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + name: fe-meta + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 50Gi + storageClassName: cfs + volumeMode: Filesystem + status: + phase: Pending + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + name: fe-log + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: cfs + volumeMode: Filesystem + status: + phase: Pending