text
stringlengths
0
59.1k
flexVolume:
driver: "k8s/dummy-attachable"
<|endoftext|>
# source: k8s_examples/_archived/volumes/flexvolume/deploy/ds.yaml type: yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: flex-ds
spec:
template:
metadata:
name: flex-deploy
labels:
app: flex-deploy
spec:
containers:
# TODO Change to your container registry.
- image: "<image_url>"
name: flex-deploy
securityContext:
privileged: true
volumeMounts:
- mountPath: /flexmnt
name: flexvolume-mount
volumes:
- name: flexvolume-mount
hostPath:
# TODO Change to the Flexvolume plugin directory of your cluster.
path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/
<|endoftext|>
# source: k8s_examples/_archived/volumes/flexvolume/deploy/README.md type: docs
This directory contains an example of the DaemonSet Flexvolume driver deployment method. See documentation [here](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/flexvolume-deployment.md#recommended-driver-deployment-method).
Steps to use the DaemonSet deployment method:
1. Copy the Flexvolume driver to `drivers` directory. To get a basic example running, copy the `dummy` driver from the parent directory.
1. If you'd like to just get a basic example running, you could skip this step. Otherwise, change the places marked with `TODO` in all files.
1. Build the deployment Docker image and upload to your container registry.
1. Create the DaemonSet.
<|endoftext|>
# source: k8s_examples/_archived/volumes/aws_ebs/aws-ebs-web.yaml type: yaml
apiVersion: v1
kind: Pod
metadata:
name: aws-web
spec:
containers:
- name: web
image: nginx
ports:
- name: web
containerPort: 80
protocol: tcp
volumeMounts:
- name: html-volume
mountPath: "/usr/share/nginx/html"
volumes:
- name: html-volume
awsElasticBlockStore:
# Enter the volume ID below
volumeID: volume_ID
fsType: ext4
<|endoftext|>
# source: k8s_examples/_archived/volumes/aws_ebs/README.md type: docs
This is a simple web server pod which serves HTML from an AWS EBS
volume.
If you did not use kube-up script, make sure that your masters have the following IAM permissions ([Amazon IAM Roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#create-iam-role-console)):
```shell
ec2:AttachVolume
ec2:DetachVolume
ec2:DescribeInstances
ec2:DescribeVolumes
```
Create a volume in the same region as your node.
Add your volume information in the pod description file aws-ebs-web.yaml then create the pod:
```shell
$ kubectl create -f examples/volumes/aws_ebs/aws-ebs-web.yaml
```
Add some data to the volume if is empty:
```sh
$ echo "Hello World" >& /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/{Region}/{Volume ID}/index.html
```
You should now be able to query your web server:
```sh
$ curl <Pod IP address>
$ Hello World
```
<|endoftext|>