-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy MinIO/NFS on ctrl node for stability #2173
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,112 @@ | ||||||
apiVersion: v1 | ||||||
kind: Secret | ||||||
metadata: | ||||||
name: minio-secret | ||||||
namespace: default | ||||||
type: Opaque | ||||||
data: | ||||||
AWS_ACCESS_KEY_ID: bG9uZ2hvcm4tdGVzdC1hY2Nlc3Mta2V5 # longhorn-test-access-key | ||||||
AWS_SECRET_ACCESS_KEY: bG9uZ2hvcm4tdGVzdC1zZWNyZXQta2V5 # longhorn-test-secret-key | ||||||
AWS_ENDPOINTS: aHR0cHM6Ly9taW5pby1zZXJ2aWNlLmRlZmF1bHQ6OTAwMA== # https://minio-service.default:9000 | ||||||
AWS_CERT: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMRENDQWhTZ0F3SUJBZ0lSQU1kbzQycGhUZXlrMTcvYkxyWjVZRHN3RFFZSktvWklodmNOQVFFTEJRQXcKR2pFWU1CWUdBMVVFQ2hNUFRHOXVaMmh2Y200Z0xTQlVaWE4wTUNBWERUSXdNRFF5TnpJek1EQXhNVm9ZRHpJeApNakF3TkRBek1qTXdNREV4V2pBYU1SZ3dGZ1lEVlFRS0V3OU1iMjVuYUc5eWJpQXRJRlJsYzNRd2dnRWlNQTBHCkNTcUdTSWIzRFFFQkFRVUFBNElCRHdBd2dnRUtBb0lCQVFEWHpVdXJnUFpEZ3pUM0RZdWFlYmdld3Fvd2RlQUQKODRWWWF6ZlN1USs3K21Oa2lpUVBvelVVMmZvUWFGL1BxekJiUW1lZ29hT3l5NVhqM1VFeG1Gc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pyTDQ3YTlPanZ0Yy81S2ZxSjFpMkpKTUgyQi9jbU1WRSs4M2dpODFIU1FqMWErNnBjektmQVppZWcwRk9nL015ClB6VlZRYmpKTnY0QzM5KzdxSDg1WGdZTXZhcTJ0aDFEZWUvQ3NsMlM4QlV0cW5mc0VuMUYwcWhlWUJZb2RibHAKV3RUaE5oRi9oRVhzbkJROURyWkJKT1U9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K | ||||||
--- | ||||||
# same secret for longhorn-system namespace | ||||||
apiVersion: v1 | ||||||
kind: Secret | ||||||
metadata: | ||||||
name: minio-secret | ||||||
namespace: longhorn-system | ||||||
type: Opaque | ||||||
data: | ||||||
AWS_ACCESS_KEY_ID: bG9uZ2hvcm4tdGVzdC1hY2Nlc3Mta2V5 # longhorn-test-access-key | ||||||
AWS_SECRET_ACCESS_KEY: bG9uZ2hvcm4tdGVzdC1zZWNyZXQta2V5 # longhorn-test-secret-key | ||||||
AWS_ENDPOINTS: aHR0cHM6Ly9taW5pby1zZXJ2aWNlLmRlZmF1bHQ6OTAwMA== # https://minio-service.default:9000 | ||||||
AWS_CERT: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMRENDQWhTZ0F3SUJBZ0lSQU1kbzQycGhUZXlrMTcvYkxyWjVZRHN3RFFZSktvWklodmNOQVFFTEJRQXcKR2pFWU1CWUdBMVVFQ2hNUFRHOXVaMmh2Y200Z0xTQlVaWE4wTUNBWERUSXdNRFF5TnpJek1EQXhNVm9ZRHpJeApNakF3TkRBek1qTXdNREV4V2pBYU1SZ3dGZ1lEVlFRS0V3OU1iMjVuYUc5eWJpQXRJRlJsYzNRd2dnRWlNQTBHCkNTcUdTSWIzRFFFQkFRVUFBNElCRHdBd2dnRUtBb0lCQVFEWHpVdXJnUFpEZ3pUM0RZdWFlYmdld3Fvd2RlQUQKODRWWWF6ZlN1USs3K21Oa2lpUVBvelVVMmZvUWFGL1BxekJiUW1lZ29hT3l5NVhqM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gotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t | ||||||
--- | ||||||
apiVersion: apps/v1 | ||||||
kind: Deployment | ||||||
metadata: | ||||||
name: longhorn-test-minio | ||||||
namespace: default | ||||||
labels: | ||||||
app: longhorn-test-minio | ||||||
spec: | ||||||
replicas: 1 | ||||||
selector: | ||||||
matchLabels: | ||||||
app: longhorn-test-minio | ||||||
template: | ||||||
metadata: | ||||||
labels: | ||||||
app: longhorn-test-minio | ||||||
spec: | ||||||
nodeSelector: | ||||||
node-role.kubernetes.io/control-plane: "true" | ||||||
tolerations: | ||||||
- key: "node-role.kubernetes.io/master" | ||||||
operator: "Exists" | ||||||
effect: "NoSchedule" | ||||||
- key: "node-role.kubernetes.io/master" | ||||||
operator: "Exists" | ||||||
effect: "NoExecute" | ||||||
- key: "node-role.kubernetes.io/control-plane" | ||||||
operator: "Exists" | ||||||
effect: "NoSchedule" | ||||||
- key: "node-role.kubernetes.io/control-plane" | ||||||
operator: "Exists" | ||||||
effect: "NoExecute" | ||||||
- key: "node-role.kubernetes.io/etcd" | ||||||
operator: "Exists" | ||||||
effect: "NoSchedule" | ||||||
- key: "node-role.kubernetes.io/etcd" | ||||||
operator: "Exists" | ||||||
effect: "NoExecute" | ||||||
volumes: | ||||||
- name: minio-volume | ||||||
emptyDir: {} | ||||||
Comment on lines
+66
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using persistent storage for MinIO data Using Consider using a PersistentVolume: volumes:
- name: minio-volume
- emptyDir: {}
+ persistentVolumeClaim:
+ claimName: longhorn-test-minio-pvc
|
||||||
- name: minio-certificates | ||||||
secret: | ||||||
secretName: minio-secret | ||||||
items: | ||||||
- key: AWS_CERT | ||||||
path: public.crt | ||||||
- key: AWS_CERT_KEY | ||||||
path: private.key | ||||||
containers: | ||||||
- name: minio | ||||||
image: minio/minio:RELEASE.2022-02-01T18-00-14Z | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update MinIO image to latest stable version The current MinIO version (RELEASE.2022-02-01T18-00-14Z) is outdated and may have security vulnerabilities. Consider updating to the latest stable version: - image: minio/minio:RELEASE.2022-02-01T18-00-14Z
+ image: minio/minio:RELEASE.2024-01-16T16-07-38Z 📝 Committable suggestion
Suggested change
|
||||||
command: ["sh", "-c", "mkdir -p /storage/backupbucket && mkdir -p /root/.minio/certs && ln -s /root/certs/private.key /root/.minio/certs/private.key && ln -s /root/certs/public.crt /root/.minio/certs/public.crt && exec minio server /storage"] | ||||||
env: | ||||||
- name: MINIO_ROOT_USER | ||||||
valueFrom: | ||||||
secretKeyRef: | ||||||
name: minio-secret | ||||||
key: AWS_ACCESS_KEY_ID | ||||||
- name: MINIO_ROOT_PASSWORD | ||||||
valueFrom: | ||||||
secretKeyRef: | ||||||
name: minio-secret | ||||||
key: AWS_SECRET_ACCESS_KEY | ||||||
ports: | ||||||
- containerPort: 9000 | ||||||
volumeMounts: | ||||||
- name: minio-volume | ||||||
mountPath: "/storage" | ||||||
- name: minio-certificates | ||||||
mountPath: "/root/certs" | ||||||
readOnly: true | ||||||
--- | ||||||
apiVersion: v1 | ||||||
kind: Service | ||||||
metadata: | ||||||
name: minio-service | ||||||
namespace: default | ||||||
spec: | ||||||
selector: | ||||||
app: longhorn-test-minio | ||||||
ports: | ||||||
- port: 9000 | ||||||
targetPort: 9000 | ||||||
protocol: TCP | ||||||
sessionAffinity: ClientIP |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: longhorn-test-nfs | ||
namespace: default | ||
labels: | ||
app: longhorn-test-nfs | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: longhorn-test-nfs | ||
template: | ||
metadata: | ||
labels: | ||
app: longhorn-test-nfs | ||
spec: | ||
nodeSelector: | ||
node-role.kubernetes.io/control-plane: "true" | ||
tolerations: | ||
- key: "node-role.kubernetes.io/master" | ||
operator: "Exists" | ||
effect: "NoSchedule" | ||
- key: "node-role.kubernetes.io/master" | ||
operator: "Exists" | ||
effect: "NoExecute" | ||
- key: "node-role.kubernetes.io/control-plane" | ||
operator: "Exists" | ||
effect: "NoSchedule" | ||
- key: "node-role.kubernetes.io/control-plane" | ||
operator: "Exists" | ||
effect: "NoExecute" | ||
- key: "node-role.kubernetes.io/etcd" | ||
operator: "Exists" | ||
effect: "NoSchedule" | ||
- key: "node-role.kubernetes.io/etcd" | ||
operator: "Exists" | ||
effect: "NoExecute" | ||
volumes: | ||
- name: nfs-volume | ||
emptyDir: {} | ||
Comment on lines
+38
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using persistent storage instead of emptyDir Using Consider using a PersistentVolume for the backup store: volumes:
- name: nfs-volume
- emptyDir: {}
+ persistentVolumeClaim:
+ claimName: longhorn-test-nfs-pvc
|
||
containers: | ||
- name: longhorn-test-nfs-container | ||
image: longhornio/nfs-ganesha:latest | ||
imagePullPolicy: Always | ||
Comment on lines
+42
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid using 'latest' image tag Using the Specify a fixed version: - image: longhornio/nfs-ganesha:latest
+ image: longhornio/nfs-ganesha:v1.0.0 # Replace with appropriate version
|
||
env: | ||
- name: EXPORT_ID | ||
value: "14" | ||
- name: EXPORT_PATH | ||
value: /opt/backupstore | ||
- name: PSEUDO_PATH | ||
value: /opt/backupstore | ||
- name: NFS_DISK_IMAGE_SIZE_MB | ||
value: "4096" | ||
command: ["bash", "-c", "chmod 700 /opt/backupstore && /opt/start_nfs.sh | tee /var/log/ganesha.log"] | ||
securityContext: | ||
privileged: true | ||
capabilities: | ||
add: ["SYS_ADMIN", "DAC_READ_SEARCH"] | ||
volumeMounts: | ||
- name: nfs-volume | ||
mountPath: "/opt/backupstore" | ||
livenessProbe: | ||
exec: | ||
command: ["bash", "-c", "grep \"No export entries found\" /var/log/ganesha.log > /dev/null 2>&1 ; [ $? -ne 0 ]"] | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 | ||
timeoutSeconds: 4 | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: longhorn-test-nfs-svc | ||
namespace: default | ||
spec: | ||
selector: | ||
app: longhorn-test-nfs | ||
clusterIP: None | ||
ports: | ||
- name: notnecessary | ||
port: 1234 | ||
targetPort: 1234 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
install_backupstores(){ | ||
MINIO_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/minio-backupstore.yaml" | ||
NFS_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/nfs-backupstore.yaml" | ||
MINIO_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/minio-backupstore.yaml" | ||
NFS_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/nfs-backupstore.yaml" | ||
kubectl create -f ${MINIO_BACKUPSTORE_URL} \ | ||
-f ${NFS_BACKUPSTORE_URL} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove decoded values from comments
The comments contain the decoded values of the secrets, which poses a security risk if the YAML file is exposed.
Remove the comments containing decoded values:
📝 Committable suggestion
🧰 Tools
🪛 Gitleaks (8.21.2)
8-8: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
9-9: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)