Skip to content

Commit

Permalink
Merge pull request #86 from SolaceDev/v1.1.1
Browse files Browse the repository at this point in the history
v1.1.1 Release
  • Loading branch information
LewisKSaint authored Aug 9, 2024
2 parents 48de1b5 + 05cda40 commit 83f922d
Show file tree
Hide file tree
Showing 17 changed files with 124 additions and 62 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-test-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

env:
VERSION: 1.1.0
VERSION: 1.1.1
IMAGE_NAME: pubsubplus-eventbroker-operator
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
GCLOUD_PROJECT_ID_DEV: ${{ secrets.GCLOUD_PROJECT_ID }}
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
secrets: |
secret/data/development/gcp-gcr GCP_SERVICE_ACCOUNT | GCP_DEV_SERVICE_ACCOUNT
env:
VERSION: 1.1.0
VERSION: ${{ env.VERSION }}
IMAGE_NAME: pubsubplus-eventbroker-operator
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
GCLOUD_PROJECT_ID_DEV: ${{ secrets.GCLOUD_PROJECT_ID }}
Expand All @@ -144,11 +144,13 @@ jobs:
gcr.io/${{ env.GCLOUD_PROJECT_ID_DEV }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
push: true
env:
VERSION: 1.1.0
VERSION: ${{ env.VERSION }}
IMAGE_NAME: pubsubplus-eventbroker-operator
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
GCLOUD_PROJECT_ID_DEV: ${{ secrets.GCLOUD_PROJECT_ID }}

- name: Build image and push GitHub Container Registry
run: make docker-push

- name: Run Vulnerability PreCheck for Prisma
uses: ./maas-build-actions/.github/actions/prisma-vulnerability-checker
Expand All @@ -159,8 +161,6 @@ jobs:
project_squad: "launchpad"
prisma_jira_check: "False"

- name: Build image and push GitHub Container Registry
run: make docker-push

- name: Run Whitesource Action
uses: SolaceDev/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prep-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
release_tag:
description: 'Release tag'
required: true
default: '1.1.0'
default: '1.1.1'
prep_internal_release:
# Need to distinguish between internal and external releases
# Internal release: Will use default internal location for created images (ghcr.io) and will tag and push operator candidate there
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/vulncheck_periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
- cron: '0 */ * * *'

env:
VERSION: 1.1.0
VERSION: 1.1.1
IMAGE_NAME: pubsubplus-eventbroker-operator
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
GCLOUD_PROJECT_ID_DEV: ${{ secrets.GCLOUD_PROJECT_ID }}
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
secrets: |
secret/data/development/gcp-gcr GCP_SERVICE_ACCOUNT | GCP_DEV_SERVICE_ACCOUNT
env:
VERSION: 1.1.0
VERSION: 1.1.1
IMAGE_NAME: pubsubplus-eventbroker-operator
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
GCLOUD_PROJECT_ID_DEV: ${{ secrets.GCLOUD_PROJECT_ID }}
Expand All @@ -85,7 +85,7 @@ jobs:
gcr.io/${{ env.GCLOUD_PROJECT_ID_DEV }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
push: true
env:
VERSION: 1.1.0
VERSION: 1.1.1
IMAGE_NAME: pubsubplus-eventbroker-operator
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
GCLOUD_PROJECT_ID_DEV: ${{ secrets.GCLOUD_PROJECT_ID }}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1134
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1194

LABEL name="solace/pubsubplus-eventbroker-operator"
LABEL vendor="Solace Corporation"
LABEL version="1.1.0"
LABEL release="1.1.0"
LABEL version="1.1.1"
LABEL release="1.1.1"
LABEL summary="Solace PubSub+ Event Broker Kubernetes Operator"
LABEL description="The Solace PubSub+ Event Broker Kubernetes Operator deploys and manages the lifecycle of PubSub+ Event Brokers"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 1.1.0
VERSION ?= 1.1.1

# API_VERSION defines the API version for the PubSubPlusEventBroker CRD
API_VERSION ?= v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ metadata:
certified: "true"
com.redhat.delivery.operator.bundle: "true"
com.redhat.openshift.versions: v4.10
containerImage: docker.io/solace/pubsubplus-eventbroker-operator:1.1.0
createdAt: "2024-07-01T12:25:04Z"
containerImage: docker.io/solace/pubsubplus-eventbroker-operator:v1.1.1
createdAt: "2024-07-31T18:47:51Z"
description: The Solace PubSub+ Event Broker Operator deploys and manages the
lifecycle of PubSub+ Event Brokers
operators.openshift.io/valid-subscription: '[]'
operators.operatorframework.io/builder: operator-sdk-v1.34.1
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/SolaceProducts/pubsubplus-kubernetes-quickstart
support: Solace Products
name: pubsubplus-eventbroker-operator.v1.1.0
name: pubsubplus-eventbroker-operator.v1.1.1
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -296,7 +296,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
image: docker.io/solace/pubsubplus-eventbroker-operator:1.1.0
image: docker.io/solace/pubsubplus-eventbroker-operator:1.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:
Expand Down Expand Up @@ -411,4 +411,4 @@ spec:
provider:
name: Solace Corporation
url: www.solace.com
version: 1.1.0
version: 1.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
creationTimestamp: null
labels:
app.kubernetes.io/version: v1.1.1
name: pubsubpluseventbrokers.pubsubplus.solace.com
spec:
group: pubsubplus.solace.com
Expand Down
4 changes: 2 additions & 2 deletions ci/whitesource/whitesource-agent.config
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ go.modules.includeTestDependencies=true
#userKey=

projectName=pubsubplus-kubernetes-operator
projectVersion=v1.1.0
projectVersion=v1.1.1
projectToken=

productName=pubsubplus-kubernetes-operator
productVersion=v1.1.0
productVersion=v1.1.1
productToken=
updateType=OVERRIDE
#[email protected]
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: ghcr.io/solacedev/pubsubplus-eventbroker-operator
newTag: 1.1.0
newName: docker.io/solace/pubsubplus-eventbroker-operator
newTag: 1.1.1
8 changes: 8 additions & 0 deletions controllers/controller_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"context"
"embed"
"encoding/gob"
"encoding/json"
"fmt"
eventbrokerv1beta1 "github.com/SolaceProducts/pubsubplus-operator/api/v1beta1"
"hash/crc64"
Expand Down Expand Up @@ -132,3 +133,10 @@ func hash(s any) string {
crc64Table := crc64.MakeTable(crc64.ECMA)
return strconv.FormatUint(crc64.Checksum(convertToByteArray(s), crc64Table), 16)
}

func parseScalingParameterWithUnKnownFieldsToMap(scalingParameter *eventbrokerv1beta1.SystemScaling) map[string]interface{} {
var scalingParamMap map[string]interface{}
marshalScalingParameter, _ := json.Marshal(scalingParameter)
json.Unmarshal(marshalScalingParameter, &scalingParamMap)
return scalingParamMap
}
29 changes: 16 additions & 13 deletions controllers/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,24 +137,29 @@ func (r *PubSubPlusEventBrokerReconciler) updateStatefulsetForEventBroker(sts *a
maxConnections = (map[bool]int{true: DefaultDeveloperModeMaxConnections, false: DefaultMessagingNodeMaxConnections})[m.Spec.Developer]
maxQueueMessages = (map[bool]int{true: DefaultDeveloperModeMaxQueueMessages, false: DefaultMessagingNodeMaxQueueMessages})[m.Spec.Developer]
maxSpoolUsage = (map[bool]int{true: DefaultDeveloperModeMaxSpoolUsage, false: DefaultMessagingNodeMaxSpoolUsage})[m.Spec.Developer]

scalingParamMap := parseScalingParameterWithUnKnownFieldsToMap(m.Spec.SystemScaling)
// Overwrite for any values defined in spec.systemScaling
if m.Spec.SystemScaling != nil && !m.Spec.Developer {
if m.Spec.SystemScaling.MessagingNodeCpu != "" {
cpuRequests = m.Spec.SystemScaling.MessagingNodeCpu
if messagingNodeCpu, ok := scalingParamMap["messagingNodeCpu"]; ok && messagingNodeCpu != "" {
cpuRequests = messagingNodeCpu.(string)
cpuLimits = cpuRequests
}
if m.Spec.SystemScaling.MessagingNodeMemory != "" {
memRequests = m.Spec.SystemScaling.MessagingNodeMemory
if messagingNodeMemory, ok := scalingParamMap["messagingNodeMemory"]; ok && messagingNodeMemory != "" {
memRequests = messagingNodeMemory.(string)
memLimits = memRequests
}
if m.Spec.SystemScaling.MaxConnections > 0 {
maxConnections = m.Spec.SystemScaling.MaxConnections
if maxConnectionsValue, ok := scalingParamMap["maxConnections"]; ok && maxConnectionsValue != "" {
maxConnectionsFloat := maxConnectionsValue.(float64)
maxConnections = int(maxConnectionsFloat)
}
if m.Spec.SystemScaling.MaxQueueMessages > 0 {
maxQueueMessages = m.Spec.SystemScaling.MaxQueueMessages
if maxQueueMessagesValue, ok := scalingParamMap["maxQueueMessages"]; ok && maxQueueMessagesValue != "" {
maxQueueMessagesValueFloat := maxQueueMessagesValue.(float64)
maxQueueMessages = int(maxQueueMessagesValueFloat)
}
if m.Spec.SystemScaling.MaxSpoolUsage > 0 {
maxSpoolUsage = m.Spec.SystemScaling.MaxSpoolUsage
if maxSpoolUsageValue, ok := scalingParamMap["maxSpoolUsage"]; ok && maxSpoolUsageValue != "" {
maxSpoolUsageValueFloat := maxSpoolUsageValue.(float64)
maxSpoolUsage = int(maxSpoolUsageValueFloat)
}
}
}
Expand Down Expand Up @@ -639,9 +644,7 @@ func (r *PubSubPlusEventBrokerReconciler) updateStatefulsetForEventBroker(sts *a
//Set unknown scaling parameter values
if m.Spec.SystemScaling != nil {
var err error
var scalingParamMap map[string]interface{}
inrec, _ := json.Marshal(m.Spec.SystemScaling)
json.Unmarshal(inrec, &scalingParamMap)
scalingParamMap := parseScalingParameterWithUnKnownFieldsToMap(m.Spec.SystemScaling)
allEnv := sts.Spec.Template.Spec.Containers[0].Env
for key, val := range scalingParamMap {
if strings.HasPrefix(strings.ToLower(key), scalingParameterPrefix) || strings.HasPrefix(strings.ToLower(key), scalingParameterSpoolPrefix) {
Expand Down
2 changes: 1 addition & 1 deletion deploy/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,7 @@ spec:
env:
- name: WATCH_NAMESPACE
value: ""
image: docker.io/solace/pubsubplus-eventbroker-operator:1.1.0
image: docker.io/solace/pubsubplus-eventbroker-operator:1.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:
Expand Down
41 changes: 41 additions & 0 deletions docs/EventBrokerOperatorParametersReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,13 @@ Monitoring specifies a Prometheus monitoring endpoint for the event broker
<i>Default</i>: false<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#pubsubpluseventbrokerspecmonitoringextraenvvarsindex">extraEnvVars</a></b></td>
<td>[]object</td>
<td>
List of extra environment variables to be added to the Prometheus Exporter container.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#pubsubpluseventbrokerspecmonitoringimage">image</a></b></td>
<td>object</td>
Expand Down Expand Up @@ -504,6 +511,40 @@ Monitoring specifies a Prometheus monitoring endpoint for the event broker
</tr></tbody>
</table>

### PubSubPlusEventBroker.spec.monitoring.extraEnvVars[index]
<sup><sup>[↩ Parent](#pubsubpluseventbrokerspecmonitoring)</sup></sup>



MonitoringExtraEnvVar defines environment variables to be added to the Prometheus Exporter container for Monitoring

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>name</b></td>
<td>string</td>
<td>
Specifies the Name of an environment variable to be added to the Prometheus Exporter container for Monitoring<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>value</b></td>
<td>string</td>
<td>
Specifies the Value of an environment variable to be added to the Prometheus Exporter container for Monitoring<br/>
</td>
<td>true</td>
</tr></tbody>
</table>



### PubSubPlusEventBroker.spec.monitoring.image
<sup><sup>[↩ Parent](#pubsubpluseventbrokerspecmonitoring)</sup></sup>
Expand Down
15 changes: 12 additions & 3 deletions docs/EventBrokerOperatorUserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,21 @@ spec:
messagingNodeCpu: "2"
messagingNodeMemory: "4025Mi"
```
or

```yaml
spec:
systemScaling:
system_scaling_maxconnectioncount: 100
system_scaling_maxqueuemessagecount: 100
messagespool_maxspoolusage: 1000
messagingNodeCpu: "2"
messagingNodeMemory: "4025Mi"
```

>Note: Beyond CPU and memory requirements, broker storage size (see [Storage](#storage) section) must also support the provided scaling. The calculator can be used to determine that as well.

Also note, that specifying `maxConnections`, `maxQueueMessages`, and `maxSpoolUsage` on initial deployment overwrites the broker’s default values. On the other hand, doing the same using upgrade on an existing deployment does not overwrite these values on brokers configuration, but it can be used to prepare (first step) for a manual scale up using CLI where these parameter changes would actually become effective (second step).
Also note, that specifying `maxConnections`, `maxQueueMessages`, and `maxSpoolUsage` on initial deployment overwrites the broker’s default values. On the other hand, doing the same using upgrade on an existing deployment does not overwrite these values on brokers configuration, but it can be used to prepare (first step) for a manual scale up using CLI where these parameter changes would actually become effective (second step). The Operator will use default configurations in situations where the scaling parameters are not provided or are not valid.

>Note: The scaling parameters intentionally use a mix of *camelCase* and *snake_case* to maintain backward and forward compatibility with Solace PubSub+ Software Event Broker configurations. Make sure values are not duplicated for consistency. When using the [resource calculator](https://docs.solace.com/Admin-Ref/Resource-Calculator/pubsubplus-resource-calculator.html), ensure that the scaling parameters are in the correct format to match what the Solace PubSub+ Software Event Broker expects. If invalid scaling parameters are provided, the Operator will revert to default values. For the list of default values, please refer to this [link](/docs/EventBrokerOperatorParametersReference.md).

Expand Down Expand Up @@ -1486,8 +1497,6 @@ A given version of the Operator has a dependency on the PubSubPlusEventBroker Cu

You can use OLM to manage installing new versions of the Operator as they become available. The default install of the PubSub+ Event Broker Operator is set to perform automatic updates. This can be changed to `Manual` by editing the broker subscription in the `operators` namespace.

If the Operator has been installed directly from the command line then update `deploy.yaml` to the new operator image tag, run `kubectl apply -f <updated-deploy.yaml>`, and then validate the updated deployment.

#### Upgrade CRD and Operator

OLM automatically manages the CRD and Operator updates.
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.21
require (
github.com/google/gnostic-models v0.6.8 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/onsi/ginkgo/v2 v2.14.0
github.com/onsi/gomega v1.30.0
github.com/onsi/ginkgo/v2 v2.17.1
github.com/onsi/gomega v1.33.0
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
Expand Down Expand Up @@ -48,16 +48,16 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.16.1 // indirect
golang.org/x/tools v0.17.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 83f922d

Please sign in to comment.