Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
slackclient updates and secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
staticdev committed Jun 25, 2019
1 parent 6ce976a commit c833dbf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ From your workspace, go to /apps/manage/custom-integrations and add Bots app. Th
## Run with Docker

```sh
sudo docker build -t staticdev/k8s-python-slackbot:0.0.1 .
sudo docker run --name k8s-python-slackbot -d -e SLACK_BOT_NAME=k8s-python-slackbot -e SLACK_BOT_TOKEN=mybot-token staticdev/k8s-python-slackbot:0.0.1
sudo docker build -t staticdev/k8s-python-slackbot:0.0.2 .
sudo docker run --name k8s-python-slackbot -d -e SLACK_BOT_NAME=k8s-python-slackbot -e SLACK_BOT_TOKEN=mybot-token staticdev/k8s-python-slackbot:0.0.2
```

## Run with Minikube
Expand All @@ -22,11 +22,19 @@ Start a new cluster using your favorite VM (kvm2 recommended) and build:
minikube start --vm-driver=kvm2
# build inside minikube
eval $(minikube docker-env)
docker build -t staticdev/k8s-python-slackbot:0.0.1 -f Dockerfile .
docker build -t staticdev/k8s-python-slackbot:0.0.2 -f Dockerfile .
```

Put your SLACK_BOT_NAME and SLACK_BOT_TOKEN in manifest.yaml and deploy using the command:
Create a slackbot.properties file in .env folder with the following structure:

```sh
SLACK_BOT_NAME=k8s-python-slackbot
SLACK_BOT_TOKEN=mybot-token
```

Deploy using the command:

```sh
kubectl create secret generic slackbot-secrets --from-env-file=.env/slackbot.properties
kubectl create -f manifest.yaml
```
22 changes: 6 additions & 16 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
apiVersion: v1
data:
SLACK_BOT_NAME: k8s-python-slackbot
SLACK_BOT_TOKEN: mybot-token
kind: ConfigMap
metadata:
labels:
name: slackbot-config
name: slackbot-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -29,16 +19,16 @@ spec:
- env:
- name: SLACK_BOT_NAME
valueFrom:
configMapKeyRef:
secretKeyRef:
key: SLACK_BOT_NAME
name: slackbot-config
name: slackbot-secrets
- name: SLACK_BOT_TOKEN
valueFrom:
configMapKeyRef:
secretKeyRef:
key: SLACK_BOT_TOKEN
name: slackbot-config
image: staticdev/k8s-python-slackbot:0.0.1
name: slackbot-secrets
image: staticdev/k8s-python-slackbot:0.0.2
name: slack
resources: {}
restartPolicy: Always
status: {}
status: {}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
slackclient==1.0.9
slackclient==1.3.1

0 comments on commit c833dbf

Please sign in to comment.