diff --git a/slack-infra/README.md b/slack-infra/README.md index f3c65fcba0a..fabe7a6b0bd 100644 --- a/slack-infra/README.md +++ b/slack-infra/README.md @@ -4,6 +4,7 @@ Cluster resources to deploy the following apps from [kubernetes-sigs/slack-infra - slack-event-log - slack-moderator +- slack-moderator-words - slack-welcomer - slack-post-message - slackin diff --git a/slack-infra/resources/ingress.yaml b/slack-infra/resources/ingress.yaml index 9c9bcd4b235..0d6eceba40e 100644 --- a/slack-infra/resources/ingress.yaml +++ b/slack-infra/resources/ingress.yaml @@ -29,3 +29,7 @@ spec: backend: serviceName: slack-post-message servicePort: 80 + - path: /infra/moderator-words/* + backend: + serviceName: slack-moderator-words + servicePort: 80 diff --git a/slack-infra/resources/slack-event-log/deployment.yaml b/slack-infra/resources/slack-event-log/deployment.yaml index 1310d485a6f..46bfe637a58 100644 --- a/slack-infra/resources/slack-event-log/deployment.yaml +++ b/slack-infra/resources/slack-event-log/deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: slack-event-log - image: gcr.io/k8s-staging-slack-infra/slack-event-log:v20200612-1c5d751 + image: gcr.io/k8s-staging-slack-infra/slack-event-log:v20210223-8525eb3 args: - --config-path=/etc/slack-event-log/config.json ports: diff --git a/slack-infra/resources/slack-moderator-words/deployment.yaml b/slack-infra/resources/slack-moderator-words/deployment.yaml new file mode 100644 index 00000000000..c2192a1169c --- /dev/null +++ b/slack-infra/resources/slack-moderator-words/deployment.yaml @@ -0,0 +1,45 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: slack-moderator-words + labels: + app: slack-moderator-words +spec: + replicas: 2 + selector: + matchLabels: + app: slack-moderator-words + template: + metadata: + labels: + app: slack-moderator-words + spec: + containers: + - name: slack-moderator-words + image: gcr.io/k8s-staging-slack-infra/slack-moderator-words:v20210223-8525eb3 + args: + - --config-path=/etc/slack-moderator-words/config.json + - --filter-config-path=/etc/filters/filters.yaml + ports: + - containerPort: 8080 + protocol: TCP + env: + - name: PATH_PREFIX + value: /infra/moderator-words + volumeMounts: + - mountPath: /etc/slack-moderator-words + name: config + - mountPath: /etc/filters + name: filters + readinessProbe: + httpGet: + path: /healthz + scheme: HTTP + port: 8080 + volumes: + - name: config + secret: + secretName: slack-moderator-words-config + - name: filters + configMap: + name: slack-moderator-words-filters diff --git a/slack-infra/resources/slack-moderator-words/filters.yaml b/slack-infra/resources/slack-moderator-words/filters.yaml new file mode 100644 index 00000000000..bfa44179e80 --- /dev/null +++ b/slack-infra/resources/slack-moderator-words/filters.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: slack-moderator-words-filters +data: + filters.yaml: |- + - triggers: + - guys + action: chat.postEphemeral + message: "May I suggest \"all\" instead of \"guys\" when addessing a group of people? Thank you. :slightly_smiling_face:" diff --git a/slack-infra/resources/slack-moderator-words/service.yaml b/slack-infra/resources/slack-moderator-words/service.yaml new file mode 100644 index 00000000000..05b26e1cc16 --- /dev/null +++ b/slack-infra/resources/slack-moderator-words/service.yaml @@ -0,0 +1,12 @@ +kind: Service +apiVersion: v1 +metadata: + name: slack-moderator-words +spec: + selector: + app: slack-moderator-words + type: NodePort + ports: + - protocol: TCP + port: 80 + targetPort: 8080 diff --git a/slack-infra/resources/slack-moderator/deployment.yaml b/slack-infra/resources/slack-moderator/deployment.yaml index 5e1a74666a2..096b2eea13d 100644 --- a/slack-infra/resources/slack-moderator/deployment.yaml +++ b/slack-infra/resources/slack-moderator/deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: slack-moderator - image: gcr.io/k8s-staging-slack-infra/slack-moderator:v20200612-1c5d751 + image: gcr.io/k8s-staging-slack-infra/slack-moderator:v20210223-8525eb3 args: - --config-path=/etc/slack-moderator/config.json ports: diff --git a/slack-infra/resources/slack-post-message/deployment.yaml b/slack-infra/resources/slack-post-message/deployment.yaml index 79fe43bf039..36d97640a7b 100644 --- a/slack-infra/resources/slack-post-message/deployment.yaml +++ b/slack-infra/resources/slack-post-message/deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: slack-post-message - image: gcr.io/k8s-staging-slack-infra/slack-post-message:v20200901-117c06f + image: gcr.io/k8s-staging-slack-infra/slack-post-message:v20210223-8525eb3 args: - --config-path=/etc/slack-post-message/config.json ports: diff --git a/slack-infra/resources/slack-welcomer/deployment.yaml b/slack-infra/resources/slack-welcomer/deployment.yaml index 63b38f90848..7df800574d4 100644 --- a/slack-infra/resources/slack-welcomer/deployment.yaml +++ b/slack-infra/resources/slack-welcomer/deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: slack-moderator - image: gcr.io/k8s-staging-slack-infra/slack-welcomer:v20200612-1c5d751 + image: gcr.io/k8s-staging-slack-infra/slack-welcomer:v20210223-8525eb3 args: - --config-path=/etc/slack-welcomer/config.json - --message-path=/etc/welcome-message/welcome.md