gcloud config set compute/zone us-east1-d
gcloud container clusters get-credentials cluster-1
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: exhibitor spec: replicas: 3 template: metadata: labels: name: exhibitor spec: containers: - image: mbabineau/zookeeper-exhibitor imagePullPolicy: Always name: exhibitor volumeMounts: - name: nfs mountPath: "/opt/zookeeper/local_configs" livenessProbe: tcpSocket: port: 8181 initialDelaySeconds: 60 timeoutSeconds: 1 readinessProbe: httpGet: path: /exhibitor/v1/cluster/4ltr/ruok port: 8181 initialDelaySeconds: 120 timeoutSeconds: 1 env: - name: HOSTNAME valueFrom: fieldRef: fieldPath: status.podIP volumes: - name: nfs nfs: server: singlefs-1-vm path: /data --- apiVersion: v1 kind: Service metadata: name: exhibitor labels: name: exhibitor spec: ports: - port: 2181 protocol: TCP name: zk - port: 8181 protocol: TCP name: api selector: name: exhibitor
kubectl apply -f exhibitor.yaml
kubectl get pods -w
kubectl proxy &
export PROXY_URL=http://localhost:8001/api/v1/proxy/ export EXHIBITOR_URL=${PROXY_URL}namespaces/default/services/exhibitor:8181 export STATUS_URL=${EXHIBITOR_URL}/exhibitor/v1/cluster/status export STATUS=`curl -s $STATUS_URL` echo $STATUS | jq '.[] | {hostname: .hostname, leader: .isLeader}'
Demonstrate your proficiency to design, build and manage solutions on Google Cloud Platform.