generated from SAP/repository-template
-
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.
Merge pull request #11 from SAP/helm-tests
Helm tests
- Loading branch information
Showing
3 changed files
with
141 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
namespace: kube-system | ||
name: coredns | ||
data: | ||
Corefile: | | ||
.:53 { | ||
errors | ||
health { | ||
lameduck 5s | ||
} | ||
ready | ||
kubernetes cluster.local in-addr.arpa ip6.arpa { | ||
pods insecure | ||
fallthrough in-addr.arpa ip6.arpa | ||
ttl 30 | ||
} | ||
prometheus :9153 | ||
forward . /etc/resolv.conf { | ||
max_concurrent 1000 | ||
} | ||
cache 30 | ||
loop | ||
reload | ||
loadbalance | ||
import custom/*.override | ||
} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
namespace: kube-system | ||
name: coredns | ||
spec: | ||
selector: | ||
matchLabels: | ||
k8s-app: kube-dns | ||
template: | ||
spec: | ||
containers: | ||
- name: coredns | ||
volumeMounts: | ||
- mountPath: /etc/coredns/custom | ||
name: custom-config-volume | ||
readOnly: true | ||
volumes: | ||
- name: custom-config-volume | ||
configMap: | ||
defaultMode: 420 | ||
name: coredns-custom | ||
optional: true |
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,50 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "dns-masquerading-operator.fullname" . }}-test | ||
labels: | ||
{{- include "dns-masquerading-operator.labels" . | nindent 4 }} | ||
annotations: | ||
helm.sh/hook: test | ||
helm.sh/hook-weight: "-1" | ||
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "dns-masquerading-operator.fullname" . }}-test | ||
labels: | ||
{{- include "dns-masquerading-operator.labels" . | nindent 4 }} | ||
annotations: | ||
helm.sh/hook: test | ||
helm.sh/hook-weight: "-1" | ||
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded | ||
rules: | ||
- apiGroups: | ||
- dns.cs.sap.com | ||
resources: | ||
- masqueradingrules | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "dns-masquerading-operator.fullname" . }}-test | ||
labels: | ||
{{- include "dns-masquerading-operator.labels" . | nindent 4 }} | ||
annotations: | ||
helm.sh/hook: test | ||
helm.sh/hook-weight: "-1" | ||
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded | ||
subjects: | ||
- kind: ServiceAccount | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ include "dns-masquerading-operator.fullname" . }}-test | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ include "dns-masquerading-operator.fullname" . }}-test |
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,38 @@ | ||
{{- $ruleName := printf "%s-test-1-%s" (include "dns-masquerading-operator.fullname" .) (randAlphaNum 10 | lower) }} | ||
--- | ||
apiVersion: dns.cs.sap.com/v1alpha1 | ||
kind: MasqueradingRule | ||
metadata: | ||
name: {{ $ruleName }} | ||
labels: | ||
{{- include "dns-masquerading-operator.labels" . | nindent 4 }} | ||
annotations: | ||
helm.sh/hook: test | ||
helm.sh/hook-weight: "0" | ||
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded | ||
spec: | ||
from: test1.example.io | ||
to: 8.8.8.8 | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ include "dns-masquerading-operator.fullname" . }}-test-1 | ||
labels: | ||
{{- include "dns-masquerading-operator.labels" . | nindent 4 }} | ||
annotations: | ||
helm.sh/hook: test | ||
helm.sh/hook-weight: "1" | ||
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded | ||
spec: | ||
containers: | ||
- name: kubectl | ||
image: bitnami/kubectl:{{ .Capabilities.KubeVersion.Version | trimPrefix "v" }} | ||
command: | ||
- bash | ||
- -ec | ||
- | | ||
kubectl wait masqueradingrules.dns.cs.sap.com/{{ $ruleName }} --for condition=Ready --timeout 120s | ||
serviceAccountName: {{ include "dns-masquerading-operator.fullname" . }}-test | ||
terminationGracePeriodSeconds: 3 | ||
restartPolicy: Never |