Skip to content

Commit

Permalink
chore: minor readme updates and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps committed Oct 8, 2023
1 parent 8d0ee39 commit f0e0f46
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 19 deletions.
3 changes: 2 additions & 1 deletion chatbot/scripts/start
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

set -e

cd "$(dirname "$0")/.."

pushd frontend
npm i && npm run start
popd
19 changes: 10 additions & 9 deletions cup/argo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ This labs section explores configuring an end-to-end CD pipeline with Argo and C

![Cup with ArgoCD Diagram](./diagram.svg)

https://github.com/flipt-io/labs/assets/1253326/4dfb87ec-446c-40dc-84d1-2764bd600fd1
<https://github.com/flipt-io/labs/assets/1253326/4dfb87ec-446c-40dc-84d1-2764bd600fd1>

The project deploys a simple application via Argo, which responds with a JSON payload containing its environment variables.
It also configures an instance of Cup and a source Git repository hosted via Gitea.

Once deployed to a local `kind` cluster, you can experiment with reading and reconfiguring the deployment configuration via the `cup` CLI.

### Requirements
## Prerequisites

- Go
- Kubectl
- Docker
- [Docker](https://www.docker.com/)
- [Kubectl](https://kubernetes.io/docs/reference/kubectl/)
- [Minikube](https://minikube.sigs.k8s.io/docs/)
- [Cup CLI](https://github.com/flipt-io/cup#cli)
- Dagger (Optional)
- [Dagger](https://dagger.io/) (Optional)

### Running
## Running

```console
# clone the labs repository
Expand All @@ -33,7 +34,7 @@ cd labs/cup/argo
./scripts/start
```

### Experiment!
## Experiment

This process can take a while for the first time.

Expand All @@ -47,8 +48,8 @@ It will:
- Port-forward the various services
- [ArgoCD](http://localhost:8080) (Skip the TLS warning check output from previous step for username and password)
- [Gitea](http://localhost:3000) (Username: `cup` Password: `password`)
- Cupd API is forwarded to http://localhost:8181
- Demo app API is forwarded to http://localhost:8282
- Cupd API is forwarded to <http://localhost:8181>
- Demo app API is forwarded to <http://localhost:8282>

The end result is an entire CD pipeline in your local Docker instance.
From here you can leverage the `cup` CLI to interface with `cupd`.
Expand Down
3 changes: 3 additions & 0 deletions cup/argo/scripts/start
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
set -e

cd "$(dirname "$0")/.."

if command -v dagger > /dev/null; then
dagger run go run ./cmd/provision/main.go
Expand Down
15 changes: 8 additions & 7 deletions sidecar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ This project is housed under the `replication` directory. The purpose is for a u

Lets get started!

Prerequisites:
## Prerequisites

- [Docker](https://www.docker.com/)
- [Kubectl](https://kubernetes.io/docs/reference/kubectl/)
- [Minikube](https://minikube.sigs.k8s.io/docs/)
Expand All @@ -21,6 +22,7 @@ Run the deploy script `scripts/start-object-store` to provision the cluster and
<img src="./replication/diagrams/diagram-object-store.svg" alt="Object Store Replication" width="500px" />

This above script deploys the following to Kubernetes:

- `minio`: Object store that has an S3 compatible API
- `flipt-master`: Serves as the main Flipt application, this is where users will be accessing the UI to make relevant changes
- `sample-app`: Serves as the pod with Flipt running as a sidecar, `flipt-sidecar`. There is also a container called `evaluation-client` that will make evaluation calls to the sidecar
Expand All @@ -45,16 +47,15 @@ Here are the steps to do so:
1. Access the frontend for the `sample-app` via Kubernetes port-forward

```bash
$ kubectl port-forward svc/sample-app --namespace default 8000:8000
kubectl port-forward svc/sample-app --namespace default 8000:8000
```

2. Switch between `Sidecar` and `Master` and choose a flag `flag_001 - flag_010` and evaluate the time difference


You can also access the `flipt-master` via Kubernetes port-forward and make changes to the state via the UI:

```bash
$ kubectl port-forward svc/flipt-master --namespace default 8080:8080
kubectl port-forward svc/flipt-master --namespace default 8080:8080
```

### cURL
Expand All @@ -64,13 +65,13 @@ For users of the terminal you can also hit an endpoint to see the differences of
1. Port forward `sample-app`

```bash
$ kubectl port-forward svc/sample-app --namespace default 8000:8000
kubectl port-forward svc/sample-app --namespace default 8000:8000
```

2. Make request with `curl`

```bash
$ curl localhost:8000/cli/backend/{backend}/evaluation/{flagKey}
curl localhost:8000/cli/backend/{backend}/evaluation/{flagKey}
```

The backend should be of either type (`sidecar` or `master`), and the `flagKey` should be between `flag_001 - flag_010`.
The backend should be of either type (`sidecar` or `master`), and the `flagKey` should be between `flag_001 - flag_010`.
2 changes: 1 addition & 1 deletion sidecar/replication/go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM golang:1.21-alpine
WORKDIR /app

COPY go.* .
COPY index.tmpl .
COPY index.html.tmpl .
COPY main.go .

RUN go build -o /evaluation-client
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion sidecar/replication/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"google.golang.org/grpc/status"
)

//go:embed index.tmpl
//go:embed index.html.tmpl
var indexTmplContent string

var t = template.Must(template.New("").Parse(indexTmplContent))
Expand Down

0 comments on commit f0e0f46

Please sign in to comment.