Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Capacity flag per cluster to rate limit tenant resources for che and …
Browse files Browse the repository at this point in the history
…jenkins (#477)

Part of openshiftio/openshift.io#3320

To avoid overloading clusters we need a way to limit total amount of che and jenkins instances running on each cluster. This PR will add a new parameter to the cluster config which will reflect the current capacity of each cluster. When the corresponding secret is modified it will cause the config file update. The file watcher will re-load cluster configuration.
  • Loading branch information
alexeykazakov authored and sbose78 committed May 1, 2018
1 parent f8c3f2e commit 19eb16a
Show file tree
Hide file tree
Showing 15 changed files with 515 additions and 186 deletions.
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ required = [
[prune]
go-tests = true
unused-packages = true

[[constraint]]
name = "github.com/fsnotify/fsnotify"
version = "1.4.7"
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ goTemplate{
dockerOrganisation = 'fabric8'
project = 'fabric8-auth'
dockerBuildOptions = '--file Dockerfile.deploy'
makeTarget = 'build check-go-format test-unit-junit'
makeTarget = 'build check-go-format'
}
} else if (utils.isCD()){
def v = goRelease{
githubOrganisation = 'fabric8-services'
dockerOrganisation = 'fabric8'
project = 'fabric8-auth'
dockerBuildOptions = '--file Dockerfile.deploy'
makeTarget = 'build check-go-format test-unit-junit'
makeTarget = 'build check-go-format'
}

initServiceGitHash = sh(script: 'git rev-parse HEAD', returnStdout: true).toString().trim()
Expand Down
15 changes: 14 additions & 1 deletion configuration/conf-files/oso-clusters.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@
"token-provider-id":"886c7ea3-ef97-443d-b345-de94b94bb65d",
"auth-client-id":"autheast2a",
"auth-client-secret":"autheast2asecret",
"auth-client-default-scope":"user:full"
"auth-client-default-scope":"user:full",
"capacity-exhausted":false
},
{
"name":"us-east-1a",
"api-url":"https://api.starter-us-east-1a.openshift.com",
"app-dns":"b542.starter-us-east-1a.openshiftapps.com",
"service-account-token":"sdfjdlfjdfkjdlfjd12324434543085djdfjd084508gfdkjdofkjg43854085dlkjdlk",
"service-account-username":"dsaas",
"token-provider-id":"886c7ea3-ef97-443d-b345-de94b94bb65d",
"auth-client-id":"autheast1a",
"auth-client-secret":"autheast1asecret",
"auth-client-default-scope":"user:full",
"capacity-exhausted":true
}
]
}
39 changes: 39 additions & 0 deletions configuration/conf-files/tests/oso-clusters-capacity-updated.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"clusters": [
{
"name":"us-east-2",
"api-url":"https://api.starter-us-east-2.openshift.com",
"app-dns":"8a09.starter-us-east-2.openshiftapps.com",
"service-account-token":"fX0nH3d68LQ6SK5wBE6QeKJ6X8AZGVQO3dGQZZETakhmgmWAqr2KDFXE65KUwBO69aWoq",
"service-account-username":"dsaas",
"token-provider-id":"f867ac10-5e05-4359-a0c6-b855ece59090",
"auth-client-id":"autheast2",
"auth-client-secret":"autheast2secret",
"auth-client-default-scope":"user:full"
},
{
"name":"us-east-2a",
"api-url":"https://api.starter-us-east-2a.openshift.com",
"app-dns":"b542.starter-us-east-2a.openshiftapps.com",
"service-account-token":"ak61T6RSAacWFruh1vZP8cyUOBtQ3Chv1rdOBddSuc9nZ2wEcs81DHXRO55NpIpVQ8uiH",
"service-account-username":"dsaas",
"token-provider-id":"886c7ea3-ef97-443d-b345-de94b94bb65d",
"auth-client-id":"autheast2a",
"auth-client-secret":"autheast2asecret",
"auth-client-default-scope":"user:full",
"capacity-exhausted":true
},
{
"name":"us-east-1a",
"api-url":"https://api.starter-us-east-1a.openshift.com",
"app-dns":"b542.starter-us-east-1a.openshiftapps.com",
"service-account-token":"sdfjdlfjdfkjdlfjd12324434543085djdfjd084508gfdkjdofkjg43854085dlkjdlk",
"service-account-username":"dsaas",
"token-provider-id":"886c7ea3-ef97-443d-b345-de94b94bb65d",
"auth-client-id":"autheast1a",
"auth-client-secret":"autheast1asecret",
"auth-client-default-scope":"user:full",
"capacity-exhausted":false
}
]
}
4 changes: 4 additions & 0 deletions configuration/conf-files/tests/oso-clusters-empty.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"clusters": [
]
}
Empty file.
3 changes: 3 additions & 0 deletions configuration/conf-files/tests/oso-clusters-wrong-json.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"somedata": "blah-blah-blah"
}
Loading

0 comments on commit 19eb16a

Please sign in to comment.