-
Notifications
You must be signed in to change notification settings - Fork 61
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 #956 from RedHatInsights/service-session-affinity
feat(clowdapp): add sessionAffinity support for PublicWebService
- Loading branch information
Showing
10 changed files
with
162 additions
and
0 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
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
7 changes: 7 additions & 0 deletions
7
tests/kuttl/test-public-webservice-sessionaffinity/00-install.yaml
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,7 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: test-web-services-sessionaffinity | ||
spec: | ||
finalizers: | ||
- kubernetes |
68 changes: 68 additions & 0 deletions
68
tests/kuttl/test-public-webservice-sessionaffinity/01-assert.yaml
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,68 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: puptoo | ||
namespace: test-web-services-sessionaffinity | ||
labels: | ||
app: puptoo | ||
ownerReferences: | ||
- apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdApp | ||
name: puptoo | ||
type: Opaque | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: puptoo-processor | ||
namespace: test-web-services-sessionaffinity | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- env: | ||
- name: ENV_VAR_1 | ||
value: "env_var_1" | ||
- name: ENV_VAR_2 | ||
value: "env_var_2" | ||
- name: ACG_CONFIG | ||
value: /cdapp/cdappconfig.json | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: puptoo-processor | ||
namespace: test-web-services-sessionaffinity | ||
spec: | ||
selector: | ||
pod: puptoo-processor | ||
sessionAffinity: ClientIP | ||
ports: | ||
- port: 8000 | ||
targetPort: 8000 | ||
name: public | ||
protocol: TCP | ||
appProtocol: http | ||
- port: 10000 | ||
targetPort: 10000 | ||
name: private | ||
protocol: TCP | ||
appProtocol: http | ||
- port: 9000 | ||
targetPort: 9000 | ||
name: metrics | ||
protocol: TCP | ||
appProtocol: http | ||
--- | ||
apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdEnvironment | ||
metadata: | ||
name: test-web-services-sessionaffinity | ||
status: | ||
apps: | ||
- name: puptoo | ||
deployments: | ||
- hostname: puptoo-processor.test-web-services-sessionaffinity.svc | ||
name: puptoo-processor | ||
port: 8000 |
56 changes: 56 additions & 0 deletions
56
tests/kuttl/test-public-webservice-sessionaffinity/01-pods.yaml
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,56 @@ | ||
--- | ||
apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdEnvironment | ||
metadata: | ||
name: test-web-services-sessionaffinity | ||
spec: | ||
targetNamespace: test-web-services-sessionaffinity | ||
providers: | ||
web: | ||
port: 8000 | ||
privatePort: 10000 | ||
mode: operator | ||
metrics: | ||
port: 9000 | ||
mode: operator | ||
path: "/metrics" | ||
kafka: | ||
mode: none | ||
db: | ||
mode: none | ||
logging: | ||
mode: none | ||
objectStore: | ||
mode: none | ||
inMemoryDb: | ||
mode: none | ||
resourceDefaults: | ||
limits: | ||
cpu: 400m | ||
memory: 1024Mi | ||
requests: | ||
cpu: 30m | ||
memory: 512Mi | ||
--- | ||
apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdApp | ||
metadata: | ||
name: puptoo | ||
namespace: test-web-services-sessionaffinity | ||
spec: | ||
envName: test-web-services-sessionaffinity | ||
deployments: | ||
- name: processor | ||
podSpec: | ||
image: quay.io/psav/clowder-hello | ||
env: | ||
- name: ENV_VAR_1 | ||
value: env_var_1 | ||
- name: ENV_VAR_2 | ||
value: env_var_2 | ||
webServices: | ||
private: | ||
enabled: True | ||
public: | ||
enabled: True | ||
sessionAffinity: True |
10 changes: 10 additions & 0 deletions
10
tests/kuttl/test-public-webservice-sessionaffinity/03-delete.yaml
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,10 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
delete: | ||
- apiVersion: v1 | ||
kind: Namespace | ||
name: test-web-services-sessionaffinity | ||
- apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdEnvironment | ||
name: test-web-services-sessionaffinity |