-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
215 additions
and
0 deletions.
There are no files selected for viewing
183 changes: 183 additions & 0 deletions
183
charts/snyk-broker/tests/__snapshot__/broker_cra_deployment_extraPodSpecs_test.yaml.snap
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,183 @@ | ||
renders extraPodSpecs CRA: | ||
1: | | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: snyk-broker-RELEASE-NAME | ||
helm.sh/chart: snyk-broker-0.0.0 | ||
name: container-registry-agent-broker-RELEASE-NAME | ||
namespace: NAMESPACE | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/name: snyk-broker-RELEASE-NAME | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/name: snyk-broker-RELEASE-NAME | ||
spec: | ||
containers: | ||
- env: | ||
- name: BROKER_SERVER_URL | ||
value: https://broker.test.snyk.io | ||
- name: BROKER_HEALTHCHECK_PATH | ||
value: /healthcheck | ||
- name: BROKER_SYSTEMCHECK_PATH | ||
value: /systemcheck | ||
- name: BROKER_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
key: container-registry-agent-broker-token-key | ||
name: container-registry-agent-broker-token-RELEASE-NAME | ||
- name: CR_AGENT_URL | ||
value: http://cra-service-RELEASE-NAME:8081 | ||
- name: CR_TYPE | ||
value: ecr | ||
- name: CR_ROLE_ARN | ||
value: arn:aws-us-gov:iam::123456789012:role | ||
- name: CR_REGION | ||
value: eu-west | ||
- name: CR_EXTERNAL_ID | ||
value: 11111111-1111-1111-1111-111111111111 | ||
- name: PORT | ||
value: "8000" | ||
- name: BROKER_CLIENT_URL | ||
value: http://container-registry-agent-broker-service-RELEASE-NAME:8000 | ||
- name: BROKER_CLIENT_VALIDATION_URL | ||
value: http://cra-service-RELEASE-NAME:8081/healthcheck | ||
- name: LOG_LEVEL | ||
value: info | ||
- name: LOG_ENABLE_BODY | ||
value: "false" | ||
- name: BROKER_DISPATCHER_BASE_URL | ||
value: https://api.test.snyk.io | ||
image: snyk/broker:container-registry-agent | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /healthcheck | ||
port: 8000 | ||
scheme: HTTP | ||
initialDelaySeconds: 3 | ||
periodSeconds: 10 | ||
timeoutSeconds: 1 | ||
name: container-registry-agent-broker-RELEASE-NAME | ||
ports: | ||
- containerPort: 8000 | ||
name: http | ||
readinessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /healthcheck | ||
port: 8000 | ||
scheme: HTTP | ||
initialDelaySeconds: 3 | ||
periodSeconds: 10 | ||
timeoutSeconds: 1 | ||
resources: | ||
limits: | ||
cpu: 1 | ||
memory: 256Mi | ||
requests: | ||
cpu: 1 | ||
memory: 256Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
runAsUser: 1000 | ||
volumeMounts: null | ||
nodeSelector: | ||
corp.io/node-classification: snyk | ||
securityContext: {} | ||
serviceAccountName: snyk-broker-RELEASE-NAME | ||
tolerations: | ||
- effect: NoSchedule | ||
key: networking/something | ||
operator: Equal | ||
value: internal-pods | ||
volumes: null | ||
2: | | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/name: RELEASE-NAME-cr-RELEASE-NAME | ||
name: container-registry-agent-cra-RELEASE-NAME | ||
namespace: NAMESPACE | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/name: RELEASE-NAME-cr-RELEASE-NAME | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/name: RELEASE-NAME-cr-RELEASE-NAME | ||
spec: | ||
containers: | ||
- env: | ||
- name: SNYK_PORT | ||
value: "8081" | ||
image: snyk/container-registry-agent:latest | ||
imagePullPolicy: Always | ||
name: container-registry-agent-RELEASE-NAME | ||
ports: | ||
- containerPort: 8081 | ||
name: http | ||
resources: | ||
limits: | ||
cpu: 1 | ||
memory: 2Gi | ||
requests: | ||
cpu: 1 | ||
memory: 2Gi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: false | ||
runAsNonRoot: true | ||
runAsUser: 1000 | ||
nodeSelector: | ||
corp.io/node-classification: snyk | ||
securityContext: {} | ||
serviceAccountName: snyk-broker-RELEASE-NAME | ||
tolerations: | ||
- effect: NoSchedule | ||
key: networking/something | ||
operator: Equal | ||
value: internal-pods | ||
3: | | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: snyk-broker-RELEASE-NAME | ||
helm.sh/chart: snyk-broker-0.0.0 | ||
name: cra-service-RELEASE-NAME | ||
namespace: NAMESPACE | ||
spec: | ||
ports: | ||
- port: 8081 | ||
targetPort: 8081 | ||
selector: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/name: RELEASE-NAME-cr-RELEASE-NAME | ||
type: ClusterIP |
14 changes: 14 additions & 0 deletions
14
charts/snyk-broker/tests/broker_cra_deployment_extraPodSpecs_test.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,14 @@ | ||
suite: test broker deployment with extraPodSpec | ||
chart: | ||
version: 0.0.0 | ||
templates: | ||
- broker_deployment.yaml | ||
- cra_deployment.yaml | ||
|
||
tests: | ||
- it: renders extraPodSpecs CRA | ||
values: | ||
- ./fixtures/default_values_cra.yaml | ||
- ./fixtures/extra_pod_spec_values.yaml | ||
asserts: | ||
- matchSnapshot: {} |
18 changes: 18 additions & 0 deletions
18
charts/snyk-broker/tests/fixtures/extra_pod_spec_values.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,18 @@ | ||
|
||
extraPodSpecs: | ||
tolerations: | ||
- key: "networking/something" | ||
operator: "Equal" | ||
value: "internal-pods" | ||
effect: "NoSchedule" | ||
nodeSelector: | ||
corp.io/node-classification: snyk | ||
|
||
extraPodSpecsCr: | ||
tolerations: | ||
- key: "networking/something" | ||
operator: "Equal" | ||
value: "internal-pods" | ||
effect: "NoSchedule" | ||
nodeSelector: | ||
corp.io/node-classification: snyk |