Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fabric8io/elasticsearch-cloud-kubernetes
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: elasticsearch-cloud-kubernetes-6.1.2
Choose a base ref
...
head repository: fabric8io/elasticsearch-cloud-kubernetes
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Mar 6, 2018

  1. Copy the full SHA
    867c876 View commit details

Commits on Apr 4, 2018

  1. Copy the full SHA
    3b37926 View commit details

Commits on Apr 16, 2018

  1. Copy the full SHA
    c0404ba View commit details
  2. Copy the full SHA
    fdf6761 View commit details
  3. Copy the full SHA
    a1a496b View commit details
  4. Copy the full SHA
    8c158dd View commit details
  5. fix up SNAPSHOT

    jcantrill committed Apr 16, 2018
    Copy the full SHA
    4d258f8 View commit details
  6. Copy the full SHA
    c93e1f1 View commit details
  7. Copy the full SHA
    98afe5b View commit details

Commits on Apr 19, 2018

  1. Copy the full SHA
    955f33c View commit details
  2. Copy the full SHA
    a2b97ab View commit details
  3. Copy the full SHA
    db202cb View commit details

Commits on Apr 30, 2018

  1. Copy the full SHA
    df1b447 View commit details
  2. Copy the full SHA
    7cbae42 View commit details
  3. Copy the full SHA
    705978d View commit details

