Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Manifest = NewTemplate("manifest", `
---
apiVersion: v1
kind: Namespace
metadata:
name: {{.Namespace}}
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
component: sonobuoy
name: sonobuoy-serviceaccount
namespace: {{.Namespace}}
{{- if .EnableRBAC }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
component: sonobuoy
name: sonobuoy-serviceaccount-{{.Namespace}}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: sonobuoy-serviceaccount
subjects:
- kind: ServiceAccount
name: sonobuoy-serviceaccount
namespace: {{.Namespace}}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
component: sonobuoy
name: sonobuoy-serviceaccount
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '/metrics'
- '/logs'
- '/logs/*'
verbs:
- 'get'
{{- end }}
{{- if .SSHKey }}
---
apiVersion: v1
kind: Secret
metadata:
name: ssh-key
namespace: {{.Namespace}}
type: Opaque
data:
id_rsa: {{.SSHKey}}
{{- end }}
---
apiVersion: v1
data:
config.json: |
{{.SonobuoyConfig}}
kind: ConfigMap
metadata:
labels:
component: sonobuoy
name: sonobuoy-config-cm
namespace: {{.Namespace}}
---
apiVersion: v1
data:
e2e.yaml: |
sonobuoy-config:
driver: Job
plugin-name: e2e
result-type: e2e
spec:
env:
- name: E2E_FOCUS
value: '{{.E2EFocus}}'
- name: E2E_SKIP
value: '{{.E2ESkip}}'
- name: E2E_PARALLEL
value: '{{.E2EParallel}}'
{{- if .CustomRegistries }}
- name: KUBE_TEST_REPO_LIST
value: /tmp/sonobuoy/repo-list.yaml
{{- end}}
{{- if .SSHKey }}
- name: LOCAL_SSH_KEY
value: 'id_rsa'
- name: AWS_SSH_KEY
value: '/root/.ssh/id_rsa'
- name: KUBE_SSH_KEY
value: 'id_rsa'
{{- end}}
{{- if .SSHUser }}
- name: KUBE_SSH_USER
value: {{.SSHUser}}
{{- end}}
command: ["/run_e2e.sh"]
image: {{.KubeConformanceImage}}
imagePullPolicy: {{.ImagePullPolicy}}
name: e2e
volumeMounts:
- mountPath: /tmp/results
name: results
readOnly: false
{{- if .SSHKey }}
- mountPath: /root/.ssh
name: sshkey-vol
{{- end}}
{{- if .CustomRegistries }}
- mountPath: /tmp/sonobuoy
name: repolist-vol
{{- end}}
tolerations:
- operator: "Exists"
{{- if or .SSHKey .CustomRegistries }}
extra-volumes:
{{- end}}
{{- if .SSHKey }}
- name: sshkey-vol
secret:
secretName: ssh-key
defaultMode: 256
{{- end}}
{{- if .CustomRegistries }}
- name: repolist-vol
configMap:
name: repolist-cm
{{- end}}
systemd-logs.yaml: |
sonobuoy-config:
driver: DaemonSet
plugin-name: systemd-logs
result-type: systemd_logs
spec:
command: ["/bin/sh", "-c", "/get_systemd_logs.sh && sleep 3600"]
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: RESULTS_DIR
value: /tmp/results
- name: CHROOT_DIR
value: /node
image: gcr.io/heptio-images/sonobuoy-plugin-systemd-logs:latest
imagePullPolicy: {{.ImagePullPolicy}}
name: sonobuoy-systemd-logs-config
securityContext:
privileged: true
volumeMounts:
- mountPath: /tmp/results
name: results
readOnly: false
- mountPath: /node
name: root
readOnly: false
kind: ConfigMap
metadata:
labels:
component: sonobuoy
name: sonobuoy-plugins-cm
namespace: {{.Namespace}}
---
apiVersion: v1
kind: Pod
metadata:
labels:
component: sonobuoy
run: sonobuoy-master
tier: analysis
name: sonobuoy
namespace: {{.Namespace}}
spec:
containers:
- command:
- /bin/bash
- -c
- /sonobuoy master --no-exit=true -v 3 --logtostderr
env:
- name: SONOBUOY_ADVERTISE_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
image: {{.SonobuoyImage}}
imagePullPolicy: {{.ImagePullPolicy}}
name: kube-sonobuoy
volumeMounts:
- mountPath: /etc/sonobuoy
name: sonobuoy-config-volume
- mountPath: /plugins.d
name: sonobuoy-plugins-volume
- mountPath: /tmp/sonobuoy
name: output-volume
restartPolicy: Never
serviceAccountName: sonobuoy-serviceaccount
volumes:
- configMap:
name: sonobuoy-config-cm
name: sonobuoy-config-volume
- configMap:
name: sonobuoy-plugins-cm
name: sonobuoy-plugins-volume
- emptyDir: {}
name: output-volume
---
{{- if .CustomRegistries }}
apiVersion: v1
data:
repo-list.yaml: |
{{ indent 4 .CustomRegistries }}
kind: ConfigMap
metadata:
name: repolist-cm
namespace: {{.Namespace}}
---
{{- end}}
apiVersion: v1
kind: Service
metadata:
labels:
component: sonobuoy
run: sonobuoy-master
name: sonobuoy-master
namespace: {{.Namespace}}
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
run: sonobuoy-master
type: ClusterIP
`)
Manifest is the template found in examples
View Source
var TemplateFuncs = map[string]interface{}{ "indent": func(i int, input string) string { split := strings.Split(input, "\n") ident := "\n" + strings.Repeat(" ", i) return strings.Join(split, ident) }, }
TemplateFuncs exports (currently singular) functions to be used inside the template
Functions ¶
func NewTemplate ¶
NewTemplate declares a new template that already has TemplateFuncs in scope
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.