-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5262204
commit 291d5dc
Showing
6 changed files
with
162 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
node_modules/ | ||
.score-compose/ | ||
compose.yaml | ||
compose.yaml | ||
.score-k8s/ | ||
manifests.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,36 @@ | ||
# Score - ${{ values.name | capitalize }} | ||
|
||
A simple score project deploying a hello world app. | ||
The workload is a simple containerized NodeJS app talking to a MySQL database. | ||
|
||
[Score](https://score.dev/) is used to deploy the workload locally with `score-compose` in Docker, with `score-k8s` in Kubernetes or with `humctl` in Humanitec. See [Makefile](Makefile) for more details. | ||
|
||
## Deploying | ||
|
||
[Score](https://score.dev/) is used to deploy the workload to humanitec. | ||
Locally: | ||
```bash | ||
make compose-up | ||
|
||
make compose-test | ||
``` | ||
|
||
In Kubernetes (`Kind`): | ||
```bash | ||
make kind-create-cluster | ||
|
||
make kind-load-image | ||
|
||
make k8s-up | ||
|
||
make k8s-test | ||
``` | ||
|
||
In Humanitec: | ||
```bash | ||
humctl login | ||
|
||
## The Workload | ||
humctl config set org FIXME | ||
humctl config set app ${{ values.name }} | ||
humctl config set app development | ||
|
||
The workload is a simple nodejs app which is dockerized. | ||
make htc-up | ||
``` |
35 changes: 35 additions & 0 deletions
35
templates/node-service/content/scripts/setup-kind-cluster.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
set -o errexit | ||
|
||
cat <<EOF | kind create cluster --config=- | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
extraPortMappings: | ||
- containerPort: 31000 | ||
hostPort: 80 | ||
protocol: TCP | ||
EOF | ||
|
||
kubectl apply \ | ||
-f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml | ||
|
||
helm install ngf oci://ghcr.io/nginxinc/charts/nginx-gateway-fabric \ | ||
--create-namespace \ | ||
-n nginx-gateway \ | ||
--set service.type=NodePort \ | ||
--set-json 'service.ports=[{"port":80,"nodePort":31000}]' | ||
|
||
kubectl apply -f - <<EOF | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: default | ||
spec: | ||
gatewayClassName: nginx | ||
listeners: | ||
- name: http | ||
port: 80 | ||
protocol: HTTP | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,36 @@ | ||
# Podinfo - ${{ values.name | capitalize }} | ||
|
||
A simple score project deploying podinfo. | ||
The workload is the `podinfo` container image. | ||
|
||
[Score](https://score.dev/) is used to deploy the workload locally with `score-compose` in Docker, with `score-k8s` in Kubernetes or with `humctl` in Humanitec. See [Makefile](Makefile) for more details. | ||
|
||
## Deploying | ||
|
||
[Score](https://score.dev/) is used to deploy the workload to humanitec. | ||
Locally: | ||
```bash | ||
make compose-up | ||
|
||
make compose-test | ||
``` | ||
|
||
In Kubernetes (`Kind`): | ||
```bash | ||
make kind-create-cluster | ||
|
||
make kind-load-image | ||
|
||
make k8s-up | ||
|
||
make k8s-test | ||
``` | ||
|
||
In Humanitec: | ||
```bash | ||
humctl login | ||
|
||
humctl config set org FIXME | ||
humctl config set app ${{ values.name }} | ||
humctl config set app development | ||
|
||
make htc-up | ||
``` |