-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial start script and dummy app
- Loading branch information
0 parents
commit 3090b5c
Showing
7 changed files
with
119 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
docker: | ||
permissions: | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actore }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: get-glu/gitops-example/app:latest |
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,7 @@ | ||
FROM golang:1.23 | ||
|
||
ADD . . | ||
|
||
RUN go build -o /bin/app ./... | ||
|
||
CMD "/bin/app" |
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,3 @@ | ||
module get-glu/gitops-example/app | ||
|
||
go 1.23.3 |
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,16 @@ | ||
package main | ||
|
||
import ( | ||
"log/slog" | ||
"net/http" | ||
) | ||
|
||
func main() { | ||
http.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
w.Write([]byte(`<html><body><h1>Welcome!</h1></body></html>`)) | ||
})) | ||
|
||
slog.Info("Starting server", "addr", ":8080") | ||
|
||
http.ListenAndServe(":8080", nil) | ||
} |
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,21 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
labels: | ||
app: nginx | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 |
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,27 @@ | ||
#!/bin/sh | ||
|
||
set -x | ||
|
||
kind create cluster \ | ||
--wait 120s \ | ||
--config - <<EOF | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
name: glu-gitops-example | ||
nodes: | ||
- extraPortMappings: | ||
- containerPort: 30080 # example application | ||
hostPort: 30080 | ||
EOF | ||
|
||
if ! command -v go 2>&1 >/dev/null; then | ||
echo "Please install Go (>=1.23)" | ||
exit 1 | ||
fi | ||
|
||
if ! command -v timoni 2>&1 >/dev/null; then | ||
go install github.com/stefanprodan/timoni/cmd/timoni@latest | ||
fi | ||
|
||
timoni bundle apply --kube-context kind-glu-gitops-example -f timoni/flux-aio.cue |
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,19 @@ | ||
bundle: { | ||
apiVersion: "v1alpha1" | ||
name: "flux-aio" | ||
instances: { | ||
"flux": { | ||
module: url: "oci://ghcr.io/stefanprodan/modules/flux-aio" | ||
namespace: "flux-system" | ||
values: { | ||
controllers: { | ||
helm: enabled: true | ||
kustomize: enabled: true | ||
notification: enabled: true | ||
} | ||
hostNetwork: false | ||
securityProfile: "privileged" | ||
} | ||
} | ||
} | ||
} |