mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
Docs improvements (#7660)
* Docs: update sidebar * Docs: move registry documentation into docs/ * Docs: move rbd_provisioner documentation into docs/ * Docs: move cephfs_provisioner into docs/ * Docs: move local_volume_provisioner documentation into docs/ * Docs: move ambassador.md to docs/ingress_controller/ * Docs: move metallb.md to docs/ingress_controller/ * Docs: move ingress_nginx documentation into docs/ * Docs: move alb_ingress_controller documentation into docs/ * Docs: merge ambassador documentation into docs/ingress_controller/ * Docs: move cert_manager documentation into docs/ * Docs: move bootstrap-os documentation into docs/ * Docs: update file locations in sidebar
This commit is contained in:
@@ -1,78 +0,0 @@
|
||||
CephFS Volume Provisioner for Kubernetes 1.5+
|
||||
=============================================
|
||||
|
||||
[](https://quay.io/repository/external_storage/cephfs-provisioner)
|
||||
|
||||
Using Ceph volume client
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
Compile the provisioner
|
||||
|
||||
``` console
|
||||
make
|
||||
```
|
||||
|
||||
Make the container image and push to the registry
|
||||
|
||||
``` console
|
||||
make push
|
||||
```
|
||||
|
||||
Test instruction
|
||||
----------------
|
||||
|
||||
- Start Kubernetes local cluster
|
||||
|
||||
See [Kubernetes](https://kubernetes.io/)
|
||||
|
||||
- Create a Ceph admin secret
|
||||
|
||||
``` bash
|
||||
ceph auth get client.admin 2>&1 |grep "key = " |awk '{print $3'} |xargs echo -n > /tmp/secret
|
||||
kubectl create ns cephfs
|
||||
kubectl create secret generic ceph-secret-admin --from-file=/tmp/secret --namespace=cephfs
|
||||
```
|
||||
|
||||
- Start CephFS provisioner
|
||||
|
||||
The following example uses `cephfs-provisioner-1` as the identity for the instance and assumes kubeconfig is at `/root/.kube`. The identity should remain the same if the provisioner restarts. If there are multiple provisioners, each should have a different identity.
|
||||
|
||||
``` bash
|
||||
docker run -ti -v /root/.kube:/kube -v /var/run/kubernetes:/var/run/kubernetes --privileged --net=host cephfs-provisioner /usr/local/bin/cephfs-provisioner -master=http://127.0.0.1:8080 -kubeconfig=/kube/config -id=cephfs-provisioner-1
|
||||
```
|
||||
|
||||
Alternatively, deploy it in kubernetes, see [deployment](deploy/README.md).
|
||||
|
||||
- Create a CephFS Storage Class
|
||||
|
||||
Replace Ceph monitor's IP in [example class](example/class.yaml) with your own and create storage class:
|
||||
|
||||
``` bash
|
||||
kubectl create -f example/class.yaml
|
||||
```
|
||||
|
||||
- Create a claim
|
||||
|
||||
``` bash
|
||||
kubectl create -f example/claim.yaml
|
||||
```
|
||||
|
||||
- Create a Pod using the claim
|
||||
|
||||
``` bash
|
||||
kubectl create -f example/test-pod.yaml
|
||||
```
|
||||
|
||||
Known limitations
|
||||
-----------------
|
||||
|
||||
- Kernel CephFS doesn't work with SELinux, setting SELinux label in Pod's securityContext will not work.
|
||||
- Kernel CephFS doesn't support quota or capacity, capacity requested by PVC is not enforced or validated.
|
||||
- Currently each Ceph user created by the provisioner has `allow r` MDS cap to permit CephFS mount.
|
||||
|
||||
Acknowledgement
|
||||
---------------
|
||||
|
||||
Inspired by CephFS Manila provisioner and conversation with John Spray
|
||||
@@ -1,126 +0,0 @@
|
||||
Local Storage Provisioner
|
||||
=========================
|
||||
|
||||
The [local storage provisioner](https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume)
|
||||
is NOT a dynamic storage provisioner as you would
|
||||
expect from a cloud provider. Instead, it simply creates PersistentVolumes for
|
||||
all mounts under the host_dir of the specified storage class.
|
||||
These storage classes are specified in the `local_volume_provisioner_storage_classes` nested dictionary.
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
local_volume_provisioner_storage_classes:
|
||||
local-storage:
|
||||
host_dir: /mnt/disks
|
||||
mount_dir: /mnt/disks
|
||||
fast-disks:
|
||||
host_dir: /mnt/fast-disks
|
||||
mount_dir: /mnt/fast-disks
|
||||
block_cleaner_command:
|
||||
- "/scripts/shred.sh"
|
||||
- "2"
|
||||
volume_mode: Filesystem
|
||||
fs_type: ext4
|
||||
```
|
||||
|
||||
For each key in `local_volume_provisioner_storage_classes` a storageClass with the
|
||||
same name is created. The subkeys of each storage class are converted to camelCase and added
|
||||
as attributes to the storageClass.
|
||||
The result of the above example is:
|
||||
|
||||
```yaml
|
||||
data:
|
||||
storageClassMap: |
|
||||
local-storage:
|
||||
hostDir: /mnt/disks
|
||||
mountDir: /mnt/disks
|
||||
fast-disks:
|
||||
hostDir: /mnt/fast-disks
|
||||
mountDir: /mnt/fast-disks
|
||||
blockCleanerCommand:
|
||||
- "/scripts/shred.sh"
|
||||
- "2"
|
||||
volumeMode: Filesystem
|
||||
fsType: ext4
|
||||
```
|
||||
|
||||
The default StorageClass is local-storage on /mnt/disks,
|
||||
the rest of this doc will use that path as an example.
|
||||
|
||||
Examples to create local storage volumes
|
||||
----------------------------------------
|
||||
|
||||
1. tmpfs method:
|
||||
|
||||
``` bash
|
||||
for vol in vol1 vol2 vol3; do
|
||||
mkdir /mnt/disks/$vol
|
||||
mount -t tmpfs -o size=5G $vol /mnt/disks/$vol
|
||||
done
|
||||
```
|
||||
|
||||
The tmpfs method is not recommended for production because the mount is not
|
||||
persistent and data will be deleted on reboot.
|
||||
|
||||
1. Mount physical disks
|
||||
|
||||
``` bash
|
||||
mkdir /mnt/disks/ssd1
|
||||
mount /dev/vdb1 /mnt/disks/ssd1
|
||||
```
|
||||
|
||||
Physical disks are recommended for production environments because it offers
|
||||
complete isolation in terms of I/O and capacity.
|
||||
|
||||
1. Mount unpartitioned physical devices
|
||||
|
||||
``` bash
|
||||
for disk in /dev/sdc /dev/sdd /dev/sde; do
|
||||
ln -s $disk /mnt/disks
|
||||
done
|
||||
```
|
||||
|
||||
This saves time of precreating filesystems. Note that your storageclass must have
|
||||
volume_mode set to "Filesystem" and fs_type defined. If either is not set, the
|
||||
disk will be added as a raw block device.
|
||||
|
||||
1. File-backed sparsefile method
|
||||
|
||||
``` bash
|
||||
truncate /mnt/disks/disk5 --size 2G
|
||||
mkfs.ext4 /mnt/disks/disk5
|
||||
mkdir /mnt/disks/vol5
|
||||
mount /mnt/disks/disk5 /mnt/disks/vol5
|
||||
```
|
||||
|
||||
If you have a development environment and only one disk, this is the best way
|
||||
to limit the quota of persistent volumes.
|
||||
|
||||
1. Simple directories
|
||||
|
||||
In a development environment using `mount --bind` works also, but there is no capacity
|
||||
management.
|
||||
|
||||
1. Block volumeMode PVs
|
||||
|
||||
Create a symbolic link under discovery directory to the block device on the node. To use
|
||||
raw block devices in pods, volume_type should be set to "Block".
|
||||
|
||||
Usage notes
|
||||
-----------
|
||||
|
||||
Beta PV.NodeAffinity field is used by default. If running against an older K8s
|
||||
version, the useAlphaAPI flag must be set in the configMap.
|
||||
|
||||
The volume provisioner cannot calculate volume sizes correctly, so you should
|
||||
delete the daemonset pod on the relevant host after creating volumes. The pod
|
||||
will be recreated and read the size correctly.
|
||||
|
||||
Make sure to make any mounts persist via /etc/fstab or with systemd mounts (for
|
||||
Flatcar Container Linux). Pods with persistent volume claims will not be
|
||||
able to start if the mounts become unavailable.
|
||||
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
Refer to the upstream docs here: <https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume>
|
||||
@@ -1,79 +0,0 @@
|
||||
# RBD Volume Provisioner for Kubernetes 1.5+
|
||||
|
||||
`rbd-provisioner` is an out-of-tree dynamic provisioner for Kubernetes 1.5+.
|
||||
You can use it quickly & easily deploy ceph RBD storage that works almost
|
||||
anywhere.
|
||||
|
||||
It works just like in-tree dynamic provisioner. For more information on how
|
||||
dynamic provisioning works, see [the docs](http://kubernetes.io/docs/user-guide/persistent-volumes/)
|
||||
or [this blog post](http://blog.kubernetes.io/2016/10/dynamic-provisioning-and-storage-in-kubernetes.html).
|
||||
|
||||
## Development
|
||||
|
||||
Compile the provisioner
|
||||
|
||||
```console
|
||||
make
|
||||
```
|
||||
|
||||
Make the container image and push to the registry
|
||||
|
||||
```console
|
||||
make push
|
||||
```
|
||||
|
||||
## Test instruction
|
||||
|
||||
* Start Kubernetes local cluster
|
||||
|
||||
See [Kubernetes](https://kubernetes.io/).
|
||||
|
||||
* Create a Ceph admin secret
|
||||
|
||||
```bash
|
||||
ceph auth get client.admin 2>&1 |grep "key = " |awk '{print $3'} |xargs echo -n > /tmp/secret
|
||||
kubectl create secret generic ceph-admin-secret --from-file=/tmp/secret --namespace=kube-system
|
||||
```
|
||||
|
||||
* Create a Ceph pool and a user secret
|
||||
|
||||
```bash
|
||||
ceph osd pool create kube 8 8
|
||||
ceph auth add client.kube mon 'allow r' osd 'allow rwx pool=kube'
|
||||
ceph auth get-key client.kube > /tmp/secret
|
||||
kubectl create secret generic ceph-secret --from-file=/tmp/secret --namespace=kube-system
|
||||
```
|
||||
|
||||
* Start RBD provisioner
|
||||
|
||||
The following example uses `rbd-provisioner-1` as the identity for the instance and assumes kubeconfig is at `/root/.kube`. The identity should remain the same if the provisioner restarts. If there are multiple provisioners, each should have a different identity.
|
||||
|
||||
```bash
|
||||
docker run -ti -v /root/.kube:/kube -v /var/run/kubernetes:/var/run/kubernetes --privileged --net=host quay.io/external_storage/rbd-provisioner /usr/local/bin/rbd-provisioner -master=http://127.0.0.1:8080 -kubeconfig=/kube/config -id=rbd-provisioner-1
|
||||
```
|
||||
|
||||
Alternatively, deploy it in kubernetes, see [deployment](deploy/README.md).
|
||||
|
||||
* Create a RBD Storage Class
|
||||
|
||||
Replace Ceph monitor's IP in [examples/class.yaml](examples/class.yaml) with your own and create storage class:
|
||||
|
||||
```bash
|
||||
kubectl create -f examples/class.yaml
|
||||
```
|
||||
|
||||
* Create a claim
|
||||
|
||||
```bash
|
||||
kubectl create -f examples/claim.yaml
|
||||
```
|
||||
|
||||
* Create a Pod using the claim
|
||||
|
||||
```bash
|
||||
kubectl create -f examples/test-pod.yaml
|
||||
```
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
* This provisioner is extracted from [Kubernetes core](https://github.com/kubernetes/kubernetes) with some modifications for this project.
|
||||
Reference in New Issue
Block a user