-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1232 from amazeeio/opendistro
Migrate from SearchGuard to OpenDistro Security
- Loading branch information
Showing
38 changed files
with
557 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
ARG IMAGE_REPO | ||
FROM ${IMAGE_REPO:-lagoon}/commons as commons | ||
FROM docker.elastic.co/elasticsearch/elasticsearch:7.1.1 | ||
|
||
LABEL maintainer="amazee.io" | ||
ENV LAGOON=elasticsearch | ||
|
||
ARG LAGOON_VERSION | ||
ENV LAGOON_VERSION=$LAGOON_VERSION | ||
|
||
# Copy commons files | ||
COPY --from=commons /lagoon /lagoon | ||
COPY --from=commons /bin/fix-permissions /bin/ep /bin/docker-sleep /bin/ | ||
COPY --from=commons /home /home | ||
|
||
RUN curl -sL https://github.com/krallin/tini/releases/download/v0.18.0/tini -o /sbin/tini && chmod a+x /sbin/tini | ||
|
||
COPY docker-entrypoint.sh.7 /lagoon/entrypoints/90-elasticsearch.sh | ||
|
||
RUN chmod g+w /etc/passwd \ | ||
&& mkdir -p /home | ||
|
||
# Reproduce behavior of Alpine: Run Bash as sh | ||
RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
ENV TMPDIR=/tmp \ | ||
TMP=/tmp \ | ||
HOME=/home \ | ||
# When Bash is invoked via `sh` it behaves like the old Bourne Shell and sources a file that is given in `ENV` | ||
ENV=/home/.bashrc \ | ||
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV` | ||
BASH_ENV=/home/.bashrc | ||
|
||
RUN echo $'\n\ | ||
node.name: "${HOSTNAME}"\n\ | ||
node.master: "${NODE_MASTER}"\n\ | ||
node.data: "${NODE_DATA}"\n\ | ||
node.ingest: "${NODE_INGEST}"\n\ | ||
node.ml: "${NODE_ML}"\n\ | ||
xpack.ml.enabled: "${XPACK_ML_ENABLED}"\n\ | ||
xpack.watcher.enabled: "${XPACK_WATCHER_ENABLED}"\n\ | ||
xpack.security.enabled: "${XPACK_SECURITY_ENABLED}"\n\ | ||
cluster.remote.connect: "${CLUSTER_REMOTE_CONNECT}"' >> config/elasticsearch.yml | ||
|
||
RUN fix-permissions config | ||
|
||
ENV ES_JAVA_OPTS="-Xms400m -Xmx400m" \ | ||
NODE_MASTER=true \ | ||
NODE_DATA=true \ | ||
NODE_INGEST=true \ | ||
NODE_ML=true \ | ||
XPACK_ML_ENABLED=true \ | ||
XPACK_WATCHER_ENABLED=true \ | ||
XPACK_SECURITY_ENABLED=false \ | ||
CLUSTER_REMOTE_CONNECT=true \ | ||
EXTRA_OPTS="" | ||
|
||
|
||
VOLUME [ "/usr/share/elasticsearch/data" ] | ||
|
||
ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.bash"] | ||
|
||
CMD ["/usr/local/bin/docker-entrypoint.sh"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
if [ ! -z "$EXTRA_OPTS" ]; then | ||
echo -e "${EXTRA_OPTS}" >> /usr/share/elasticsearch/config/elasticsearch.yml | ||
fi | ||
|
||
if [ -z "$POD_NAMESPACE" ]; then | ||
# Single container runs in docker | ||
echo "POD_NAMESPACE not set, spin up single node" | ||
sed -i 's/cluster.initial_master_nodes:.*//' /usr/share/elasticsearch/config/elasticsearch.yml | ||
echo "cluster.initial_master_nodes: ${HOSTNAME}" >> /usr/share/elasticsearch/config/elasticsearch.yml | ||
else | ||
# Is running in Kubernetes/OpenShift, so find all other pods | ||
# belonging to the namespace | ||
echo "Elasticsearch: Running in Kubernetes, setting up for clustering" | ||
K8S_SVC_NAME=$(hostname -f | cut -d"." -f2) | ||
echo "Using service name: ${K8S_SVC_NAME}" | ||
sed -i 's/discovery.seed_hosts:.*//' /usr/share/elasticsearch/config/elasticsearch.yml | ||
sed -i 's/cluster.initial_master_nodes:.*//' /usr/share/elasticsearch/config/elasticsearch.ym | ||
echo "discovery.seed_hosts: ${K8S_SVC_NAME}" >> /usr/share/elasticsearch/config/elasticsearch.yml | ||
echo "cluster.initial_master_nodes: ${K8S_SVC_NAME}-0" >> /usr/share/elasticsearch/config/elasticsearch.yml | ||
fi |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
ARG IMAGE_REPO | ||
FROM ${IMAGE_REPO:-lagoon}/commons as commons | ||
FROM docker.elastic.co/kibana/kibana:7.1.1 | ||
|
||
LABEL maintainer="amazee.io" | ||
ENV LAGOON=kibana | ||
|
||
USER root | ||
|
||
ARG LAGOON_VERSION | ||
ENV LAGOON_VERSION=$LAGOON_VERSION | ||
|
||
# Copy commons files | ||
COPY --from=commons /lagoon /lagoon | ||
COPY --from=commons /bin/fix-permissions /bin/ep /bin/docker-sleep /bin/ | ||
COPY --from=commons /home /home | ||
|
||
RUN curl -sL https://github.com/krallin/tini/releases/download/v0.18.0/tini -o /sbin/tini && chmod a+x /sbin/tini | ||
|
||
RUN chmod g+w /etc/passwd \ | ||
&& mkdir -p /home | ||
|
||
# Reproduce behavior of Alpine: Run Bash as sh | ||
RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
ENV TMPDIR=/tmp \ | ||
TMP=/tmp \ | ||
HOME=/home \ | ||
# When Bash is invoked via `sh` it behaves like the old Bourne Shell and sources a file that is given in `ENV` | ||
ENV=/home/.bashrc \ | ||
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV` | ||
BASH_ENV=/home/.bashrc | ||
|
||
RUN fix-permissions /usr/share/kibana | ||
|
||
# tells the local development environment on which port we are running | ||
# ENV LAGOON_LOCALDEV_HTTP_PORT=5601 | ||
|
||
ENV NODE_OPTIONS="--max-old-space-size=200" | ||
|
||
ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.bash"] | ||
CMD ["/bin/bash", "/usr/local/bin/kibana-docker"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.