-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
k8s-int-test-build: zk-less druid cluster and http based segment/task managment #10686
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
107bcc6
zk-less druid cluster in k8s build
himanshug 04c488e
attempt to fix build and use http based remote task management
himanshug d8f3f21
mm/router logs for debugging
himanshug b769b0e
add default account k8s role and binding for pod, configMap access
himanshug d17489c
fix issue
himanshug 263dd77
change router port to 8088 for common readinessProbe
himanshug f8bb7b1
break build_run_k8s_cluster.sh into separate scripts
himanshug a0d43c7
revert changes to K8sDruidNodeAnnouncer.java
himanshug d1debff
k8s extension doc update
himanshug 32277c7
add license to new file
himanshug a69f199
address review comments
himanshug f6fd694
do not try to load lookups at startup to improve cluster startup time
himanshug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# 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: druid-cluster | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- configmaps | ||
verbs: | ||
- '*' | ||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: druid-cluster | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
roleRef: | ||
kind: Role | ||
name: druid-cluster | ||
apiGroup: rbac.authorization.k8s.io |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
# 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. | ||
|
||
set -e | ||
|
||
export KUBECTL="sudo /usr/local/bin/kubectl" | ||
|
||
# setup client keystore | ||
cd integration-tests | ||
./docker/tls/generate-client-certs-and-keystores.sh | ||
rm -rf docker/client_tls | ||
cp -r client_tls docker/client_tls | ||
cd .. | ||
|
||
# Build Docker images for pods | ||
mvn -B -ff -q dependency:go-offline \ | ||
install \ | ||
-Pdist,bundle-contrib-exts \ | ||
-Pskip-static-checks,skip-tests \ | ||
-Dmaven.javadoc.skip=true | ||
|
||
docker build -t druid/cluster:v1 -f distribution/docker/DockerfileBuildTarAdvanced . | ||
|
||
# This tmp dir is used for MiddleManager pod and Historical Pod to cache segments. | ||
mkdir tmp | ||
chmod 777 tmp | ||
|
||
$KUBECTL apply -f integration-tests/k8s/role-and-binding.yaml | ||
sed -i "s|REPLACE_VOLUMES|`pwd`|g" integration-tests/k8s/tiny-cluster.yaml | ||
$KUBECTL apply -f integration-tests/k8s/tiny-cluster.yaml | ||
|
||
# Wait a bit | ||
sleep 120 | ||
|
||
## Debug And FastFail | ||
|
||
$KUBECTL get pod | ||
$KUBECTL get svc | ||
|
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,37 @@ | ||
#!/usr/bin/env bash | ||
# 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. | ||
|
||
set -e | ||
|
||
export DRUID_OPERATOR_VERSION=0.0.3 | ||
export KUBECTL="sudo /usr/local/bin/kubectl" | ||
|
||
|
||
# Prepare For Druid-Operator | ||
git clone https://github.com/druid-io/druid-operator.git | ||
cd druid-operator | ||
git checkout -b druid-operator-$DRUID_OPERATOR_VERSION druid-operator-$DRUID_OPERATOR_VERSION | ||
cd .. | ||
sed -i "s|REPLACE_IMAGE|druidio/druid-operator:$DRUID_OPERATOR_VERSION|g" druid-operator/deploy/operator.yaml | ||
|
||
# Deploy Druid Operator and Druid CR spec | ||
$KUBECTL create -f druid-operator/deploy/service_account.yaml | ||
$KUBECTL create -f druid-operator/deploy/role.yaml | ||
$KUBECTL create -f druid-operator/deploy/role_binding.yaml | ||
$KUBECTL create -f druid-operator/deploy/crds/druid.apache.org_druids_crd.yaml | ||
$KUBECTL create -f druid-operator/deploy/operator.yaml | ||
|
||
echo "Setup Druid Operator on K8S Done!" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious. Which kind of druid server needs these
add labels to self-pod, List and Watch other Pods, create ConfigMap
permissions? MiddleManager or all the druid servers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everyone needs pod list/update .
create/update ConfigMap
is needed only by coordinators/overlords which participate in leader election ... butread ConfigMap
is needed by all so as to know who the leader is. That said, I haven't tested such granularity and would just give same permission to all pods.