Skip to content

Commit

Permalink
incorporate some initial feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorVin committed Feb 14, 2024
1 parent 9ade19b commit a0bea4d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ push-sandbox-image: image
push-image: image
docker push ${DOCKER_IMAGE}:latest

# if you want to use the sandbox repo, this target puts the files from this service in place. You will
# need to update the sandbox Makefile to get helm to load everything properly.
load-sandbox:
@cp sandbox/service.yaml "${SANDBOX_TEMPLATE_DIR}/skeleton-service.yaml"
@cp sandbox/deployment.yaml "${SANDBOX_TEMPLATE_DIR}/skeleton-deployment.yaml"
@cp sandbox/configmap.yaml "${SANDBOX_TEMPLATE_DIR}/skeleton-configmap.yaml"
@cp helm/values.yaml "${SANDBOX_TEMPLATE_DIR}/skeleton-values.yaml"
@cp helm/service.yaml "${SANDBOX_TEMPLATE_DIR}/skeleton-service.yaml"
@cp helm/deployment.yaml "${SANDBOX_TEMPLATE_DIR}/skeleton-deployment.yaml"
@cp helm/configmap.yaml "${SANDBOX_TEMPLATE_DIR}/skeleton-configmap.yaml"
@echo "Be sure to do a helm (re)load to get the service started"

# https://gist.github.com/prwhite/8168133
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### What is this?
This is a small service that exposes a toy RESTful API. It is intended to be a template or example for how we write this sort of code in FleetServices.
It also contains example configuration for other useful things such as:
1. Creating a Docker image
2. Launching the service image into our [sandbox](https://github.com/metal-toolbox/sandbox) environment. See the [helm](./helm) directory.
3. Typical pull-request workflow (linting, building, code-analysis)
4. Creating a release image of the software for deployment to Kubernetes.

### How do I use it?
That depends on what you want to do.
- You can clone this repo as a template service, make your modifications, and push it to a new repo on Github.com.
- You can get a sense of how we handle common tasks (like using [gin](https://gin-gonic.com) or [zap](https://pkg.go.dev/go.uber.org/zap)) without being overwhelmed by details of a non-trivial service.
- You can propose new conventions (such as adding a client for [NATS](https://nats.io) or [FleetDB](https://github.com/metal-toolbox/fleetdb))
- You can launch this service into our [kind](https://kind.sigs.k8s.io) sandbox by doing `helm install skeleton-test helm` from the root of this repo. Port-forward to your local environment to test the API by hand, or configure service-to-service tests with other services in kind.

Much of the functionality is encapsulated into `Makefile` targets. On the one hand this is a pretty clear abuse of `make`, but on the other we do it in many other repositories. `make` will tab-prompt the user with potential targets (e.g. `build`, `image`, `push-sandbox-image` et al.)

I hope it serves to reduce the friction of getting a service into production for you.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a0bea4d

Please sign in to comment.