forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#46362 from sebgoa/examplesmove
Automatic merge from submit-queue Redirect all files in /examples folder to kubernetes/examples repo **What this PR does / why we need it**: Examples are being moved to their own repository: /~https://github.com/kubernetes/examples We need to remove them from the main repo , but first we need to keep a redirect. This is a *big* organizational change, but nothing technical (aside from e2e tests) **Which issue this PR fixes** fixes part of kubernetes#24343 **Special notes for your reviewer**: WIP, I still need to figure out what to do with the BUILD script and tests, plus take care of the e2e tests that use some of these examples. **release notes** ```release-note Redirect all examples README to the the kubernetes/examples repo ```
- Loading branch information
Showing
2 changed files
with
2 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1 @@ | ||
# MySQL installation with cinder volume plugin | ||
|
||
Cinder is a Block Storage service for OpenStack. This example shows how it can be used as an attachment mounted to a pod in Kubernets. | ||
|
||
### Prerequisites | ||
|
||
Start kubelet with cloud provider as openstack with a valid cloud config | ||
Sample cloud_config: | ||
|
||
``` | ||
[Global] | ||
auth-url=https://os-identity.vip.foo.bar.com:5443/v2.0 | ||
username=user | ||
password=pass | ||
region=region1 | ||
tenant-id=0c331a1df18571594d49fe68asa4e | ||
``` | ||
|
||
Currently the cinder volume plugin is designed to work only on linux hosts and offers ext4 and ext3 as supported fs types | ||
Make sure that kubelet host machine has the following executables | ||
|
||
``` | ||
/bin/lsblk -- To Find out the fstype of the volume | ||
/sbin/mkfs.ext3 and /sbin/mkfs.ext4 -- To format the volume if required | ||
/usr/bin/udevadm -- To probe the volume attached so that a symlink is created under /dev/disk/by-id/ with a virtio- prefix | ||
``` | ||
|
||
Ensure cinder is installed and configured properly in the region in which kubelet is spun up | ||
|
||
### Example | ||
|
||
Create a cinder volume Ex: | ||
|
||
`cinder create --display-name=test-repo 2` | ||
|
||
Use the id of the cinder volume created to create a pod [definition](mysql.yaml) | ||
Create a new pod with the definition | ||
|
||
`cluster/kubectl.sh create -f examples/mysql-cinder-pd/mysql.yaml` | ||
|
||
This should now | ||
|
||
1. Attach the specified volume to the kubelet's host machine | ||
2. Format the volume if required (only if the volume specified is not already formatted to the fstype specified) | ||
3. Mount it on the kubelet's host machine | ||
4. Spin up a container with this volume mounted to the path specified in the pod definition | ||
|
||
|
||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> | ||
[]() | ||
<!-- END MUNGE: GENERATED_ANALYTICS --> | ||
This file has moved to [/~https://github.com/kubernetes/examples/blob/master/staging/mysql-cinder-pd/README.md](/~https://github.com/kubernetes/examples/blob/master/staging/mysql-cinder-pd/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1 @@ | ||
This is a simple web server pod which serves HTML from an Cinder volume. | ||
|
||
Create a volume in the same tenant and zone as your node. | ||
|
||
Add your volume information in the pod description file cinder-web.yaml then create the pod: | ||
|
||
```shell | ||
$ kubectl create -f examples/volumes/cinder/cinder-web.yaml | ||
``` | ||
|
||
Add some data to the volume if is empty: | ||
|
||
```sh | ||
$ echo "Hello World" >& /var/lib/kubelet/plugins/kubernetes.io/cinder/mounts/{Volume ID}/index.html | ||
``` | ||
|
||
You should now be able to query your web server: | ||
|
||
```sh | ||
$ curl <Pod IP address> | ||
$ Hello World | ||
``` | ||
|
||
|
||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> | ||
[]() | ||
<!-- END MUNGE: GENERATED_ANALYTICS --> | ||
This file has moved to [/~https://github.com/kubernetes/examples/blob/master/staging/volumes/cinder/README.md](/~https://github.com/kubernetes/examples/blob/master/staging/volumes/cinder/README.md) |