must-gatherer.yaml
· 2.2 KiB · YAML
原始檔案
kind: Project
apiVersion: project.openshift.io/v1
metadata:
name: must-gather
spec: {}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: must-gather-admin
namespace: must-gather
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: must-gather-cluster-admin
subjects:
- kind: ServiceAccount
name: must-gather-admin
namespace: must-gather
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
---
kind: ConfigMap
apiVersion: v1
metadata:
name: blank-httpd-conf
namespace: must-gather
data:
blank: '#'
---
kind: Service
apiVersion: v1
metadata:
name: must-gather-service
namespace: must-gather
spec:
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP
selector:
job: must-gather
---
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: must-gather-route
namespace: must-gather
spec:
to:
kind: Service
name: must-gather-service
tls:
termination: edge
wildcardPolicy: None
---
apiVersion: v1
kind: Pod
metadata:
name: must-gatherer
labels:
job: must-gather
namespace: must-gather
spec:
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
serviceAccount: must-gather-admin
volumes:
- name: storage
emptyDir: {}
- name: blank-welcome-conf
configMap:
name: blank-httpd-conf
items:
- key: blank
path: welcome.conf
initContainers:
- name: oc-cli
image: 'registry.redhat.io/openshift4/ose-cli-rhel9:latest'
securityContext: {}
command:
- '/bin/bash'
- '-c'
- 'mkdir -p /storage/html && oc adm must-gather --dest-dir=/storage/html && tar -czvf /storage/html/must-gather.tar.gz /storage/html/*'
volumeMounts:
- mountPath: /storage
name: storage
containers:
- name: httpd
image: 'registry.access.redhat.com/ubi9/httpd-24:9.8-1788412240'
ports:
- containerPort: 8080
volumeMounts:
- mountPath: /var/www
name: storage
- mountPath: /etc/httpd/conf.d/welcome.conf
name: blank-welcome-conf
subPath: welcome.conf
| 1 | kind: Project |
| 2 | apiVersion: project.openshift.io/v1 |
| 3 | metadata: |
| 4 | name: must-gather |
| 5 | spec: {} |
| 6 | --- |
| 7 | apiVersion: v1 |
| 8 | kind: ServiceAccount |
| 9 | metadata: |
| 10 | name: must-gather-admin |
| 11 | namespace: must-gather |
| 12 | --- |
| 13 | kind: ClusterRoleBinding |
| 14 | apiVersion: rbac.authorization.k8s.io/v1 |
| 15 | metadata: |
| 16 | name: must-gather-cluster-admin |
| 17 | subjects: |
| 18 | - kind: ServiceAccount |
| 19 | name: must-gather-admin |
| 20 | namespace: must-gather |
| 21 | roleRef: |
| 22 | apiGroup: rbac.authorization.k8s.io |
| 23 | kind: ClusterRole |
| 24 | name: cluster-admin |
| 25 | --- |
| 26 | kind: ConfigMap |
| 27 | apiVersion: v1 |
| 28 | metadata: |
| 29 | name: blank-httpd-conf |
| 30 | namespace: must-gather |
| 31 | data: |
| 32 | blank: '#' |
| 33 | --- |
| 34 | kind: Service |
| 35 | apiVersion: v1 |
| 36 | metadata: |
| 37 | name: must-gather-service |
| 38 | namespace: must-gather |
| 39 | spec: |
| 40 | ports: |
| 41 | - protocol: TCP |
| 42 | port: 80 |
| 43 | targetPort: 8080 |
| 44 | type: ClusterIP |
| 45 | selector: |
| 46 | job: must-gather |
| 47 | --- |
| 48 | kind: Route |
| 49 | apiVersion: route.openshift.io/v1 |
| 50 | metadata: |
| 51 | name: must-gather-route |
| 52 | namespace: must-gather |
| 53 | spec: |
| 54 | to: |
| 55 | kind: Service |
| 56 | name: must-gather-service |
| 57 | tls: |
| 58 | termination: edge |
| 59 | wildcardPolicy: None |
| 60 | --- |
| 61 | apiVersion: v1 |
| 62 | kind: Pod |
| 63 | metadata: |
| 64 | name: must-gatherer |
| 65 | labels: |
| 66 | job: must-gather |
| 67 | namespace: must-gather |
| 68 | spec: |
| 69 | securityContext: |
| 70 | runAsNonRoot: true |
| 71 | seccompProfile: |
| 72 | type: RuntimeDefault |
| 73 | serviceAccount: must-gather-admin |
| 74 | volumes: |
| 75 | - name: storage |
| 76 | emptyDir: {} |
| 77 | - name: blank-welcome-conf |
| 78 | configMap: |
| 79 | name: blank-httpd-conf |
| 80 | items: |
| 81 | - key: blank |
| 82 | path: welcome.conf |
| 83 | initContainers: |
| 84 | - name: oc-cli |
| 85 | image: 'registry.redhat.io/openshift4/ose-cli-rhel9:latest' |
| 86 | securityContext: {} |
| 87 | command: |
| 88 | - '/bin/bash' |
| 89 | - '-c' |
| 90 | - 'mkdir -p /storage/html && oc adm must-gather --dest-dir=/storage/html && tar -czvf /storage/html/must-gather.tar.gz /storage/html/*' |
| 91 | volumeMounts: |
| 92 | - mountPath: /storage |
| 93 | name: storage |
| 94 | containers: |
| 95 | - name: httpd |
| 96 | image: 'registry.access.redhat.com/ubi9/httpd-24:9.8-1788412240' |
| 97 | ports: |
| 98 | - containerPort: 8080 |
| 99 | volumeMounts: |
| 100 | - mountPath: /var/www |
| 101 | name: storage |
| 102 | - mountPath: /etc/httpd/conf.d/welcome.conf |
| 103 | name: blank-welcome-conf |
| 104 | subPath: welcome.conf |