For k8s, use provisioner-managed volumes when an absolute host path is not specified. #741

Merged
telackey merged 8 commits from telackey/autopv into main 2024-02-14 21:45:03 +00:00
Member

In kind, when we bind-mount a host directory it is first mounted into the kind container at /mnt, then into the pod at the desired location.

We accidentally picked this up for full-blown k8s, and were creating volumes at /mnt. This changes the behavior for both kind and regular k8s so that bind mounts are only allowed if a fully-qualified path is specified. If no path is specified at all, a default storageClass is assumed to be present, and the volume managed by a provisioner.

Eg, for kind, the default provisioner is: https://github.com/rancher/local-path-provisioner

stack: test
deploy-to: k8s-kind
config:
  test-variable-1: test-value-1
network:
  ports:
    test:
     - '80'
volumes:
  # this will be bind-mounted to a host-path
  test-data-bind: /srv/data
  # this will be managed by the k8s node
  test-data-auto:
configmaps:
  test-config: ./configmap/test-config
In kind, when we bind-mount a host directory it is first mounted into the kind container at /mnt, then into the pod at the desired location. We accidentally picked this up for full-blown k8s, and were creating volumes at /mnt. This changes the behavior for both kind and regular k8s so that bind mounts are only allowed if a fully-qualified path is specified. If no path is specified at all, a default storageClass is assumed to be present, and the volume managed by a provisioner. Eg, for kind, the default provisioner is: https://github.com/rancher/local-path-provisioner ``` stack: test deploy-to: k8s-kind config: test-variable-1: test-value-1 network: ports: test: - '80' volumes: # this will be bind-mounted to a host-path test-data-bind: /srv/data # this will be managed by the k8s node test-data-auto: configmaps: test-config: ./configmap/test-config ```
telackey added 1 commit 2024-02-14 02:16:23 +00:00
For k8s, use provisioner-managed volumes when an absolute host path is not specified.
Some checks failed
Lint Checks / Run linter (pull_request) Failing after 44s
Deploy Test / Run deploy test suite (pull_request) Failing after 3m37s
Webapp Test / Run webapp test suite (pull_request) Successful in 5m18s
Smoke Test / Run basic test suite (pull_request) Successful in 4m50s
2b535b25db
telackey added 1 commit 2024-02-14 02:22:47 +00:00
plural
Some checks failed
Lint Checks / Run linter (pull_request) Failing after 41s
Deploy Test / Run deploy test suite (pull_request) Failing after 3m50s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m28s
Smoke Test / Run basic test suite (pull_request) Successful in 5m49s
0d59c5d06e
telackey added 1 commit 2024-02-14 02:26:39 +00:00
flake8
Some checks failed
Lint Checks / Run linter (pull_request) Successful in 54s
Deploy Test / Run deploy test suite (pull_request) Failing after 4m19s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m31s
Smoke Test / Run basic test suite (pull_request) Successful in 5m20s
210ec4f1d9
telackey changed title from WIP: For k8s, use provisioner-managed volumes when an absolute host path is not specified. to For k8s, use provisioner-managed volumes when an absolute host path is not specified. 2024-02-14 02:47:12 +00:00
telackey added 1 commit 2024-02-14 02:51:01 +00:00
Fix test
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 40s
Webapp Test / Run webapp test suite (pull_request) Successful in 5m21s
Smoke Test / Run basic test suite (pull_request) Successful in 4m52s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m52s
d82350c040
telackey requested review from dboreham 2024-02-14 02:57:16 +00:00
telackey added 1 commit 2024-02-14 04:20:06 +00:00
Add comment.
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 37s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m14s
Deploy Test / Run deploy test suite (pull_request) Successful in 4m59s
Smoke Test / Run basic test suite (pull_request) Successful in 4m19s
6411f12770
telackey added 1 commit 2024-02-14 21:27:14 +00:00
Honor the --delete-volumes flag.
Some checks failed
Lint Checks / Run linter (pull_request) Failing after 43s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m38s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m29s
Smoke Test / Run basic test suite (pull_request) Successful in 5m18s
88d8bab8b2
telackey added 1 commit 2024-02-14 21:29:19 +00:00
Rename function
Some checks failed
Lint Checks / Run linter (pull_request) Failing after 40s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m3s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m50s
Smoke Test / Run basic test suite (pull_request) Successful in 5m32s
063effeab9
telackey added 1 commit 2024-02-14 21:35:57 +00:00
lint
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 36s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m36s
Webapp Test / Run webapp test suite (pull_request) Successful in 5m6s
Smoke Test / Run basic test suite (pull_request) Successful in 5m11s
eac1cf0246
telackey merged commit b22c72e715 into main 2024-02-14 21:45:03 +00:00
telackey deleted branch telackey/autopv 2024-02-14 21:45:03 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/stack-orchestrator#741
No description provided.