This is an automated email from the ASF dual-hosted git repository.

liuxun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 77d06de  SUBMARINE-363. Add Submarine operator & server test yaml
77d06de is described below

commit 77d06def98d5c9118992a467f37959cd7e0e344e
Author: Xun Liu <[email protected]>
AuthorDate: Mon Jan 27 17:15:23 2020 +0800

    SUBMARINE-363. Add Submarine operator & server test yaml
    
    ### What is this PR for?
    Provide test yaml for the server of the submarine operator,
    Convenient to run Submarine operator and submarine server for testing.
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/SUBMARINE-363
    
    ### How should this be tested?
    * https://travis-ci.org/liuxunorg/submarine/builds/642285134
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Xun Liu <[email protected]>
    
    Closes #166 from liuxunorg/SUBMARINE-363 and squashes the following commits:
    
    66978be [Xun Liu] SUBMARINE-363. Add Submarine operator & server test yaml
---
 .../manifests/submarine-cluster/deployment.yaml    | 87 ++++++++++++++++++++++
 .../manifests/submarine-cluster/rbac.yaml          | 43 +++++++++++
 .../submarine-cluster/serviceaccounts.yaml         | 25 +++++++
 .../manifests/submarine-operator/deployment.yaml   | 43 +++++++++++
 .../manifests/submarine-operator/rbac.yaml         | 58 +++++++++++++++
 .../submarine-operator/serviceaccounts.yaml        | 25 +++++++
 6 files changed, 281 insertions(+)

