Skip to content

Commit

Permalink
fix: helm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mc256 committed Nov 24, 2022
1 parent 5de18fa commit 28af2fe
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 37 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/debian-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
- 'v*.*.*'
jobs:
build:
runs-on: self-hosted
#runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY . .

ENV GO111MODULE=on

RUN make change-version-number set-production starlight-proxy-for-alpine && mkdir ./out/data
RUN make change-version-number set-production starlight-proxy-for-alpine

#CMD ["/go/src/app/out/starlight-proxy"]
FROM alpine:3.12 AS starlight-proxy
Expand All @@ -20,7 +20,9 @@ FROM golang:1.18 AS starlight-cli-build
WORKDIR /go/src/app
COPY . .

RUN make change-version-number set-production ctr-starlight-for-alpine && mkdir ./out/data
ENV GO111MODULE=on

RUN make change-version-number set-production ctr-starlight-for-alpine

FROM alpine:3.12 AS starlight-cli

Expand Down
1 change: 0 additions & 1 deletion cmd/starlight-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ information about Starlight, please visit our repository at https://github.com/m
// ----
&cli.StringFlag{
Name: "host",
Aliases: []string{"h"},
EnvVars: []string{"STARLIGHT_HOST"},
DefaultText: cfg.ListenAddress,
Usage: "host",
Expand Down
40 changes: 18 additions & 22 deletions demo/chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,44 @@ For more info, please visit https://github.com/mc256/starlight
__/ |
|___/

{{- if .Values.registry.enabled}}
You have enabled container registry.
{{- end}}

{{- if .Values.ingress.enabled }}
Get the application URL by running these commands:

{{ range $host := .Values.ingress.hosts }}
{{- range $host := .Values.ingress.hosts }}
Starlight Proxy : http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}
{{- if $.Values.registry.enabled }}
Container Registry : http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}/v2
{{- end }}
{{ end }}
{{- end }}

export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "starlight.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")

echo http://$SERVICE_IP
echo $SERVICE_IP

Please point your domain to $SERVICE_IP in your hosts file or DNS server.


The maximum upload size of the Nginx ingress has set to {{ index .Values.ingress.annotations "nginx.ingress.kubernetes.io/proxy-body-size" }}.
{{- else }}
You have not enabled ingress.
{{- end }}
{{ if .Values.postgres.enabled }}
You have enabled local postgresql.
In production environment, please consider using an external postgresql with porperly configured security and parition large tables.

{{ if .Values.adminer.enabled }}
A light-weight database management tool Adminer has been enabled.
{{- if .Values.postgres.enabled }}
--------------------------------------------------------------------------------
You have enabled a local PostgresQL database.
In production environment, please consider using an external postgresql with properly configured security and partition.
{{- if .Values.adminer.enabled }}

kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "starlight.fullname" . }}-adminer 8080:8080
--------------------------------------------------------------------------------
A light-weight database management tool Adminer has been enabled, to view the database content:

{{ end }}
{{ end }}
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "starlight.fullname" . }} 8080:8080
open it in http://localhost:8080/ and the default login credential is 'postgres'.

{{- end }}
{{- end }}

{{ if .Values.edge.enabled}}
You have enabled edge server.

The purpose of this deployment is to keep the Starlight CLI image on every edge node,
so that whever the user uses initContainer, there is a starlight CLI container for that.

Expand All @@ -58,8 +55,9 @@ You still need to install the Starlight daemon (containerd snapshotter) and enab
ON THE WORKER NODE:
1. Install the Starlight daemon

wget https://github.com/mc256/starlight/releases/download/v0.2.3/starlight_0.2.3_amd64.deb
sudo dpkg -i starlight_0.2.3_amd64.deb
echo ARCH=$(dpkg --print-architecture) # one of amd64, arm64, armhf
wget https://github.com/mc256/starlight/releases/download/v{{ .Chart.Version }}/starlight_{{ .Chart.Version }}_$ARCH.deb
sudo dpkg -i starlight_{{ .Chart.Version }}_$ARCH.deb
sudo systemctl enable starlight
sudo systemctl start starlight

Expand All @@ -80,10 +78,8 @@ ON THE WORKER NODE:

3. and restart the container
sudo systemctl restart containerd

{{ end}}


NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "starlight.fullname" . }}'

Expand Down
3 changes: 2 additions & 1 deletion demo/chart/templates/daemonset-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.edge.repository }}:{{ .Values.edge.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.edge.imagePullPolicy }}
command: {{ .Values.edge.command }}
command:
{{- toYaml .Values.edge.command | nindent 12 }}
resources:
{{- toYaml .Values.edge.resources | nindent 12}}
env:
Expand Down
22 changes: 13 additions & 9 deletions demo/chart/templates/deployment-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,20 @@ spec:
port: 8090
resources:
{{- toYaml .Values.starlightProxy.resources | nindent 12}}
#command: ["/bin/sh", "-ec", "while :; do echo '.'; sleep 60 ; done"]
command: ["/opt/starlight-proxy"]
args:
- --registry
- {{ .Values.starlightProxy.defaultRegistry | quote | default "http://container-registry.default.svc.cluster.local:5000" }}
- --log-level
- {{ .Values.starlightProxy.logLevel | quote | default "info" }}
- --postgres
- {{ .Values.starlightProxy.dbConnection | quote | default "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" }}
- --port
- "8090"
# args: ["--config", "/etc/starlight/proxy_config.json"]
env:
- name: STARLIGHT_HOST
value: "0.0.0.0"
- name: STARLIGHT_PORT
value: "8090"
- name: LOG_LEVEL
value: {{ .Values.starlightProxy.logLevel | quote | default "info" }}
- name: DB_CONNECTION_STRING
value: {{ .Values.starlightProxy.dbConnection | quote | default "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" }}
- name: REGISTRY
value: {{ .Values.starlightProxy.defaultRegistry | quote | default "http://container-registry.default.svc.cluster.local:5000" }}
{{- if .Values.postgres.enabled }}
############################################################
- name: starlight-metadata
Expand Down
2 changes: 2 additions & 0 deletions demo/chart/templates/deployment-registry.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.registry.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -68,3 +69,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end}}
2 changes: 1 addition & 1 deletion demo/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ starlightProxy:

# dbConnection specify
# Default is set to the postgres instance in the same deployment.
dbConnection: "postgres://postgres:postgres@postgres:5432/starlight?sslmode=disable"
dbConnection: "postgres://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable"
# logLevel is the log level for the proxy, options are: trace, debug, info, warn, error, fatal
logLevel: "info"
# defaultRegistry is the default registry when the full image name is not specified
Expand Down

0 comments on commit 28af2fe

Please sign in to comment.