-
Notifications
You must be signed in to change notification settings - Fork 5
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 #712 from MetaCell/release/2.2.0
Release/2.2.0
- Loading branch information
Showing
60 changed files
with
1,502 additions
and
913 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
from pprint import pprint | ||
import schemathesis as st | ||
from schemathesis.checks import response_schema_conformance, not_a_server_error | ||
|
||
from cloudharness_test import apitest_init # include to perform default authorization | ||
|
||
app_url = os.environ.get("APP_URL", "http://samples.ch.local/api") | ||
|
||
try: | ||
schema = st.from_uri(app_url + "/openapi.json") | ||
except: | ||
# support alternative schema location | ||
schema = st.from_uri(app_url.replace("/api", "") + "/openapi.json") | ||
|
||
|
||
@schema.parametrize(endpoint="/ping") | ||
def test_ping(case): | ||
response = case.call() | ||
pprint(response.__dict__) | ||
assert response.status_code == 200, "this api errors on purpose" | ||
|
||
def test_state_machine(): | ||
schema.as_state_machine().run() | ||
# APIWorkflow = schema.as_state_machine() | ||
# APIWorkflow.run() | ||
# TestAPI = APIWorkflow.TestCase |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,69 @@ | ||
# Ingress, domains and proxies | ||
|
||
## Default configurations for domain and subdomains | ||
Cloud Harness makes it very easy to configure domains and proxies, by making | ||
an underlying assumption: | ||
|
||
- Applications share a main base domain (say ch.org) | ||
- Applications can define a subdomain (say myapp) | ||
|
||
The main domain is configured in the [root values file](../deployment-configuration/values-template.yaml) and | ||
it is usually overridden by the `harness-deployment` command, e.g. | ||
|
||
``` | ||
harness-deployment ... -d ch.org | ||
``` | ||
|
||
The subdomain is defined in the application's values.yaml file in | ||
harness.subdomain (see for instance the [samples application configuration](../applications/samples/deploy/values.yaml)) | ||
|
||
For instance on applications/myapp/deploy/values.yaml: | ||
|
||
```yaml | ||
harness: | ||
subdomain: myapp | ||
``` | ||
The above configurations put together create an ingress configuration for https://myapp.ch.org and automatically configure letsencrypt to create and renew certificates. | ||
Note: | ||
that the tls and letsencrypt configurations are enabled by default but should usually be disabled locally with | ||
``` | ||
harness-deployment ... -dtls -l | ||
``` | ||
|
||
## Main application | ||
|
||
The "main" application is deployed on the base domain. | ||
In order to specify a main application, override the value in your `/deployment-configuration/values-template.yaml` file. | ||
|
||
Example | ||
```yaml | ||
mainapp: myapp | ||
``` | ||
This creates a reverse proxy to https://ch.org pointing to myapp | ||
## Proxy configurations | ||
Ingress is a reverse proxy and as such has some configurations to take into account. | ||
The most common configurations are connection timeouts and payload size. | ||
To configure it, override the following values in your `deployment-configuration/values-template.yaml` file. | ||
|
||
```yaml | ||
proxy: | ||
timeout: | ||
# -- Timeout for proxy connections in seconds. | ||
send: 60 | ||
# -- Timeout for proxy responses in seconds. | ||
read: 60 | ||
keepalive: 60 | ||
payload: | ||
# -- Maximum size of payload in MB | ||
max: 250 | ||
``` | ||
|
||
Note that in the case that gatekeepers are enabled, the same configurations are applied | ||
to the gatekeepers, unless the application override them on `harness.proxy.*`. | ||
See also the [gatekeepers documentation](./accounts.md#secure-and-enpoint-with-the-gatekeeper). |
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.