Skip to content

Commit

Permalink
deploy: Update K8s for secrets
Browse files Browse the repository at this point in the history
Add secrets for storing the Mixpanel token in the K8s environment.
  • Loading branch information
saig0 committed Jul 20, 2023
1 parent 2b55c8e commit d7fd8db
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The API has the following endpoints:
- Type: `POST`
- Path: `/api/v1/feel/evaluate`

Request:
Request:

```json
{
Expand All @@ -41,7 +41,7 @@ Response:
- Type: `POST`
- Path: `/api/v1/feel-unary-tests/evaluate`

Request:
Request:

```json
{
Expand Down Expand Up @@ -89,6 +89,12 @@ kubectl create namespace feel
kubectl apply -f service.yaml -n feel
```

To deploy the secrets, edit `secret.yaml` and set `mixpanel_project_token` to your Mixpanel project token. Then run the following:

```shell
kubectl apply -f secret.yaml -n feel
```

To deploy the rest api, edit `deployment.yaml` and set `spec.template.spec.containers[0].img` to point
to the latest docker image. Then run the following:

Expand Down
6 changes: 6 additions & 0 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ spec:
port: 8080
initialDelaySeconds: 10
timeoutSeconds: 5
env:
- name: MIXPANEL_PROJECT_TOKEN
valueFrom:
secretKeyRef:
name: feel-scala-playground-secret
key: mixpanel_project_token
7 changes: 7 additions & 0 deletions k8s/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: feel-scala-playground-secret
type: Opaque
stringData:
mixpanel_project_token: x

0 comments on commit d7fd8db

Please sign in to comment.