I use OpenLogic 7.1
yum install -y git golang cifs-utils etcd docker-io
systemctl enable docker
systemctl start docker
git clone https://github.com/rootfs/kubernetes
cd kubernetes
git checkout azure
make
./hack/local-up-cluster.sh
If all is well, you are expecting these message:
To start using your cluster, open up another terminal/tab and run:
cluster/kubectl.sh config set-cluster local --server=http://127.0.0.1:8080 --insecure-skip-tls-verify=true
cluster/kubectl.sh config set-context local --cluster=local
cluster/kubectl.sh config use-context local
cluster/kubectl.sh
Then on another console, cd to your kubernetes direcotry and run:
cluster/kubectl.sh config set-cluster local --server=http://127.0.0.1:8080 --insecure-skip-tls-verify=true
cluster/kubectl.sh config set-context local --cluster=local
cluster/kubectl.sh config use-context local
cluster/kubectl.sh
The azure-key.yaml is like the following
apiVersion: v1
kind: Secret
metadata:
name: azure-key
type: Opague
data:
key: ckN1ZVU4L21FdklXOVhEYm0rbFkrMDhhZjdUeVFhSkhRV3h0UHFBcUFGSnBGdWoyajVDb0dxUHpTR3Y4VFZNZXdpNytFMFNMZmJ3YzN5V2xzVHB6YXc9PQ==
The value of the above key is base64 encoded of your azure storage accoutnt key :
echo -n your_azure_storage_account_key |base64
Here is my Pod that runs a container and mount a Azure file service:
apiVersion: v1
kind: ReplicationController
metadata:
labels:
name: web
name: web
spec:
replicas: 1
selector:
name: web-rc
template:
metadata:
labels:
name: web-rc
spec:
restartPolicy: Always
containers:
- image: tutum/apache-php
name: php
ports:
- containerPort: 80
name: web-port
volumeMounts:
- name: azure-vol
mountPath: /var/lib/www
volumes:
- name: azure-vol
azureFile:
accountName: "rootfs"
keyName: "azure-key"
shareName: "kube"
readOnly: false
Please replace accountName
with your Azure storage account name
On your second terminal that runs the cluster/kubectl.sh
command, do the following:
# ./cluster/kubectl.sh create -f azure-key.yaml
You should expect:
secret "azure-key" created
Then
# ./cluster/kubectl.sh create -f azure.yaml
You should expect:
replicationcontroller "web" created
If all is well, you should see success message from ./cluster/kubectl.sh describe pod
.
You can check from mount |grep cifs
to see your SMB share is mounted.
Otherwise, please send me the output of ./cluster/kubectl.sh describe pod