From 4140cd3c9b5d5cee314db35ef8ccf5ac00b181bb Mon Sep 17 00:00:00 2001 From: suoych Date: Sat, 14 Dec 2019 18:40:20 +0800 Subject: [PATCH] 1214 PR Suo --- elastic-ctr-cli/elastic-control.sh | 2 +- elastic-ctr-cli/fileserver.yaml.template | 23 +++++++++++++++++++++- elastic-ctr-cli/fleet-ctr.yaml.template | 4 ++-- elastic-ctr-cli/rolebind.yaml | 25 ++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 elastic-ctr-cli/rolebind.yaml diff --git a/elastic-ctr-cli/elastic-control.sh b/elastic-ctr-cli/elastic-control.sh index f9ca504..4403832 100644 --- a/elastic-ctr-cli/elastic-control.sh +++ b/elastic-ctr-cli/elastic-control.sh @@ -402,7 +402,7 @@ PSERVER=2 DATA_PATH="/app" SLOT_CONF="./slot.conf" VERBOSE=0 -DATA_CONF_PATH="data.config" +DATA_CONF_PATH="./data.config" source $DATA_CONF_PATH # Parse arguments diff --git a/elastic-ctr-cli/fileserver.yaml.template b/elastic-ctr-cli/fileserver.yaml.template index 399068f..0fc3267 100755 --- a/elastic-ctr-cli/fileserver.yaml.template +++ b/elastic-ctr-cli/fileserver.yaml.template @@ -7,12 +7,32 @@ metadata: spec: containers: - name: file-server - image: hub.baidubce.com/ctr/file-server:hdfs7 + image: hub.baidubce.com/ctr/file-server:hdfs9 ports: - containerPort: 8080 command: ['bash'] args: ['run.sh'] env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: PADDLE_CURRENT_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP - name: JAVA_HOME value: /usr/local/jdk1.8.0_231 - name: HADOOP_HOME @@ -23,6 +43,7 @@ spec: value: "<$ HDFS_UGI $>" - name: PATH value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/jdk1.8.0_231/bin:/usr/local/hadoop-2.8.5/bin:/Python-3.7.0:/node-v12.13.1-linux-x64/bin + --- kind: Service apiVersion: v1 diff --git a/elastic-ctr-cli/fleet-ctr.yaml.template b/elastic-ctr-cli/fleet-ctr.yaml.template index 6e4a317..44c4ac3 100755 --- a/elastic-ctr-cli/fleet-ctr.yaml.template +++ b/elastic-ctr-cli/fleet-ctr.yaml.template @@ -21,7 +21,7 @@ spec: imagePullSecrets: - name: default-secret containers: - - image: hub.baidubce.com/ctr/fleet-ctr:89 + - image: hub.baidubce.com/ctr/fleet-ctr:90 command: - paddle_k8s - start_fluid @@ -113,7 +113,7 @@ spec: imagePullSecrets: - name: default-secret containers: - - image: hub.baidubce.com/ctr/fleet-ctr:89 + - image: hub.baidubce.com/ctr/fleet-ctr:90 command: - paddle_k8s - start_fluid diff --git a/elastic-ctr-cli/rolebind.yaml b/elastic-ctr-cli/rolebind.yaml new file mode 100644 index 0000000..d4f9c1c --- /dev/null +++ b/elastic-ctr-cli/rolebind.yaml @@ -0,0 +1,25 @@ +# replace suo with other namespace +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: suo + namespace: suo +rules: + - apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list", "watch"] + +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: suo + namespace: suo +subjects: + - kind: ServiceAccount + name: default + namespace: suo +roleRef: + kind: ClusterRole + name: suo + apiGroup: rbac.authorization.k8s.io -- GitLab