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

Add kubernetes native service discovery support and helm chart templates #3055

Merged
merged 2 commits into from
Jun 27, 2020

Conversation

nobodyiam
Copy link
Member

@nobodyiam nobodyiam commented May 2, 2020

What's the purpose of this PR

Add kubernetes native service discovery support to simplify the deployment complexity of apollo and enable the possibliity to integrate with other kubernetes tooling ,such as Istio.

Which issue(s) this PR fixes:

Fixes #3054

Brief changelog

  1. Add KubernetesDiscoveryService implementation that skips any service discovery and just return what is configured
  2. Add helm charts for configservice, adminservice and portal which leverage the kubernetes native service discovery

Helm Chart Quick Start

1. Add Apollo Helm Chart Repository

$ helm repo add apollo http://ctripcorp.github.io/apollo/charts
$ helm search repo apollo

2. Install apollo-configservice and apollo-adminservice

Suppose the address of ApolloConfigDB is 1.2.3.4, user name/password is apollo, then

$ helm install apollo-service-dev \
    --set configdb.host=1.2.3.4 \
    --set configdb.userName=apollo \
    --set configdb.password=apollo \
    --set configdb.service.enabled=true \
    --set configService.replicaCount=1 \
    --set adminService.replicaCount=1 \
    apollo/apollo-service

3. Install apollo-portal

Suppose the address of ApolloPortalDB is 1.2.3.4, user name/password is apollo, the service name of apollo-configservice is apollo-service-dev-apollo-configservice, then

$ helm install apollo-portal \
    --set portaldb.host=1.2.3.4 \
    --set portaldb.userName=apollo \
    --set portaldb.password=apollo \
    --set portaldb.service.enabled=true \
    --set config.envs="dev" \
    --set config.metaServers.dev=http://apollo-service-dev-apollo-configservice:8080 \
    --set replicaCount=1 \
    apollo/apollo-portal

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.

@nobodyiam nobodyiam marked this pull request as draft May 2, 2020 13:09
@codecov-io
Copy link

codecov-io commented May 4, 2020

Codecov Report

Merging #3055 into master will increase coverage by 0.23%.
The diff coverage is 94.54%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3055      +/-   ##
============================================
+ Coverage     51.32%   51.55%   +0.23%     
- Complexity     2235     2249      +14     
============================================
  Files           432      433       +1     
  Lines         13385    13404      +19     
  Branches       1375     1372       -3     
============================================
+ Hits           6870     6911      +41     
+ Misses         6041     6017      -24     
- Partials        474      476       +2     
Impacted Files Coverage Δ Complexity Δ
...k/apollo/adminservice/AdminServiceApplication.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...apollo/configservice/ConfigServiceApplication.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...k/apollo/portal/component/config/PortalConfig.java 25.30% <0.00%> (ø) 9.00 <0.00> (ø)
...lo/portal/spi/configuration/AuthConfiguration.java 6.39% <33.33%> (+0.54%) 2.00 <1.00> (+1.00)
...rvice/controller/KubernetesHomePageController.java 100.00% <100.00%> (ø) 2.00 <2.00> (?)
...ollo/metaservice/controller/ServiceController.java 100.00% <100.00%> (+77.77%) 4.00 <3.00> (+2.00)
...o/metaservice/service/DefaultDiscoveryService.java 100.00% <100.00%> (ø) 6.00 <6.00> (?)
...etaservice/service/KubernetesDiscoveryService.java 100.00% <100.00%> (ø) 7.00 <7.00> (?)
...ip/framework/apollo/mockserver/EmbeddedApollo.java 90.12% <0.00%> (-2.65%) 18.00% <0.00%> (-1.00%)
.../apollo/internals/RemoteConfigLongPollService.java 79.51% <0.00%> (-1.21%) 28.00% <0.00%> (-1.00%)
... and 3 more

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 0478122...6cc6324. Read the comment docs.

@nobodyiam nobodyiam force-pushed the k8s-discovery branch 3 times, most recently from 634f289 to d00a840 Compare May 5, 2020 11:52
@nobodyiam nobodyiam force-pushed the k8s-discovery branch 2 times, most recently from 6cc6324 to fb74c22 Compare May 21, 2020 13:19
@codecov-commenter
Copy link

codecov-commenter commented May 21, 2020

Codecov Report

Merging #3055 into master will increase coverage by 0.28%.
The diff coverage is 94.54%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3055      +/-   ##
============================================
+ Coverage     51.22%   51.50%   +0.28%     
- Complexity     2234     2251      +17     
============================================
  Files           432      433       +1     
  Lines         13427    13448      +21     
  Branches       1382     1379       -3     
============================================
+ Hits           6878     6927      +49     
+ Misses         6069     6042      -27     
+ Partials        480      479       -1     
Impacted Files Coverage Δ Complexity Δ
...k/apollo/adminservice/AdminServiceApplication.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...apollo/configservice/ConfigServiceApplication.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...k/apollo/portal/component/config/PortalConfig.java 25.30% <0.00%> (ø) 9.00 <0.00> (ø)
...lo/portal/spi/configuration/AuthConfiguration.java 6.39% <33.33%> (+0.54%) 2.00 <1.00> (+1.00)
...rvice/controller/KubernetesHomePageController.java 100.00% <100.00%> (ø) 2.00 <2.00> (?)
...ollo/metaservice/controller/ServiceController.java 100.00% <100.00%> (+77.77%) 4.00 <3.00> (+2.00)
...o/metaservice/service/DefaultDiscoveryService.java 100.00% <100.00%> (ø) 6.00 <6.00> (?)
...etaservice/service/KubernetesDiscoveryService.java 100.00% <100.00%> (ø) 7.00 <7.00> (?)
... and 2 more

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 df6cb39...7ac6bd2. Read the comment docs.

@nobodyiam nobodyiam force-pushed the k8s-discovery branch 3 times, most recently from 2784bc9 to 0ac1b14 Compare June 14, 2020 13:25
@nobodyiam nobodyiam marked this pull request as ready for review June 14, 2020 13:25
@nobodyiam nobodyiam changed the title [WIP] Add kubernetes native service discovery support Add kubernetes native service discovery support Jun 14, 2020
@nobodyiam nobodyiam changed the title Add kubernetes native service discovery support Add kubernetes native service discovery support and helm chart templates Jun 14, 2020
@nobodyiam nobodyiam added this to the 1.7.0 milestone Jun 25, 2020
@nobodyiam nobodyiam merged commit 885e461 into apolloconfig:master Jun 27, 2020
@stheart
Copy link

stheart commented Jun 28, 2020

$ helm repo add apollo http://ctripcorp.github.io/apollo/charts
$ helm search repo apollo
执行完上述命令后显示为:No results found
http://ctripcorp.github.io/apollo/charts 这个地址是正确的吗

@nobodyiam
Copy link
Member Author

@stheart 地址是正确的,看下是否是你本地的网络访问有问题?可以尝试下载下面的文件试试
http://ctripcorp.github.io/apollo/charts/index.yaml

@stheart
Copy link

stheart commented Jun 29, 2020

@stheart 地址是正确的,看下是否是你本地的网络访问有问题?可以尝试下载下面的文件试试
http://ctripcorp.github.io/apollo/charts/index.yaml

地址没问题,是我helm版本低了,不支持helm search repo

@nobodyiam nobodyiam deleted the k8s-discovery branch December 7, 2022 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Proposal] Apollo with Kubernetes Service Discovery
4 participants