-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simple-worker: 0.1.4 - Synchronize volumes configuration, and update …
…version
- Loading branch information
1 parent
2fed5e5
commit c9f52ff
Showing
10 changed files
with
548 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# helm plugin install https://github.com/helm-unittest/helm-unittest.git | ||
|
||
test: | ||
helm unittest . |
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
82 changes: 82 additions & 0 deletions
82
charts/simple-worker/tests/__snapshot__/simple_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,82 @@ | ||
All manifests should match snapshot: | ||
1: | | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: simple | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: simple-worker | ||
app.kubernetes.io/version: 1.16.0 | ||
helm.sh/chart: simple-worker-0.0.0 | ||
name: simple | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: simple | ||
app.kubernetes.io/name: simple-worker | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: simple | ||
app.kubernetes.io/name: simple-worker | ||
spec: | ||
containers: | ||
- env: | ||
- name: TEST | ||
value: test | ||
image: test:1.1.1 | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
exec: | ||
command: | ||
- echo | ||
- ok | ||
name: simple | ||
readinessProbe: | ||
exec: | ||
command: | ||
- echo | ||
- ok | ||
resources: {} | ||
securityContext: {} | ||
volumeMounts: | ||
- mountPath: /data | ||
name: data | ||
securityContext: {} | ||
serviceAccountName: simple | ||
volumes: | ||
- name: data | ||
persistentVolumeClaim: | ||
claimName: simple-data | ||
2: | | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: simple | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: simple-worker | ||
app.kubernetes.io/version: 1.16.0 | ||
helm.sh/chart: simple-worker-0.0.0 | ||
name: simple-data | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
3: | | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: simple | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: simple-worker | ||
app.kubernetes.io/version: 1.16.0 | ||
helm.sh/chart: simple-worker-0.0.0 | ||
name: simple |
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,21 @@ | ||
# yaml-language-server: $schema=../values.schema.json | ||
|
||
image: | ||
repository: test | ||
tag: 1.1.1 | ||
|
||
port: 9000 | ||
|
||
domain: test.epoch8.co | ||
|
||
ingress: | ||
enabled: true | ||
|
||
env: | ||
- name: TEST | ||
value: test | ||
|
||
volumes: | ||
- name: data | ||
size: 1Gi | ||
mountPath: /data |
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 @@ | ||
suite: simple-app simple case | ||
|
||
values: | ||
- simple-values.yaml | ||
|
||
release: | ||
name: simple | ||
namespace: default | ||
|
||
chart: | ||
version: 0.0.0 | ||
|
||
tests: | ||
- it: All manifests should match snapshot | ||
templates: | ||
- deployment.yaml | ||
- serviceaccount.yaml | ||
- pvc.yaml | ||
asserts: | ||
- matchSnapshot: {} | ||
|
||
- it: Deployment should be named as release | ||
template: deployment.yaml | ||
asserts: | ||
- isKind: | ||
of: Deployment | ||
- equal: | ||
path: metadata.name | ||
value: simple | ||
|
||
- it: Deployment image tag should be set correctly | ||
template: deployment.yaml | ||
asserts: | ||
- isKind: | ||
of: Deployment | ||
- equal: | ||
path: spec.template.spec.containers[0].image | ||
value: test:1.1.1 | ||
|
||
- it: Deployment should use imagePullSecrets if specified | ||
template: deployment.yaml | ||
set: | ||
imagePullSecrets: | ||
- name: test | ||
asserts: | ||
- isKind: | ||
of: Deployment | ||
- equal: | ||
path: spec.template.spec.imagePullSecrets | ||
value: | ||
- name: test | ||
|
||
- it: Deployment should mount shared memory volume if shmMem specified | ||
template: deployment.yaml | ||
set: | ||
shmSize: 1Gi | ||
asserts: | ||
- isKind: | ||
of: Deployment | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[0] | ||
value: | ||
mountPath: /dev/shm | ||
name: shared-memory | ||
- equal: | ||
path: spec.template.spec.volumes[0] | ||
value: | ||
emptyDir: | ||
medium: Memory | ||
sizeLimit: 1Gi | ||
name: shared-memory | ||
|
||
- it: Deployment should have correctly mounted configs | ||
template: deployment.yaml | ||
set: | ||
configs: | ||
- name: test.json | ||
mountPath: /etc/test.json | ||
value: | | ||
{ | ||
"test": "test" | ||
} | ||
- name: test2.json | ||
value: | | ||
{ | ||
"test2": "test2" | ||
} | ||
asserts: | ||
- isKind: | ||
of: Deployment | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[1] | ||
value: | ||
mountPath: /etc/test.json | ||
name: configs | ||
subPath: test.json | ||
readOnly: true | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[2] | ||
value: | ||
mountPath: /configs/test2.json | ||
name: configs | ||
subPath: test2.json | ||
readOnly: true | ||
- contains: | ||
path: spec.template.spec.volumes | ||
content: | ||
configMap: | ||
name: simple | ||
name: configs | ||
|
||
- it: Deployment should have correctly mounted volumes with pvc | ||
template: deployment.yaml | ||
asserts: | ||
- isKind: | ||
of: Deployment | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[0] | ||
value: | ||
mountPath: /data | ||
name: data | ||
- equal: | ||
path: spec.template.spec.volumes[0] | ||
value: | ||
name: data | ||
persistentVolumeClaim: | ||
claimName: simple-data | ||
|
||
- it: Deployment should have correctly mounted volumes without pvc | ||
template: deployment.yaml | ||
set: | ||
volumes: | ||
- name: data | ||
size: 1Gi | ||
mountPath: /data | ||
emptyDir: true | ||
asserts: | ||
- isKind: | ||
of: Deployment | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[0] | ||
value: | ||
mountPath: /data | ||
name: data | ||
- equal: | ||
path: spec.template.spec.volumes[0] | ||
value: | ||
name: data | ||
emptyDir: | ||
sizeLimit: 1Gi | ||
|
||
- it: PVC should not be created if emptyDir | ||
template: pvc.yaml | ||
set: | ||
volumes: | ||
- name: data | ||
size: 1Gi | ||
mountPath: /data | ||
emptyDir: true | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
|
||
- it: PVC should have correctly mounted volumes with pvc | ||
template: pvc.yaml | ||
asserts: | ||
- isKind: | ||
of: PersistentVolumeClaim | ||
- equal: | ||
path: spec.resources.requests.storage | ||
value: 1Gi | ||
|
||
- it: PVC should have correctly mounted volumes without pvc | ||
template: pvc.yaml | ||
set: | ||
volumes: | ||
- name: data | ||
size: 1Gi | ||
mountPath: /data | ||
emptyDir: true | ||
asserts: | ||
- hasDocuments: | ||
count: 0 |
Oops, something went wrong.