-
Notifications
You must be signed in to change notification settings - Fork 442
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
1 parent
434bb5c
commit 116c531
Showing
34 changed files
with
714 additions
and
297 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
{{/* | ||
deployment kind | ||
*/}} | ||
{{- define "vcluster.kind" -}} | ||
{{ if and .Values.embeddedEtcd.enabled .Values.pro }}StatefulSet{{ else }}Deployment{{ end }} | ||
{{- end -}} | ||
|
||
{{/* | ||
service name for statefulset | ||
*/}} | ||
{{- define "vcluster.statefulset.serviceName" }} | ||
{{- if .Values.embeddedEtcd.enabled }} | ||
serviceName: {{ .Release.Name }}-headless | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{/* | ||
volumeClaimTemplate | ||
*/}} | ||
{{- define "vcluster.statefulset.volumeClaimTemplate" }} | ||
{{- if .Values.embeddedEtcd.enabled }} | ||
{{- if .Values.autoDeletePersistentVolumeClaims }} | ||
{{- if ge (int .Capabilities.KubeVersion.Minor) 27 }} | ||
persistentVolumeClaimRetentionPolicy: | ||
whenDeleted: Delete | ||
{{- end }} | ||
{{- end }} | ||
{{- if (hasKey .Values "volumeClaimTemplates") }} | ||
volumeClaimTemplates: | ||
{{ toYaml .Values.volumeClaimTemplates | indent 4 }} | ||
{{- else if .Values.syncer.storage.persistence }} | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: data | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
{{- if .Values.syncer.storage.className }} | ||
storageClassName: {{ .Values.syncer.storage.className }} | ||
{{- end }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.syncer.storage.size }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
deployment strategy | ||
*/}} | ||
{{- define "vcluster.deployment.strategy" }} | ||
{{- if not .Values.embeddedEtcd.enabled }} | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 1 | ||
{{- if (eq (int .Values.syncer.replicas) 1) }} | ||
maxUnavailable: 0 | ||
{{- else }} | ||
maxUnavailable: 1 | ||
{{- end }} | ||
type: RollingUpdate | ||
{{- end }} | ||
{{- end -}} |
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,9 @@ | ||
Add [unittest plugin](https://github.com/helm-unittest/helm-unittest) via: | ||
``` | ||
helm plugin install https://github.com/helm-unittest/helm-unittest.git | ||
``` | ||
|
||
Run tests via: | ||
``` | ||
helm unittest charts/eks -d | ||
``` |
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,41 @@ | ||
suite: ClusterRole | ||
templates: | ||
- rbac/clusterrole.yaml | ||
|
||
tests: | ||
- it: should create clusterrole | ||
set: | ||
rbac: | ||
clusterRole: | ||
create: true | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- it: should not create clusterrole | ||
set: | ||
rbac: | ||
clusterRole: | ||
create: false | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: should contain extra rule | ||
set: | ||
rbac: | ||
clusterRole: | ||
create: true | ||
extraRules: | ||
- apiGroups: ["test"] | ||
resources: ["tests"] | ||
verbs: ["test"] | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- contains: | ||
path: rules | ||
content: | ||
apiGroups: ["test"] | ||
resources: ["tests"] | ||
verbs: ["test"] | ||
count: 1 | ||
|
Oops, something went wrong.