Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose image pull policy and upgrade stan to v0.22.1 #1325

Merged
merged 4 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions api/event-bus.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions api/event-bus.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions controllers/eventbus/installer/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ func (i *natsInstaller) buildConfigMap() (*corev1.ConfigMap, error) {
if i.eventBus.Spec.NATS.Native.MaxMsgs != nil {
maxMsgs = *i.eventBus.Spec.NATS.Native.MaxMsgs
}
maxSubs := uint64(1000)
if i.eventBus.Spec.NATS.Native.MaxSubs != nil {
maxSubs = *i.eventBus.Spec.NATS.Native.MaxSubs
}
maxBytes := "1GB"
if i.eventBus.Spec.NATS.Native.MaxBytes != nil {
maxBytes = *i.eventBus.Spec.NATS.Native.MaxBytes
Expand Down Expand Up @@ -484,8 +488,9 @@ streaming {
max_age: %s
max_msgs: %v
max_bytes: %s
max_subs: %v
}
}`, strconv.Itoa(int(monitorPort)), strconv.Itoa(int(clusterPort)), strings.Join(routes, ","), clusterID, strings.Join(peers, ","), maxAge, maxMsgs, maxBytes)
}`, strconv.Itoa(int(monitorPort)), strconv.Itoa(int(clusterPort)), strings.Join(routes, ","), clusterID, strings.Join(peers, ","), maxAge, maxMsgs, maxBytes, maxSubs)
cm := &corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Namespace: i.eventBus.Namespace,
Expand Down Expand Up @@ -577,6 +582,7 @@ func (i *natsInstaller) buildStatefulSetSpec(serviceName, configmapName, authSec
if replicas < 3 {
replicas = 3
}
var stanContainerPullPolicy, metricsContainerPullPolicy corev1.PullPolicy
stanContainerResources := corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceCPU: apiresource.MustParse("0"),
Expand All @@ -585,10 +591,12 @@ func (i *natsInstaller) buildStatefulSetSpec(serviceName, configmapName, authSec
containerTmpl := i.eventBus.Spec.NATS.Native.ContainerTemplate
if containerTmpl != nil {
stanContainerResources = containerTmpl.Resources
stanContainerPullPolicy = containerTmpl.ImagePullPolicy
}
metricsContainerResources := corev1.ResourceRequirements{}
if i.eventBus.Spec.NATS.Native.MetricsContainerTemplate != nil {
metricsContainerResources = i.eventBus.Spec.NATS.Native.MetricsContainerTemplate.Resources
metricsContainerPullPolicy = i.eventBus.Spec.NATS.Native.MetricsContainerTemplate.ImagePullPolicy
}
podTemplateLabels := make(map[string]string)
if i.eventBus.Spec.NATS.Native.Metadata != nil &&
Expand Down Expand Up @@ -658,8 +666,9 @@ func (i *natsInstaller) buildStatefulSetSpec(serviceName, configmapName, authSec
},
Containers: []corev1.Container{
{
Name: "stan",
Image: i.streamingImage,
Name: "stan",
Image: i.streamingImage,
ImagePullPolicy: stanContainerPullPolicy,
Ports: []corev1.ContainerPort{
{Name: "client", ContainerPort: clientPort},
{Name: "cluster", ContainerPort: clusterPort},
Expand Down Expand Up @@ -687,8 +696,9 @@ func (i *natsInstaller) buildStatefulSetSpec(serviceName, configmapName, authSec
},
},
{
Name: "metrics",
Image: i.metricsImage,
Name: "metrics",
Image: i.metricsImage,
ImagePullPolicy: metricsContainerPullPolicy,
Ports: []corev1.ContainerPort{
{Name: "metrics", ContainerPort: common.EventBusMetricsPort},
},
Expand Down
3 changes: 2 additions & 1 deletion docs/eventbus.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ affinity:
deleted automatically. It can be cutomized by setting
`spec.nats.native.maxAge`, i.e. `240h`.

- Max subscription number is 1000.
- Max subscription number is defaults to `1000`, it could be customized by
setting `spec.nats.native.maxSubs`.

### Exotic

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: NATS_STREAMING_IMAGE
value: nats-streaming:0.17.0
value: nats-streaming:0.22.1
- name: NATS_METRICS_EXPORTER_IMAGE
value: synadia/prometheus-nats-exporter:0.6.2
livenessProbe:
Expand Down
2 changes: 1 addition & 1 deletion manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: NATS_STREAMING_IMAGE
value: nats-streaming:0.17.0
value: nats-streaming:0.22.1
- name: NATS_METRICS_EXPORTER_IMAGE
value: synadia/prometheus-nats-exporter:0.6.2
image: quay.io/argoproj/argo-events:latest
Expand Down
2 changes: 1 addition & 1 deletion manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: NATS_STREAMING_IMAGE
value: nats-streaming:0.17.0
value: nats-streaming:0.22.1
- name: NATS_METRICS_EXPORTER_IMAGE
value: synadia/prometheus-nats-exporter:0.6.2
image: quay.io/argoproj/argo-events:latest
Expand Down
Loading