diff --git a/.dockerignore b/.dockerignore index da2907e..730a315 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,4 +3,5 @@ out vendor sandbox -.github \ No newline at end of file +.github +my-values.yaml \ No newline at end of file diff --git a/.gitignore b/.gitignore index 88ac1fc..4baca75 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,6 @@ sandbox/ .idea .vscode -vendor/ \ No newline at end of file +vendor/ + +my-values.yaml \ No newline at end of file diff --git a/client/client.go b/client/client.go index 53557a8..f0918b2 100644 --- a/client/client.go +++ b/client/client.go @@ -1215,7 +1215,7 @@ func (s *StarlightDaemonAPIServer) NotifyProxy(ctx context.Context, req *pb.Noti }, nil } - err = s.client.Notify(req.Reference, reference) + err = s.client.Notify(req.ProxyConfig, reference) if err != nil { return &pb.NotifyResponse{ Success: false, diff --git a/demo/chart/templates/NOTES.txt b/demo/chart/templates/NOTES.txt index 1da818b..40d92c8 100644 --- a/demo/chart/templates/NOTES.txt +++ b/demo/chart/templates/NOTES.txt @@ -46,6 +46,7 @@ A light-weight database management tool Adminer has been enabled, to view the da {{- 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. @@ -55,7 +56,7 @@ You still need to install the Starlight daemon (containerd snapshotter) and enab ON THE WORKER NODE: 1. Install the Starlight daemon - echo ARCH=$(dpkg --print-architecture) # one of amd64, arm64, armhf + export 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 @@ -76,8 +77,35 @@ ON THE WORKER NODE: address = "/run/starlight/starlight-snapshotter.sock" EOF + If using k3s, please create `/var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl` and add the configuration. + 3. and restart the container + sudo systemctl restart containerd + + +4. Add Starlight Proxy to the edge node, test to see if it works + {{ range $host := .Values.ingress.hosts }} + ctr-starlight ap in-cluster http{{ if $.Values.ingress.tls }}s{{ end }} {{ $host }} + {{- end }} + ctr-starlight test in-cluster + +5. Convert Container Images (on the edge node) + + ctr-starlight convert \ + --insecure-destination --profile in-cluster --notify \ + --platform=linux/arm/v7,linux/amd64 \ + docker.io/library/redis:6.2.1 \ + starlight-registry.default.svc.cluster.local:5000/starlight/redis:6.2.1 + + ctr-starlight convert \ + --insecure-destination --profile in-cluster --notify\ + --platform=linux/arm/v7,linux/amd64 \ + docker.io/library/redis:6.2.2 \ + starlight-registry.default.svc.cluster.local:5000/starlight/redis:6.2.2 + + +-------------------------------------------------------------------------------- {{ end}} NOTE: It may take a few minutes for the LoadBalancer IP to be available. diff --git a/demo/chart/templates/daemonset-edge.yaml b/demo/chart/templates/daemonset-edge.yaml index 1b650be..173fb8e 100644 --- a/demo/chart/templates/daemonset-edge.yaml +++ b/demo/chart/templates/daemonset-edge.yaml @@ -42,8 +42,7 @@ spec: resources: {{- toYaml .Values.edge.resources | nindent 12}} env: - - name: CONTAINERD_NAMESPACE - value: "k8s.io" + {{- toYaml .Values.edge.env | nindent 12}} volumeMounts: - name: socket mountPath: /run/starlight diff --git a/demo/chart/values.yaml b/demo/chart/values.yaml index 4f72c4a..fad17c2 100644 --- a/demo/chart/values.yaml +++ b/demo/chart/values.yaml @@ -83,7 +83,7 @@ service: # Ingress ingress: enabled: true - className: "nginx" + ingressClassName: "nginx" annotations: # kubernetes.io/tls-acme: "true" # set to the largest layer size for uploading container image @@ -107,39 +107,7 @@ cloudAffinity: {} ######################################################################## # EDGE -######################################################################## -# 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. -# -# You still need to install the Starlight daemon (containerd snapshotter) and enable it on the edge node. -# -# 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 -# sudo systemctl enable starlight -# sudo systemctl start starlight -# -# -# -# 2. Configure the containerd to use Starlight as the snapshotter -# -# sudo mkdir -p /etc/containerd -# cat <= 1.4.13), linux-headers-generic (>= 5.15.0) +Recommends: containerd (>= 1.4.13) +Depends: linux-headers-generic (>= 5.15.0) Description: Starlight is an accelerator for provisioning container-based applications. diff --git a/docs/helm.md b/docs/helm.md index a1fc7cb..847cab4 100644 --- a/docs/helm.md +++ b/docs/helm.md @@ -3,10 +3,17 @@ ## TL;DR ```shell -helm upgrade --install -f starlight/values.yaml \ +helm show values oci://ghcr.io/mc256/starlight/starlight \ + --version 0.2.4 > ./my-values.yaml +``` + +Take a look at `./my-values.yaml` and edit it to your liking. Then run: + +``` +helm upgrade --install -f ./my-values.yaml \ starlight \ oci://ghcr.io/mc256/starlight/starlight \ - --version 0.2.3 + --version 0.2.4 ``` ## Prerequisites @@ -17,7 +24,7 @@ The current deployment has tested in this environment: - Helm 3.9.0+ - PV provisioner support in the underlying infrastructure - ReadWriteOnce volumes persistence storage -- Linux kernel 5.15.0+ +- Linux kernel 5.15.0+ (edge node) ## Introductions