Skip to content

Commit

Permalink
fix: profile issues and helm docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mc256 committed Nov 24, 2022
1 parent 28af2fe commit a94bddb
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 44 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ out
vendor
sandbox

.github
.github
my-values.yaml
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ sandbox/
.idea
.vscode

vendor/
vendor/

my-values.yaml
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
30 changes: 29 additions & 1 deletion demo/chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions demo/chart/templates/daemonset-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 7 additions & 34 deletions demo/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <<EOF | sudo tee /etc/containerd/config.toml
# [plugins]
# [plugins."io.containerd.grpc.v1.cri".containerd]
# snapshotter = "starlight"
# [proxy_plugins]
# [proxy_plugins.starlight]
# type = "snapshot"
# address = "/run/starlight/starlight-snapshotter.sock"
# EOF
#
# 3. and restart the container
# sudo systemctl restart containerd
#
#
########################################################################\
edge:
enabled: true
# starlightCLI connects to the Starlight Daemon on the edge node via gRPC
Expand All @@ -149,6 +117,11 @@ edge:
# This keep the container running allows you to run some starlight-related commands on the edge node
command: ["/bin/sh", "-ec", "while :; do echo '.'; sleep 60 ; done"]
# Starlight CLI Default Environment Variables
env:
- name: CONTAINERD_NAMESPACE
value: "k8s.io"
- name: PATH
value: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt"

# select nodes in the edge
edgeTolerations: []
Expand Down
3 changes: 2 additions & 1 deletion demo/deb-package/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ Homepage: https://github.com/mc256/starlight

Package: starlight
Architecture: amd64
Depends: containerd (>= 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.
13 changes: 10 additions & 3 deletions docs/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a94bddb

Please sign in to comment.