After you enable the OpenStack cloud provider as described in Enable the OpenStack cloud provider and deploy it together with your Kubernetes cluster, verify that it has been successfully deployed using the procedure below.
To verify the OpenStack cloud provider:
Log in to any Kubernetes Master node.
Create a claim1.yaml file with the following content:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: claim1
spec:
  storageClassName: cinder
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
Run the following command:
kubectl apply -f claim1.yaml
Create a cinder-test-rc.yaml file with the following content:
apiVersion: v1
kind: ReplicationController
metadata:
  name: server
  labels:
    name: nginx
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: nginx
    spec:
      containers:
      - name: server
        image: nginx
        volumeMounts:
          - mountPath: /var/lib/www/html
            name: cinderpvc
      volumes:
        - name: cinderpvc
          persistentVolumeClaim:
            claimName: claim1
Run the following command:
kubectl apply -f cinder-test-rc.yaml
Verify that the volume was created:
openstack volume list
Verify that Neutron LBaaS can create the LoadBalancer objects:
Create an nginx-rs.yml file with the following content:
apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
  name: nginx
spec:
  replicas: 4
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:1.10
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
Run the following commands:
kubectl create -f nginx-rs.yml
kubectl expose rs nginx --port 80 --type=LoadBalancer
Verify that the service has an external IP:
kubectl get services -owide
Example of system response:
NAME       CLUSTER-IP    EXTERNAL-IP                  PORT(S)       AGE  SELECTOR
kubernetes 10.254.0.1    <none>                       443/TCP       40m  <none>
nginx      10.254.18.214 192.168.10.96,172.17.48.159  80:31710/TCP  1m   app=nginx
Verify that LoadBalancer was created in OpenStack:
neutron lbaas-loadbalancer-list
In the output, the vip_address should match the first external IP
for the service created.