Skip to content
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

cleanup: Move common files to deploy folder #3860

Merged
merged 2 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/deploy-cephfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ for more information.
**Deploy Ceph configuration ConfigMap for CSI pods:**

```bash
kubectl create -f ../../../examples/ceph-conf.yaml
kubectl create -f ../../ceph-conf.yaml
```

**Deploy CSI sidecar containers:**
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy-rbd.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ for more information.
**Deploy Ceph configuration ConfigMap for CSI pods:**

```bash
kubectl create -f ../example/ceph-config.yaml
kubectl create -f ../../ceph-conf.yaml
```

**Deploy CSI sidecar containers:**
Expand Down
2 changes: 1 addition & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ csi_liveness 1
```

Promethues can be deployed through the promethues operator described [here](https://coreos.com/operators/prometheus/docs/latest/user-guides/getting-started.html).
The [service-monitor](../examples/service-monitor.yaml) will tell promethues how
The [service-monitor](../deploy/service-monitor.yaml) will tell promethues how
to pull metrics out of CSI.

Each CSI pod has a service to expose the endpoint to prometheus. By default, rbd
Expand Down
3 changes: 2 additions & 1 deletion e2e/cephfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ func deleteCephfsPlugin() {
}

func createORDeleteCephfsResources(action kubectlAction) {
cephConfigFile := getConfigFile(cephConfconfigMap, deployPath, examplePath)
resources := []ResourceDeployer{
// shared resources
&yamlResource{
filename: cephFSDirPath + csiDriverObject,
allowMissing: true,
},
&yamlResource{
filename: examplePath + cephConfconfigMap,
filename: cephConfigFile,
allowMissing: true,
},
// dependencies for provisioner
Expand Down
3 changes: 2 additions & 1 deletion e2e/nfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ func deleteNFSPlugin() {
}

func createORDeleteNFSResources(f *framework.Framework, action kubectlAction) {
cephConfigFile := getConfigFile(cephConfconfigMap, deployPath, examplePath)
resources := []ResourceDeployer{
// shared resources
&yamlResource{
filename: nfsDirPath + csiDriverObject,
allowMissing: true,
},
&yamlResource{
filename: examplePath + cephConfconfigMap,
filename: cephConfigFile,
allowMissing: true,
},
// dependencies for provisioner
Expand Down
6 changes: 4 additions & 2 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ var (
configMap = "csi-config-map.yaml"
cephConfconfigMap = "ceph-conf.yaml"
csiDriverObject = "csidriver.yaml"
rbdDirPath = "../deploy/rbd/kubernetes/"
deployPath = "../deploy/"
rbdDirPath = deployPath + "/rbd/kubernetes/"
examplePath = "../examples/"
rbdExamplePath = examplePath + "/rbd/"
e2eTemplatesPath = "../e2e/templates/"
Expand Down Expand Up @@ -129,14 +130,15 @@ func deleteRBDPlugin() {
}

func createORDeleteRbdResources(action kubectlAction) {
cephConfigFile := getConfigFile(cephConfconfigMap, deployPath, examplePath)
resources := []ResourceDeployer{
// shared resources
&yamlResource{
filename: rbdDirPath + csiDriverObject,
allowMissing: true,
},
&yamlResource{
filename: examplePath + cephConfconfigMap,
filename: cephConfigFile,
allowMissing: true,
},
// dependencies for provisioner
Expand Down
11 changes: 11 additions & 0 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1732,3 +1732,14 @@ func rwopMayFail(err error) bool {

return !rwopSupported
}

// getConfigFile returns the config file path at the preferred location if it
// exists there. Returns the fallback location otherwise.
func getConfigFile(filename, preferred, fallback string) string {
configFile := preferred + filename
if _, err := os.Stat(configFile); os.IsNotExist(err) {
configFile = fallback + filename
}

return configFile
}
12 changes: 6 additions & 6 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

## Deploying Ceph-CSI services

Create [ceph-config](./ceph-conf.yaml) configmap using the following command.
Create [ceph-config](../deploy/ceph-conf.yaml) configmap using the following command.

```bash
kubectl apply -f ./ceph-conf.yaml
kubectl apply -f ../deploy/ceph-conf.yaml
```

Both `rbd` and `cephfs` directories contain `plugin-deploy.sh` and
`plugin-teardown.sh` helper scripts. You can use those to help you
deploy/teardown RBACs, sidecar containers and the plugin in one go.
By default, they look for the YAML manifests in
`../../deploy/{rbd,cephfs}/kubernetes`.
`../deploy/{rbd,cephfs}/kubernetes`.
You can override this path by running

```bash
Expand All @@ -25,7 +25,7 @@ The CSI plugin requires configuration information regarding the Ceph cluster(s),
that would host the dynamically or statically provisioned volumes. This
is provided by adding a per-cluster identifier (referred to as clusterID), and
the required monitor details for the same, as in the provided [sample config
map](./csi-config-map-sample.yaml).
map](../deploy/csi-config-map-sample.yaml).

Gather the following information from the Ceph cluster(s) of choice,

Expand All @@ -38,13 +38,13 @@ Gather the following information from the Ceph cluster(s) of choice,
* Alternatively, choose a `<cluster-id>` value that is distinct per Ceph
cluster in use by this kubernetes cluster

Update the [sample configmap](./csi-config-map-sample.yaml) with values
Update the [sample configmap](../deploy/csi-config-map-sample.yaml) with values
from a Ceph cluster and replace `<cluster-id>` with the chosen clusterID, to
create the manifest for the configmap which can be updated in the cluster
using the following command,

```bash
kubectl replace -f ./csi-config-map-sample.yaml
kubectl replace -f ../deploy/csi-config-map-sample.yaml
```

Storage class and snapshot class, using `<cluster-id>` as the value for the
Expand Down