-
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 ssh-key and ssh-user flags to CLI to specify a key/user to SSH to containers in the cluster. - Use k8s secrets to store the secret then mount into the containers - Specify env vars so different cloud providers can find the key at the intended location. Fixes: #536 Signed-off-by: John Schnake <[email protected]>
- Loading branch information
1 parent
c14a483
commit e87e9bb
Showing
8 changed files
with
308 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
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
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,168 @@ | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
component: sonobuoy | ||
name: sonobuoy-serviceaccount | ||
namespace: | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: ssh-key | ||
namespace: | ||
type: Opaque | ||
data: | ||
id_rsa: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlDV2dJQkFBS0JnR2gzQ3k2S01SUVhrb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ZCS1RJTS9vCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg== | ||
--- | ||
apiVersion: v1 | ||
data: | ||
config.json: | | ||
{"Description":"","UUID":"","Version":"","ResultsDir":"","Resources":null,"Filters":{"Namespaces":"","LabelSelector":""},"Limits":{"PodLogs":{"LimitSize":"","LimitTime":""}},"Server":{"bindaddress":"","bindport":0,"advertiseaddress":"","timeoutseconds":0},"Plugins":null,"PluginSearchPath":null,"Namespace":"","LoadedPlugins":null,"WorkerImage":"","ImagePullPolicy":""} | ||
kind: ConfigMap | ||
metadata: | ||
labels: | ||
component: sonobuoy | ||
name: sonobuoy-config-cm | ||
namespace: | ||
--- | ||
apiVersion: v1 | ||
data: | ||
e2e.yaml: | | ||
sonobuoy-config: | ||
driver: Job | ||
plugin-name: e2e | ||
result-type: e2e | ||
spec: | ||
env: | ||
- name: E2E_FOCUS | ||
value: '' | ||
- name: E2E_SKIP | ||
value: '' | ||
- name: E2E_PARALLEL | ||
value: '' | ||
- name: LOCAL_SSH_KEY | ||
value: 'id_rsa' | ||
- name: AWS_SSH_KEY | ||
value: '/root/.ssh/id_rsa' | ||
- name: KUBE_SSH_KEY | ||
value: 'id_rsa' | ||
- name: KUBE_SSH_USER | ||
value: ssh-user | ||
command: ["/run_e2e.sh"] | ||
image: | ||
imagePullPolicy: | ||
name: e2e | ||
volumeMounts: | ||
- mountPath: /tmp/results | ||
name: results | ||
readOnly: false | ||
- mountPath: /root/.ssh | ||
name: sshkey-vol | ||
tolerations: | ||
- operator: "Exists" | ||
extra-volumes: | ||
- name: sshkey-vol | ||
secret: | ||
secretName: ssh-key | ||
defaultMode: 256 | ||
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: | ||
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: | ||
--- | ||
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 |
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,15 @@ | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIICWgIBAAKBgGh3Cy6KMRQXkmYQDZX26K5F/jP0PVOGTl4zjLegWwqfSkzqV69t | ||
S2Z//HQfaBGVZAUFZuL9F8tFibLahwAMZ2/8U0+bBONcwgOFyvewxXjpCN1GRJ/t | ||
1mvCsnpv69GGf1CJgvQOWmdIEYbRquYdkeDChOXJD/XKzIK0xb/gzaXzAgMBAAEC | ||
gYA1syQrW1xZQLjAAHaLZW48z7wZxu6TdhHo+MTYS/Ug47tVCI3knuFIongK1W4w | ||
w8OzlRBLlODbXDapmw4Up0uwLC3lSABmqEMRyvN37wI2QOKzPnZtUSUl6PIuTLSM | ||
pW6xROsBqFoSkSrGmYdy5xRN/toBTPe/w49Bd9uEJ3CEGQJBAKekFrEegaJJ+jsq | ||
nCC0nCV4fAG68JkCUbZeg5DvRy2WXPvJskiiGUEN98PmLs1k2HwGkpviBV/JIQQF | ||
0N+e/8UCQQCfhpRtoS5U9P4VPAHYpk7t6cHo2Bt/ZOYUFAR/LEBZYtkRFYa28Sz8 | ||
SBhhD0+2jfie0sNQXqKShRRqiSz7U3JXAkBCU/AOgC12UqLJCiDf59XoFXWrEZXk | ||
VECUUWzoyWN2LAn6LWF2z3wCe05OmiJmbcIhwE/9kT3jGicP+mUcNUKpAkAvOh5z | ||
HkajLCyUiMFbLFEtqgiYMHJjkrFyvEJgi+85B0SQBDlvq5LP1WAyS+AjgYBbNLZR | ||
8tJaYj+bEqVYemndAkBNGQ5VlR4fKUkd6pFy5nhaIVcA2nqv3yeYlBK3VS/tIGzH | ||
hT73NJEbZ/SYz1HbBeglT+P19jUpDkGrVBKTIM/o | ||
-----END RSA PRIVATE KEY----- |
Oops, something went wrong.