https://github.com/replicatedhq/volume-mount-checker
https://github.com/replicatedhq/volume-mount-checker
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/replicatedhq/volume-mount-checker
- Owner: replicatedhq
- License: apache-2.0
- Created: 2020-09-11T21:15:31.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-17T18:34:10.000Z (3 months ago)
- Last Synced: 2025-03-23T03:33:16.830Z (3 months ago)
- Language: Shell
- Size: 33.2 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# replicatedhq/volume-mount-checker
The replicated/volume-mount-checker image can be run as an init container in a Kubernetes pod to validate CephFilesystem mounts.
## Installation
The following environment variables must be defined:
- **MOUNT_PATH:** Filesystem mount path
- **NAMESPACE:** Kuberenetes pod namespace
- **POD_NAME:** Kuberenetes pod nameAn example Deployment spec:
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-deployment
labels:
app: myapp
spec:
selector:
matchLabels:
app: myapp
template:
spec:
initContainers:
- name: check-mount
image: replicated/volume-mount-checker:latest
env:
- name: MOUNT_PATH
value: /sharedfs
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumeMounts:
- name: rook-shared-fs
mountPath: /sharedfs
readOnly: true
```The replicated/volume-mount-checker container will need permissions to delete its own pod (pods in its own namespace).
An example Role that is needed by the container:
```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pod-deleter
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["delete"]
```## Scanning image prior to release
```
make build scan
```## Releasing
Releases are created when a tag is pushed to the upstream repository. Note that in tagging a release does not cause images to be rebuilt.
```
git tag -a v1.0.0 -m "Release 1.0.0" && git push origin v1.0.0
```