Commits on May 2, 2018

  1. 6.2.1 (#135)

    jcantrill authored May 2, 2018
    Copy the full SHA
    526be9f View commit details
  2. Copy the full SHA
    fae75e2 View commit details
  3. Copy the full SHA
    81db7d5 View commit details
  4. Reset to 624 s (#136)

    * Revert "[maven-release-plugin] prepare for next development iteration"
    
    This reverts commit 81db7d5.
    
    * Revert "[maven-release-plugin] prepare release elasticsearch-cloud-kubernetes-6.2.1"
    
    This reverts commit fae75e2.
    
    * Revert "6.2.1 (#135)"
    
    This reverts commit 526be9f.
    jcantrill authored May 2, 2018
    Copy the full SHA
    9414a3a View commit details
  5. fix url in pom (#137)

    jcantrill authored May 2, 2018
    Copy the full SHA
    d6cc910 View commit details

Commits on May 11, 2018

  1. Update Readme (#139)

    The maven package in the "Installation" line is non existent. Altered to point to the latest extant version in the maven repo.
    papile authored and jcantrill committed May 11, 2018
    Copy the full SHA
    ca341b8 View commit details

Commits on Jun 1, 2018

  1. Copy the full SHA
    c8034bd View commit details

Commits on Sep 18, 2018

  1. Update README.md

    jcantrill authored Sep 18, 2018
    Copy the full SHA
    24eb605 View commit details
57 changes: 45 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,47 @@
This plugin is no longer under active development and can be replaced by utilizing a headless service as noted below
======

Kubernetes Cloud Plugin for Elasticsearch:
=========================================

[![Build Status](https://travis-ci.org/fabric8io/elasticsearch-cloud-kubernetes.svg?branch=master)](https://travis-ci.org/fabric8io/elasticsearch-cloud-kubernetes)

The Kubernetes Cloud plugin allows to use Kubernetes API for the unicast discovery mechanism.
Alternatively, you can utilize [headless services](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services):

apiVersion: v1
kind: Service
metadata:
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
name: elasticsearch-cluster
spec:
clusterIP: None
ports:
- port: 9300
protocol: TCP
targetPort: 9300
publishNotReadyAddresses: true
selector:
component: es
sessionAffinity: None
type: ClusterIP

elasticsearch.yml:

...
discovery.zen:
minimum_master_nodes: ${NODE_QUORUM}
ping.unicast.hosts: elasticsearch-cluster
...

**NOTE**: You are highly encouraged to use headless services as the they obsolete this plugin.

Installation
============
```
elasticsearch-plugin install io.fabric8:elasticsearch-cloud-kubernetes:6.1.2
elasticsearch-plugin install io.fabric8:elasticsearch-cloud-kubernetes:6.2.3.2
```

Versions available
@@ -36,8 +69,6 @@ discovery.zen.hosts_provider: kubernetes
path:
data: /data/data
logs: /data/log
plugins: /data/plugins
work: /data/work
```
## Kubernetes auth
@@ -81,11 +112,11 @@ The following manifest uses 3 replication controllers to created Elasticsearch p

* master
* data
* client
* coordinating-only

We use 2 services as well:

* One to target the client pods so that all requests to the cluster go through the client nodes
* One to target the coordinating-only pods so that all requests to the cluster go through the coordinating-only nodes
* A headless service to list all cluster endpoints managed by all 3 RCs.

```yaml
@@ -102,7 +133,7 @@ items:
targetPort: "http"
selector:
component: "elasticsearch"
type: "client"
type: "coordinating-only"
provider: "fabric8"
type: "LoadBalancer"
- apiVersion: "v1"
@@ -146,7 +177,8 @@ items:
fieldPath: "metadata.namespace"
- name: "NODE_MASTER"
value: "false"
image: "fabric8/elasticsearch-k8s:6.1.2"

image: "fabric8/elasticsearch-k8s:6.2.3"
name: "elasticsearch"
ports:
- containerPort: 9300
@@ -188,26 +220,27 @@ items:
fieldPath: "metadata.namespace"
- name: "NODE_DATA"
value: "false"
image: "fabric8/elasticsearch-k8s:6.1.2"

image: "fabric8/elasticsearch-k8s:6.2.3"
name: "elasticsearch"
ports:
- containerPort: 9300
name: "transport"
- apiVersion: "v1"
kind: "ReplicationController"
metadata:
name: "elasticsearch-client"
name: "elasticsearch-coordinating-only"
spec:
replicas: 1
selector:
component: "elasticsearch"
type: "client"
type: "coordinating-only"
provider: "fabric8"
template:
metadata:
labels:
component: "elasticsearch"
type: "client"
type: "coordinating-only"
provider: "fabric8"
spec:
serviceAccount: elasticsearch
@@ -224,7 +257,7 @@ items:
value: "false"
- name: "NODE_MASTER"
value: "false"
image: "fabric8/elasticsearch-k8s:6.1.2"
image: "fabric8/elasticsearch-k8s:6.2.3"
name: "elasticsearch"
ports:
- containerPort: 9200
20 changes: 8 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -20,19 +20,16 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.fabric8</groupId>
<artifactId>elasticsearch-cloud-kubernetes</artifactId>
<version>6.1.2</version>

<version>6.2.4-SNAPSHOT</version>
<name>Elasticsearch Kubernetes cloud plugin</name>
<description>The Kubernetes Cloud plugin allows to use Kubernetes for the unicast discovery mechanism.</description>
<url>https://github.com/jimmidyson/elasticsearch-cloud-kubernetes/</url>
<url>https://github.com/fabric8io/elasticsearch-cloud-kubernetes/</url>
<inceptionYear>2015</inceptionYear>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>9</version>
</parent>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
@@ -44,7 +41,7 @@
<connection>scm:git:git@github.com:fabric8io/elasticsearch-cloud-kubernetes.git</connection>
<developerConnection>scm:git:git@github.com:fabric8io/elasticsearch-cloud-kubernetes.git</developerConnection>
<url>http://github.com/fabric8io/elasticsearch-cloud-kubernetes</url>
<tag>elasticsearch-cloud-kubernetes-6.1.2</tag>
<tag>HEAD</tag>
</scm>

<issueManagement>
@@ -54,12 +51,11 @@

<properties>
<elasticsearch.plugin.name>discovery-kubernetes</elasticsearch.plugin.name>
<elasticsearch.version>5.5.2</elasticsearch.version>
<kubernetes-client.version>1.4.27</kubernetes-client.version>
<elasticsearch.version>6.2.3</elasticsearch.version>
<kubernetes-client.version>1.4.35</kubernetes-client.version>
<tests.shuffle>true</tests.shuffle>
<tests.output>onerror</tests.output>
<tests.client.ratio />
<es.plugin.port>9300</es.plugin.port>
<es.logger.level>INFO</es.logger.level>
<es.config>${project.build.testOutputDirectory}/elasticsearch.yml</es.config>
</properties>
@@ -83,20 +79,20 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.7</version>
<version>2.10.0</version>
</dependency>

<!-- Tests -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.7</version>
<version>2.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.1.0</version>
<version>4.5.1</version>
<scope>test</scope>
</dependency>

2 changes: 1 addition & 1 deletion src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ RUN set -x \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true

ENV ELASTICSEARCH_VERSION 6.1.2
ENV ELASTICSEARCH_VERSION 6.2.3

RUN set -x \
&& cd /usr/share \
18 changes: 18 additions & 0 deletions src/main/docker/config/jvm.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-Xms512m
-Xmx512m
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+AlwaysPreTouch
-server
-Xss1m
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djna.nosys=true
-XX:-OmitStackTraceInFastThrow
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true
-XX:+HeapDumpOnOutOfMemoryError
Original file line number Diff line number Diff line change
@@ -15,33 +15,29 @@
*/
package io.fabric8.elasticsearch.plugin.discovery.kubernetes;

import io.fabric8.elasticsearch.cloud.kubernetes.KubernetesAPIService;
import io.fabric8.elasticsearch.cloud.kubernetes.KubernetesAPIServiceImpl;
import io.fabric8.elasticsearch.discovery.kubernetes.KubernetesUnicastHostsProvider;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

import org.apache.logging.log4j.Logger;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.SpecialPermission;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.discovery.Discovery;
import org.elasticsearch.discovery.DiscoveryModule;
import org.elasticsearch.discovery.zen.UnicastHostsProvider;
import org.elasticsearch.discovery.zen.ZenDiscovery;
import org.elasticsearch.plugins.DiscoveryPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
import io.fabric8.elasticsearch.cloud.kubernetes.KubernetesAPIService;
import io.fabric8.elasticsearch.cloud.kubernetes.KubernetesAPIServiceImpl;
import io.fabric8.elasticsearch.discovery.kubernetes.KubernetesUnicastHostsProvider;


public class KubernetesDiscoveryPlugin extends Plugin implements DiscoveryPlugin {
@@ -65,14 +61,6 @@ public KubernetesDiscoveryPlugin(Settings settings) {
logger.trace("Starting Kubernetes discovery plugin...");
}

@Override
public Map<String, Supplier<Discovery>> getDiscoveryTypes(ThreadPool threadPool, TransportService transportService,
NamedWriteableRegistry namedWriteableRegistry, ClusterService clusterService, UnicastHostsProvider hostsProvider) {
// this is for backcompat with pre 5.1, where users would set discovery.type to use ec2 hosts provider
return Collections.singletonMap(KUBERNETES, () ->
new ZenDiscovery(settings, threadPool, transportService, namedWriteableRegistry, clusterService, hostsProvider));
}

@Override
public Map<String, Supplier<UnicastHostsProvider>> getZenHostsProviders(TransportService transportService,
NetworkService networkService) {
1 change: 0 additions & 1 deletion src/main/plugin-metadata/plugin-descriptor.properties
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@

name=${elasticsearch.plugin.name}
version=${project.version}
jvm=true
classname=io.fabric8.elasticsearch.plugin.discovery.kubernetes.KubernetesDiscoveryPlugin
description=${project.name}
elasticsearch.version=${elasticsearch.version}
3 changes: 1 addition & 2 deletions src/main/plugin-metadata/plugin-security.policy
Original file line number Diff line number Diff line change
@@ -16,10 +16,9 @@

grant {
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.lang.RuntimePermission "setFactory";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.ssl";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.io.FilePermission "<<ALL FILES>>", "read,execute,readlink";
permission java.net.NetPermission "getProxySelector";
permission java.net.NetPermission "getCookieHandler";
permission java.net.SocketPermission "*", "resolve,connect";
};