Skip to content
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: implement invoker-node affinity and eliminate usage of kubectl #3963

Merged
merged 1 commit into from
Aug 17, 2018

Conversation

dgrove-oss
Copy link
Member

@dgrove-oss dgrove-oss commented Aug 13, 2018

1. Upgrade to latest released version of the fabric8 Kubernetes client
   to get access to an implementation of node affinity. Use that implementation
   to optionally add a scheduling affinity to the pods created for actions
   to bind them to worker nodes labeled as invoker nodes.

2. implement the container removal operation via the kube rest client
   instead of via an exec to the kubectl cli.  This eliminates the last
   usage of kubectl in the KubernetesClient and allows the kubectl
   executable to be removed from the invoker Docker image.

@codecov-io
Copy link

codecov-io commented Aug 13, 2018

Codecov Report

Merging #3963 into master will decrease coverage by 4.42%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3963      +/-   ##
==========================================
- Coverage    85.2%   80.77%   -4.43%     
==========================================
  Files         146      146              
  Lines        7057     7054       -3     
  Branches      413      412       -1     
==========================================
- Hits         6013     5698     -315     
- Misses       1044     1356     +312
Impacted Files Coverage Δ
...re/containerpool/kubernetes/KubernetesClient.scala 27.27% <0%> (-0.14%) ⬇️
...core/database/cosmosdb/RxObservableImplicits.scala 0% <0%> (-100%) ⬇️
...core/database/cosmosdb/CosmosDBArtifactStore.scala 0% <0%> (-95.1%) ⬇️
...sk/core/database/cosmosdb/CosmosDBViewMapper.scala 0% <0%> (-92.6%) ⬇️
...whisk/core/database/cosmosdb/CosmosDBSupport.scala 0% <0%> (-81.82%) ⬇️
...abase/cosmosdb/CosmosDBArtifactStoreProvider.scala 0% <0%> (-58.83%) ⬇️
...la/whisk/core/database/cosmosdb/CosmosDBUtil.scala 92% <0%> (-4%) ⬇️
...rc/main/scala/whisk/common/ForcibleSemaphore.scala 88.46% <0%> (-3.85%) ⬇️
...ain/scala/whisk/core/invoker/InvokerReactive.scala 73.94% <0%> (+15.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f365d1c...e6318b8. Read the comment docs.

@dgrove-oss dgrove-oss force-pushed the upgrade-kube-client branch 3 times, most recently from f977382 to dcef2d0 Compare August 13, 2018 21:35
@dgrove-oss dgrove-oss changed the title Kubernetes: invoker-node affinity for user action pods k8s: implement invoker-node affinity and eliminate usage of kubectl Aug 13, 2018
@dgrove-oss
Copy link
Member Author

PG2 3499 🏃

@markusthoemmes
Copy link
Contributor

@dgrove-oss what prevents us from removing the binary here?

@dgrove-oss
Copy link
Member Author

I was going to stage it in a separate PR to make it easier to find and revert just that piece in case we wanted the binary back later (or it was being used in openshift in some way I wasn't aware of). I could remove the binary from the Dockerfile in this PR if you'd prefer a single PR.

@dgrove-oss
Copy link
Member Author

pushed a second commit to remove the kubectl executable from the Dockerfile.

Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, two nits but approving anyway.

@@ -54,6 +54,11 @@ whisk {
enabled: false
port: 3233
}
invoker-node-affinity {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "pod-node-affinity" or "user-pod-node-affinity"?

}

def rm(key: String, value: String, ensureUnpaused: Boolean = false)(implicit transid: TransactionId): Future[Unit] = {
runCmd(Seq("delete", "--now", "pod", "-l", s"$key=$value"), config.timeouts.rm).map(_ => ())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the timeouts still in use? If not: Delete from the config?

@@ -17,11 +16,6 @@ rm -f docker-${DOCKER_VERSION}.tgz && \
chmod +x /usr/bin/docker && \
chmod +x /usr/bin/docker-runc

# Install kubernetes client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

/**
* Configuration for invoker node affinity for user action containers
*/
case class KubernetesInvokerNodeAffinity(enabled: Boolean, key: String, value: String)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we document what key,value are used for ?

@dgrove-oss
Copy link
Member Author

Thanks for review comments; working on addressing them this morning.

1. Upgrade to latest released version of the fabric8 Kubernetes client
   to get access to an implementation of node affinity. Use that implementation
   to optionally add a scheduling affinity to the pods created for actions
   to bind them to worker nodes labeled as invoker nodes.

2. implement the container removal operation via the kube rest client
   instead of via an exec to the kubectl cli.  This eliminates the last
   usage of kubectl in the KubernetesClient and allows the kubectl
   executable to be removed from the invoker Docker image.
@dgrove-oss
Copy link
Member Author

addressed review comments & squashed to single commit. Should be ready to merge once CI completes.

@dgrove-oss
Copy link
Member Author

PG1: 3250 👍

@markusthoemmes markusthoemmes merged commit 10ba53c into apache:master Aug 17, 2018
@dgrove-oss dgrove-oss deleted the upgrade-kube-client branch August 17, 2018 13:29
BillZong pushed a commit to BillZong/openwhisk that referenced this pull request Nov 18, 2019
…he#3963)

1. Upgrade to latest released version of the fabric8 Kubernetes client
   to get access to an implementation of node affinity. Use that implementation
   to optionally add a scheduling affinity to the pods created for actions
   to bind them to worker nodes labeled as invoker nodes.

2. implement the container removal operation via the kube rest client
   instead of via an exec to the kubectl cli.  This eliminates the last
   usage of kubectl in the KubernetesClient and allows the kubectl
   executable to be removed from the invoker Docker image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants