-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI refresh, helm chart, tiltfile (#5)
* UI refresh, helm chart, tiltfile * chore: add helm to tool versions * fix: code block style * use latest helm version * some ui fixes --------- Co-authored-by: Alessio Pragliola <alessio.pragliola@sighup.io>
- Loading branch information
1 parent
0c04880
commit 6492fe1
Showing
27 changed files
with
1,264 additions
and
212 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,6 @@ | ||
golang 1.22.1 | ||
make 4.4.1 | ||
goreleaser 1.24.0 | ||
tilt 0.33.11 | ||
ctlptl 0.8.28 | ||
helm 3.14.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
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
load("ext://helm_resource", "helm_repo", "helm_resource") | ||
load("ext://restart_process", "docker_build_with_restart") | ||
load("ext://namespace", "namespace_create") | ||
|
||
# Set default trigger mode to manual | ||
trigger_mode(TRIGGER_MODE_MANUAL) | ||
|
||
# Disable analytics | ||
analytics_settings(False) | ||
|
||
# Disable secrets scrubbing | ||
secret_settings(disable_scrub=True) | ||
|
||
# Allow only gangplank k8s context | ||
allow_k8s_contexts("kind-gangplank") | ||
|
||
# Create the namespaces | ||
namespace_create("gangplank") | ||
namespace_create("dex") | ||
|
||
k8s_resource( | ||
new_name="namespaces", | ||
objects=["gangplank:namespace","dex:namespace"], | ||
) | ||
|
||
helm_repo( | ||
name="dex", | ||
url="https://charts.dexidp.io", | ||
resource_name="dex-repo", | ||
) | ||
|
||
helm_resource( | ||
name="dex", | ||
chart="dex/dex", | ||
release_name="dex", | ||
namespace="dex", | ||
flags=["--values", "./configs/helm-values/dex.yaml", "--version=0.16.0"], | ||
deps=["namespaces", "dex-repo"], | ||
) | ||
|
||
k8s_resource( | ||
workload="dex", | ||
port_forwards=["5556:5556"], | ||
) | ||
|
||
helm_resource( | ||
name="gangplank", | ||
chart="./deployments/helm", | ||
release_name="gangplank", | ||
image_deps=["gangplank"], | ||
image_keys=[ | ||
("image.repository", "image.tag"), | ||
], | ||
namespace="gangplank", | ||
deps=["namespaces"], | ||
flags=['--values', "./configs/helm-values/gangplank.yaml"], | ||
) | ||
|
||
docker_build_with_restart( | ||
ref="gangplank", | ||
context=".", | ||
dockerfile="Dockerfile-dev", | ||
live_update=[ | ||
sync("./cmd", "/src/cmd"), | ||
sync("./internal", "/src/internal"), | ||
sync("./static", "/src/static"), | ||
sync("./templates", "/src/templates"), | ||
sync("./go.mod", "/src/go.mod"), | ||
sync("./go.sum", "/src/go.sum"), | ||
], | ||
entrypoint=["go", "run", "./cmd/gangplank"], | ||
) | ||
|
||
k8s_resource( | ||
workload="gangplank", | ||
port_forwards=["8080:8080"], | ||
trigger_mode=TRIGGER_MODE_AUTO | ||
) |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2017-present SIGHUP s.r.l | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: ctlptl.dev/v1alpha1 | ||
kind: Cluster | ||
product: kind | ||
registry: gangplank-registry | ||
kindV1Alpha4Cluster: | ||
name: gangplank | ||
nodes: | ||
- role: control-plane | ||
image: kindest/node:v1.29.2 |
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,33 @@ | ||
# Copyright 2017-present SIGHUP s.r.l | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
config: | ||
issuer: http://localhost:5556 | ||
storage: | ||
type: memory | ||
enablePasswordDB: true | ||
|
||
staticClients: | ||
- id: gangplank | ||
secret: gangplank | ||
name: Gangplank | ||
redirectURIs: | ||
- http://localhost:8080/callback | ||
|
||
staticPasswords: | ||
- email: admin@gangplank.test | ||
# bcrypt hash of the string "password": $(echo password | htpasswd -BinC 10 admin | cut -d: -f2) | ||
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W" | ||
username: admin | ||
userID: 08a8684b-db88-4b73-90a9-3cd1661f5466 |
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,25 @@ | ||
# Copyright 2017-present SIGHUP s.r.l | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
command: | ||
["go", "run", "./cmd/gangplank", "-config", "/etc/gangplank/config.yaml"] | ||
|
||
config: | ||
authorizeURL: http://localhost:5556/auth | ||
tokenURL: http://dex.dex:5556/token | ||
audience: http://dex.dex:5556/userinfo | ||
redirectURL: http://localhost:8080/callback | ||
usernameClaim: email | ||
clientID: gangplank | ||
clientSecret: gangplank |
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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,20 @@ | ||
# Copyright 2017-present SIGHUP s.r.l | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: v2 | ||
name: gangplank | ||
description: A Helm chart for Gangplank | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "0.1.0" |
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,51 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "gangplank.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "gangplank.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "gangplank.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "gangplank.labels" -}} | ||
helm.sh/chart: {{ include "gangplank.chart" . }} | ||
{{ include "gangplank.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "gangplank.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "gangplank.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
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,9 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "gangplank.fullname" . }} | ||
labels: | ||
{{- include "gangplank.labels" . | nindent 4 }} | ||
data: | ||
config.yaml: | | ||
{{- toYaml .Values.config | nindent 4 }} |
Oops, something went wrong.