-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to override pod spec options (#837)
This change introduces the ability to override PodSpec options for plugins. A new flag `--show-default-podspec` has been added to the `gen` and `gen plugin` commands. When used, Sonobuoy will include the default PodSpec options for the given plugin driver in the resulting yaml. This allows users to change these values or they can provide their own. If one is provided in the plugin definition, Sonobuoy will use that as is, otherwise it will use the default. Signed-off-by: Bridget McErlean <[email protected]>
- Loading branch information
Showing
17 changed files
with
759 additions
and
74 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
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
17 changes: 17 additions & 0 deletions
17
cmd/sonobuoy/app/testdata/pluginDef-default-podspec.golden
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,17 @@ | ||
podSpec: | ||
containers: [] | ||
restartPolicy: Never | ||
serviceAccountName: sonobuoy-serviceaccount | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
operator: Exists | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
sonobuoy-config: | ||
driver: "" | ||
plugin-name: "n" | ||
result-type: "n" | ||
spec: | ||
name: "" | ||
resources: {} |
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
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,164 @@ | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
component: sonobuoy | ||
name: sonobuoy-serviceaccount | ||
namespace: | ||
--- | ||
apiVersion: v1 | ||
data: | ||
config.json: | | ||
{"Description":"","UUID":"","Version":"","ResultsDir":"","Resources":null,"Filters":{"Namespaces":"","LabelSelector":""},"Limits":{"PodLogs":{"Namespaces":"","SonobuoyNamespace":null,"FieldSelectors":null,"LabelSelector":"","Previous":false,"SinceSeconds":null,"SinceTime":null,"Timestamps":false,"TailLines":null,"LimitBytes":null,"LimitSize":"","LimitTime":""}},"Server":{"bindaddress":"","bindport":0,"advertiseaddress":"","timeoutseconds":0},"Plugins":null,"PluginSearchPath":null,"Namespace":"","WorkerImage":"","ImagePullPolicy":"","ImagePullSecrets":""} | ||
kind: ConfigMap | ||
metadata: | ||
labels: | ||
component: sonobuoy | ||
name: sonobuoy-config-cm | ||
namespace: | ||
--- | ||
apiVersion: v1 | ||
data: | ||
plugin-0.yaml: | | ||
podSpec: | ||
containers: [] | ||
restartPolicy: Never | ||
serviceAccountName: sonobuoy-serviceaccount | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
operator: Exists | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
sonobuoy-config: | ||
driver: Job | ||
plugin-name: e2e | ||
result-format: junit | ||
result-type: e2e | ||
spec: | ||
command: | ||
- /run_e2e.sh | ||
env: | ||
- name: E2E_FOCUS | ||
- name: E2E_SKIP | ||
- name: E2E_PARALLEL | ||
name: e2e | ||
resources: {} | ||
volumeMounts: | ||
- mountPath: /tmp/results | ||
name: results | ||
plugin-1.yaml: | | ||
podSpec: | ||
containers: [] | ||
dnsPolicy: ClusterFirstWithHostNet | ||
hostIPC: true | ||
hostNetwork: true | ||
hostPID: true | ||
serviceAccountName: sonobuoy-serviceaccount | ||
tolerations: | ||
- operator: Exists | ||
volumes: | ||
- hostPath: | ||
path: / | ||
name: root | ||
sonobuoy-config: | ||
driver: DaemonSet | ||
plugin-name: systemd-logs | ||
result-format: raw | ||
result-type: systemd-logs | ||
spec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- /get_systemd_logs.sh && sleep 3600 | ||
env: | ||
- name: CHROOT_DIR | ||
value: /node | ||
- name: RESULTS_DIR | ||
value: /tmp/results | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
image: gcr.io/heptio-images/sonobuoy-plugin-systemd-logs:latest | ||
name: systemd-logs | ||
resources: {} | ||
securityContext: | ||
privileged: true | ||
volumeMounts: | ||
- mountPath: /tmp/results | ||
name: results | ||
- mountPath: /node | ||
name: root | ||
kind: ConfigMap | ||
metadata: | ||
labels: | ||
component: sonobuoy | ||
name: sonobuoy-plugins-cm | ||
namespace: | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
component: sonobuoy | ||
run: sonobuoy-master | ||
tier: analysis | ||
name: sonobuoy | ||
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: | ||
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 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
component: sonobuoy | ||
run: sonobuoy-master | ||
name: sonobuoy-master | ||
namespace: | ||
spec: | ||
ports: | ||
- port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
run: sonobuoy-master | ||
type: ClusterIP |
Oops, something went wrong.