Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjunlei committed Dec 4, 2020
1 parent bd11c0f commit 1d9f073
Show file tree
Hide file tree
Showing 13 changed files with 3,664 additions and 20 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION?=$(shell cat VERSION | tr -d " \t\n\r")
# Image URL to use all building/pushing image targets
IMG ?= kubespheredev/notification-manager-operator:$(VERSION)
NM_IMG ?= kubespheredev/notification-manager:$(VERSION)
IMG ?= kubesphere/notification-manager-operator:$(VERSION)
NM_IMG ?= kubesphere/notification-manager:$(VERSION)
AMD64 ?= -amd64
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
Expand Down Expand Up @@ -59,6 +59,7 @@ manifests: controller-gen
cd config/manager && kustomize edit set image controller=${IMG} && cd ../../
kustomize build config/default | sed -e '/creationTimestamp/d' > config/bundle.yaml
kustomize build config/samples | sed -e '/creationTimestamp/d' > config/samples/bundle.yaml
kustomize build config/update | sed -e '/creationTimestamp/d' > config/update/bundle.yaml

# Run go fmt against code
fmt:
Expand Down
67 changes: 64 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ A receiver could be configured without xxxConfigSelector, in which case Notifica
Deploy CRDs and the Notification Manager Operator:

```shell
kubectl apply -f https://raw.githubusercontent.com/kubesphere/notification-manager/v0.6.0/config/update/bundle.yaml
kubectl apply -f https://raw.githubusercontent.com/kubesphere/notification-manager/v0.7.0/config/bundle.yaml
```

### Deploy Notification Manager in KubeSphere (Uses `workspace` to distinguish each tenant user):
Expand All @@ -86,7 +86,7 @@ spec:
requests:
cpu: 100m
memory: 20Mi
image: kubesphere/notification-manager:v0.6.0
image: kubesphere/notification-manager:v0.7.0
imagePullPolicy: IfNotPresent
serviceAccountName: notification-manager-sa
portName: webhook
Expand Down Expand Up @@ -471,7 +471,7 @@ spec:
requests:
cpu: 100m
memory: 20Mi
image: kubesphere/notification-manager:v0.6.0
image: kubesphere/notification-manager:v0.7.0
imagePullPolicy: IfNotPresent
serviceAccountName: notification-manager-sa
portName: webhook
Expand Down Expand Up @@ -898,6 +898,67 @@ To receive Alertmanager alerts, add webhook config like below to the `receivers`
- "url": "http://notification-manager-svc.kubesphere-monitoring-system.svc:19093/api/v2/alerts"
```

### Update to v0.7.0

If there is already Notification Manager v0.1.x in the cluster, you can update it to v0.7.0 easily by following the steps below.

- Update the CRD and rbac.

```
kubectl apply -f https://raw.githubusercontent.com/kubesphere/notification-manager/release-0.7/config/update/bundle.yaml
```

- Change the notification-manager-operator image to `kubesphere/notification-manager-operator:v0.7.0`.

```
kubectl edit deployments.apps -n kubesphere-monitoring-system notification-manager-operator
```

- Create the template configmap.

```
kubectl apply -f https://raw.githubusercontent.com/kubesphere/notification-manager/release-0.7/config/samples/template.yaml
```

- Edit the notification manager.

```
kubectl edit notificationmanagers.notification.kubesphere.io -n kubesphere-monitoring-system notification-manager
```

Add the following.

```
spec:
image: kubesphere/notification-manager:v0.7.0
options:
global:
templateFile:
- /etc/notification-manager/template
volumeMounts:
- mountPath: /etc/notification-manager/
name: noification-manager-template
volumes:
- configMap:
defaultMode: 420
name: noification-manager-template
name: noification-manager-template
```

> After v0.6.0, notification manager use the new default template. If you want use the default template of v0.1.x, you can edit the notification manager as below.
```
spec:
options:
email:
template: email.default.html
subjectTemplate: email.default.subject
slack:
template: wechat.default.message
wechat:
template: wechat.default.message
```

## Development

```
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
latest
v0.7.0
2 changes: 1 addition & 1 deletion adapter/sink/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# notification-adapter

Notification-adapter receive notifications from notifcation manager and export with the socket.
Notification-adapter receive notifications from notification manager and then send it to a TCP endpoint.
2 changes: 1 addition & 1 deletion adapter/sink/deploy/yaml/adapter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: notification-adapter
image: kubespheredev/notification-adapter:latest
image: kubesphere/notification-adapter:v0.1.0
command:
- notification-adapter
- --ip=socket-server.kubesphere-monitoring-system
Expand Down
4 changes: 2 additions & 2 deletions config/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3597,8 +3597,8 @@ spec:
- --enable-leader-election
command:
- /notification-manager-operator
image: kubespheredev/notification-manager-operator:latest
imagePullPolicy: Always
image: kubesphere/notification-manager-operator:v0.7.0
imagePullPolicy: IfNotPresent
name: notification-manager-operator
resources:
limits:
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: kubespheredev/notification-manager-operator
newTag: latest
newName: kubesphere/notification-manager-operator
newTag: v0.7.0
4 changes: 2 additions & 2 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ spec:
- /notification-manager-operator
args:
- --enable-leader-election
image: controller:latest
imagePullPolicy: Always
image: controller:v0.7.0
imagePullPolicy: IfNotPresent
name: notification-manager-operator
resources:
limits:
Expand Down
4 changes: 2 additions & 2 deletions config/samples/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ spec:
defaultConfigSelector:
matchLabels:
type: default
image: kubespheredev/notification-manager:latest
imagePullPolicy: Always
image: kubesphere/notification-manager:v0.7.0
imagePullPolicy: IfNotPresent
portName: webhook
receivers:
globalReceiverSelector:
Expand Down
4 changes: 2 additions & 2 deletions config/samples/notification_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec:
requests:
cpu: 100m
memory: 20Mi
image: kubespheredev/notification-manager:latest
imagePullPolicy: Always
image: kubesphere/notification-manager:v0.7.0
imagePullPolicy: IfNotPresent
serviceAccountName: notification-manager-sa
portName: webhook
defaultConfigSelector:
Expand Down
Loading

0 comments on commit 1d9f073

Please sign in to comment.