You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by al...@apache.org on 2020/07/17 18:35:58 UTC

[ignite] branch ignite-2.9 updated: IGNITE-13257 update kubernetes plain example (#8039)

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

alexpl pushed a commit to branch ignite-2.9
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-2.9 by this push:
     new 5bf4508  IGNITE-13257 update kubernetes plain example (#8039)
5bf4508 is described below

commit 5bf450858b719d79f88a9072b33023c60ca7a142
Author: Maksim Timonin <ti...@gmail.com>
AuthorDate: Fri Jul 17 18:52:18 2020 +0300

    IGNITE-13257 update kubernetes plain example (#8039)
    
    (cherry picked from commit c897985841e6bd5fc605dd0f4862559d23bf7c3b)
---
 modules/kubernetes/DEVNOTES.txt                    | 12 +++++++---
 modules/kubernetes/config/Dockerfile               | 10 ++++----
 modules/kubernetes/config/ignite-account-role.yaml | 23 ++++++++++++++++++
 modules/kubernetes/config/ignite-deployment.yaml   |  6 ++++-
 modules/kubernetes/config/ignite-role-binding.yaml | 27 ++++++++++++++++++++++
 .../kubernetes/config/ignite-service-account.yaml  | 19 +++++++++++++++
 6 files changed, 88 insertions(+), 9 deletions(-)

diff --git a/modules/kubernetes/DEVNOTES.txt b/modules/kubernetes/DEVNOTES.txt
index 2e3d84d..a7440e4 100644
--- a/modules/kubernetes/DEVNOTES.txt
+++ b/modules/kubernetes/DEVNOTES.txt
@@ -9,8 +9,7 @@ feed the image to your kubernetes environment.
 Building Apache Ignite
 =========================
 
-Use the command below to assemble an Apache Ignite binary:
-    mvn clean package -Prelease -Dignite.edition=apache-ignite-lgpl -DskipTests
+To assemble an Apache Ignite binary use instructions from DEVNOTES.txt file in the root of the repository.
 
 Note, if you alter the build instruction somehow make sure to update the files under 'config' folder if needed.
 
@@ -23,7 +22,7 @@ Once this is done, make sure that Minikube sees Docker images registered locally
     eval $(minikube docker-env)
 
 Start Minikube:
-    minikube start --vm-driver=xhyve
+    minikube start
 
 Assembling Apache Ignite Docker Image
 =====================================
@@ -40,6 +39,13 @@ Go to the folder and execute a command below to prepare the image:
 Creating containerized Ignite pods and Ignite lookup service
 ============================================================
 
+Create the Kuberenetes role that provides access to endpoints of pods to provide communication between Ignite nodes:
+    kubectl apply -f {path_to}/ignite-account-role.yaml
+
+Create the Kubernetes service account to bind the role:
+    kubectl apply -f {path_to}/ignite-service-account.yaml
+    kubectl apply -f {path_to}/ignite-role-binding.yaml
+
 Start the Kubernetes service that is used for IP addresses lookup. Use `ignite-kubernetes/config/ignite-service.yaml`:
 	kubectl create -f {path_to}/ignite-service.yaml
 
diff --git a/modules/kubernetes/config/Dockerfile b/modules/kubernetes/config/Dockerfile
index 634e181..13114b2 100644
--- a/modules/kubernetes/config/Dockerfile
+++ b/modules/kubernetes/config/Dockerfile
@@ -16,13 +16,13 @@
 #
 
 # Use Java 8 image as default one.
-FROM java:8
+FROM openjdk:8
 
 # Set Apache Ignite version.
 ENV IGNITE_VERSION 2.0.0-SNAPSHOT
 
 # Set IGNITE_HOME variable.
-ENV IGNITE_HOME /opt/ignite/apache-ignite-lgpl-${IGNITE_VERSION}-bin
+ENV IGNITE_HOME /opt/ignite/apache-ignite-${IGNITE_VERSION}-bin
 
 # Setting a path to an Apache Ignite configuration file. Used by run.sh script below.
 ENV CONFIG_URI ${IGNITE_HOME}/config/example-kube.xml
@@ -40,11 +40,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends unzip
 WORKDIR /opt/ignite
 
 # Copying local Apache Ignite build to the docker image.
-COPY ./apache-ignite-lgpl-${IGNITE_VERSION}-bin.zip apache-ignite-lgpl-${IGNITE_VERSION}-bin.zip
+COPY ./apache-ignite-${IGNITE_VERSION}-bin.zip apache-ignite-${IGNITE_VERSION}-bin.zip
 
 # Unpacking the build.
-RUN unzip apache-ignite-lgpl-${IGNITE_VERSION}-bin.zip
-RUN rm apache-ignite-lgpl-${IGNITE_VERSION}-bin.zip
+RUN unzip apache-ignite-${IGNITE_VERSION}-bin.zip
+RUN rm apache-ignite-${IGNITE_VERSION}-bin.zip
 
 # Copying the executable file and setting permissions.
 COPY ./run.sh $IGNITE_HOME/
diff --git a/modules/kubernetes/config/ignite-account-role.yaml b/modules/kubernetes/config/ignite-account-role.yaml
new file mode 100644
index 0000000..44e95e2
--- /dev/null
+++ b/modules/kubernetes/config/ignite-account-role.yaml
@@ -0,0 +1,23 @@
+# 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: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+  name: ignite
+rules:
+- apiGroups: [""]
+  resources: ["endpoints"]
+  verbs: ["get", "list", "watch"]
diff --git a/modules/kubernetes/config/ignite-deployment.yaml b/modules/kubernetes/config/ignite-deployment.yaml
index 5df9dda..6535e5b 100644
--- a/modules/kubernetes/config/ignite-deployment.yaml
+++ b/modules/kubernetes/config/ignite-deployment.yaml
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 # An example of a Kubernetes configuration for Ignite pods deployment.
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   # Custom Ignite cluster's name.
@@ -40,3 +40,7 @@ spec:
         - containerPort: 49112 # JMX port number.
         - containerPort: 8080  # REST port number.
         - containerPort: 10800 # SQL port number.
+      serviceAccountName: ignite
+  selector:
+    matchLabels:
+      app: ignite
diff --git a/modules/kubernetes/config/ignite-role-binding.yaml b/modules/kubernetes/config/ignite-role-binding.yaml
new file mode 100644
index 0000000..3420bbb
--- /dev/null
+++ b/modules/kubernetes/config/ignite-role-binding.yaml
@@ -0,0 +1,27 @@
+# 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.
+
+kind: RoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: ignite
+roleRef:
+  kind: Role
+  name: ignite
+  apiGroup: rbac.authorization.k8s.io
+subjects:
+- kind: ServiceAccount
+  name: ignite
+  namespace: default
diff --git a/modules/kubernetes/config/ignite-service-account.yaml b/modules/kubernetes/config/ignite-service-account.yaml
new file mode 100644
index 0000000..5339cf8
--- /dev/null
+++ b/modules/kubernetes/config/ignite-service-account.yaml
@@ -0,0 +1,19 @@
+# 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: ServiceAccount
+metadata:
+  name: ignite