Skip to content

Commit

Permalink
Fix pull request 4700 (apache#4951)
Browse files Browse the repository at this point in the history
### Purpose

Fixes pull request apache#4700 

### Motivation

The updated API (using v1/apps for Workload API objects like DaemonSet, StatefulSet, and Deployment) introduced in apache#4700 requires a LabelSelector object for each Deployment, DaemonSet, and SatetfulSet object. The apache#4700 does not include those LabelSelector objects. This causes  the rejection of the K8S generic deployment scripts by the K8S API validator. 

### Changes

_deployment/kubernetes/generic/k8s-1-9-and-above/bookie.yml :_

- Add a LabelSelector object matching pods labels (required by API)
 to the DaemonSet:spec object 

_deployment/kubernetes/generic/k8s-1-9-and-above/broker.yml :_

- Add a LabelSelector object matching pods labels (required by API)
 to the Deployment:spec object .

_deployment/kubernetes/generic/k8s-1-9-and-above/monitoring.yml :_

- Add a LabelSelector object matching pods labels (required by API)
 to the Deployment:spec object for Prometheus.

- Add a LabelSelector object matching pods labels (required by API)
 to the Deployment:spec object for Grafana.

- Add a LabelSelector object matching pods labels (required by API)
 to the Deployment:spec object for the Pulsar Dashboard.

_deployment/kubernetes/generic/k8s-1-9-and-above/proxy.yml :_

- Add a LabelSelector object matching pods labels (required by API)
 to the Deployment:spec object.

_deployment/kubernetes/generic/k8s-1-9-and-above/proxy.yml :_

- Add a LabelSelector object matching pods labels (required by API)
 to the StatefulSet:spec object.

- Changing StatefulSet:spec:template:metadata:labels:cluster from 'us-central' to 'local'. All other scripts assume cluster is 'local' and not 'us-central'.

### Testing coverage

- All scripts have been succefully applied to a fresh Minikube cluster without rejection
- Cluster experiment (through admin pod) with a production rate of 100 has been done
- Monitoring has NOT been tested (deployed but not functionally tested)
  • Loading branch information
Guillaume Braibant authored and sijie committed Aug 20, 2019
1 parent aa77572 commit bd8abcc
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
5 changes: 5 additions & 0 deletions deployment/kubernetes/generic/k8s-1-9-and-above/bookie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ metadata:
app: pulsar
component: bookkeeper
spec:
# Must match template:metadata:labels
selector:
matchLabels:
app: pulsar
component: bookkeeper
template:
metadata:
labels:
Expand Down
5 changes: 5 additions & 0 deletions deployment/kubernetes/generic/k8s-1-9-and-above/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ kind: Deployment
metadata:
name: broker
spec:
# Must match template:metdata:labels
selector:
matchLabels:
app: pulsar
component: broker
replicas: 3
template:
metadata:
Expand Down
15 changes: 15 additions & 0 deletions deployment/kubernetes/generic/k8s-1-9-and-above/monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ kind: Deployment
metadata:
name: prometheus
spec:
# Must match template:metadata:labels
selector:
matchLabels:
app: pulsar
component: prometheus
replicas: 1
template:
metadata:
Expand Down Expand Up @@ -134,6 +139,11 @@ kind: Deployment
metadata:
name: grafana
spec:
# Must match template:metadata:labels
selector:
matchLabels:
app: pulsar
component: grafana
replicas: 1
template:
metadata:
Expand Down Expand Up @@ -175,6 +185,11 @@ kind: Deployment
metadata:
name: pulsar-dashboard
spec:
# Must match template:metadata:labels
selector:
matchLabels:
app: pulsar
component: dashboard
replicas: 1
template:
metadata:
Expand Down
5 changes: 5 additions & 0 deletions deployment/kubernetes/generic/k8s-1-9-and-above/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ kind: Deployment
metadata:
name: proxy
spec:
# Must match template:metadata:labels
selector:
matchLabels:
app: pulsar
component: proxy
replicas: 2
template:
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,19 @@ metadata:
component: zookeeper
spec:
serviceName: zookeeper
# Must match template:metadata:labels
selector:
matchLabels:
app: pulsar
component: zookeeper
cluster: local
replicas: 3
template:
metadata:
labels:
app: pulsar
component: zookeeper
cluster: us-central
cluster: local
annotations:
pod.alpha.kubernetes.io/initialized: "true"
prometheus.io/scrape: "true"
Expand Down

0 comments on commit bd8abcc

Please sign in to comment.