diff --git a/submarine-cloud/manifests/submarine-cluster/deployment.yaml 
b/submarine-cloud/manifests/submarine-cluster/deployment.yaml
new file mode 100644
index 0000000..a8dca24
--- /dev/null
+++ b/submarine-cloud/manifests/submarine-cluster/deployment.yaml
@@ -0,0 +1,87 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: submarine.apache.org/v1alpha1
+kind: SubmarineCluster
+metadata:
+  name: submarine-test
+spec:
+  additionalLabels:
+    foo: bar
+  numberOfMaster: 1
+  replicationFactor: 0
+  podTemplate:
+    metadata:
+      labels:
+        app: cluster-test
+    spec:
+      ServiceAccountName: "submarine-node"
+      volumes:
+        - name: data
+          emptyDir: {}
+      containers:
+        - name: submarine-node
+          image: "apache/submarine:server-0.3.0-SNAPSHOT"
+          args: []
+          imagePullPolicy: IfNotPresent
+          ports:
+            - containerPort: 8080
+              name:  submarine
+            - containerPort: 8081
+              name: cluster
+          env:
+            - name: POD_NAMESPACE
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.namespace
+            - name: POD_IP
+              valueFrom:
+                fieldRef:
+                  fieldPath: status.podIP
+          livenessProbe:
+            httpGet:
+              path: /api/v1/cluster/address
+              port: 8080
+            initialDelaySeconds: 10
+            timeoutSeconds: 5
+            periodSeconds: 10
+            successThreshold: 1
+            failureThreshold: 30
+          readinessProbe:
+            httpGet:
+              path: /api/v1/cluster/address
+              port: 8080
+            timeoutSeconds: 5
+            periodSeconds: 10
+            successThreshold: 1
+            failureThreshold: 3
+
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: submarine-svc
+spec:
+  ports:
+    - name: submarine-test-svc
+      port: 8080
+      targetPort: 8080
+      nodePort: 30001
+  selector:
+    app: submarine-test
+  type: NodePort
+
+# kubectl port-forward svc/submarine-svc 8080:8080 --address 0.0.0.0
diff --git a/submarine-cloud/manifests/submarine-cluster/rbac.yaml 
b/submarine-cloud/manifests/submarine-cluster/rbac.yaml
new file mode 100644
index 0000000..eab1fa6
--- /dev/null
+++ b/submarine-cloud/manifests/submarine-cluster/rbac.yaml
@@ -0,0 +1,43 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v1
+kind: List
+items:
+  - apiVersion: rbac.authorization.k8s.io/v1beta1
+    kind: ClusterRole
+    metadata:
+      name: submarine-node
+    rules:
+      - apiGroups: [""]
+        resources:
+          - namespaces
+          - services
+          - endpoints
+          - pods
+        verbs: ["list", "get"]
+  - apiVersion: rbac.authorization.k8s.io/v1beta1
+    kind: ClusterRoleBinding
+    metadata:
+      name: submarine-node
+    roleRef:
+      apiGroup: rbac.authorization.k8s.io
+      kind: ClusterRole
+      name: submarine-node
+    subjects:
+      - kind: ServiceAccount
+        name: submarine-node
+        namespace: default
diff --git a/submarine-cloud/manifests/submarine-cluster/serviceaccounts.yaml 
b/submarine-cloud/manifests/submarine-cluster/serviceaccounts.yaml
new file mode 100644
index 0000000..45212bb
--- /dev/null
+++ b/submarine-cloud/manifests/submarine-cluster/serviceaccounts.yaml
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v1
+kind: List
+items:
+  # The SA for the submarine operator
+  - apiVersion: v1
+    kind: ServiceAccount
+    metadata:
+      name: "submarine-node"
+      namespace: default
diff --git a/submarine-cloud/manifests/submarine-operator/deployment.yaml 
b/submarine-cloud/manifests/submarine-operator/deployment.yaml
new file mode 100644
index 0000000..38d3bd0
--- /dev/null
+++ b/submarine-cloud/manifests/submarine-operator/deployment.yaml
@@ -0,0 +1,43 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+  name: submarine-operator
+  namespace: default
+spec:
+  replicas: 1
+  strategy:
+    type: Recreate
+  template:
+    metadata:
+      labels:
+        app: "submarine-operator"
+    spec:
+      serviceAccountName: "submarine-operator"
+      containers:
+        - name: op
+          image: "apache/submarine:operator-0.3.0-SNAPSHOT"
+          imagePullPolicy: IfNotPresent
+          args: ["--v=7", "--logtostderr=true", "--alsologtostderr"]
+          resources:
+            limits:
+              cpu: 100m
+              memory: 128Mi
+            requests:
+              cpu: 100m
+              memory: 128Mi
diff --git a/submarine-cloud/manifests/submarine-operator/rbac.yaml 
b/submarine-cloud/manifests/submarine-operator/rbac.yaml
new file mode 100644
index 0000000..88eec70
--- /dev/null
+++ b/submarine-cloud/manifests/submarine-operator/rbac.yaml
@@ -0,0 +1,58 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v1
+kind: List
+items:
+  - apiVersion: rbac.authorization.k8s.io/v1beta1
+    kind: ClusterRole
+    metadata:
+      name: submarine-operator
+    rules:
+      - apiGroups: ["apiextensions.k8s.io"]
+        resources:
+          - customresourcedefinitions
+        verbs: ["*"]
+      - apiGroups:
+          - "submarine.apache.org"
+        resources:
+          - submarineclusters
+        verbs: ["*"]
+      - apiGroups: [""]
+        resources:
+          - pods
+          - services
+        verbs: ["*"]
+      - apiGroups: [""]
+        resources:
+          - namespaces
+        verbs: ["list"]
+      - apiGroups: ["policy"]
+        resources:
+          - poddisruptionbudgets
+        verbs: ["*"]
+  - apiVersion: rbac.authorization.k8s.io/v1beta1
+    kind: ClusterRoleBinding
+    metadata:
+      name: submarine-operator
+    roleRef:
+      apiGroup: rbac.authorization.k8s.io
+      kind: ClusterRole
+      name: submarine-operator
+    subjects:
+      - kind: ServiceAccount
+        name: "submarine-operator"
+        namespace: default
diff --git a/submarine-cloud/manifests/submarine-operator/serviceaccounts.yaml 
b/submarine-cloud/manifests/submarine-operator/serviceaccounts.yaml
new file mode 100644
index 0000000..3011f7f
--- /dev/null
+++ b/submarine-cloud/manifests/submarine-operator/serviceaccounts.yaml
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v1
+kind: List
+items:
+  # The SA for the submarine operator
+  - apiVersion: v1
+    kind: ServiceAccount
+    metadata:
+      name: "submarine-operator"
+      namespace: default


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to