You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we know, we can use the Kubefile to define a Sealer Image that can be shared and deployed, and the Kubefile has implemented the basic abilities. After that, we need to continue refining Kubefile and enriching its capabilities.
Let's first agree on what a complete Kubefile needs to contain. In my opinion, the following items need to be included:
Get files and put them in place, such as FROM, COPY, APP
Set default running commands and parameters, such as LAUNCH, CMDS
Add some declarations, including supported capabilities and any information you want to inform the Sealer Image user. However, we do not currently support such instructions.
Combined with the design in this PR, the following suggestions are made for the Kubefile and Sealer Image Spec definition
cluster image:
FROM sealerio/kubernetes:v1.22.15
# Override or provide CNI plugins, the syntax is same with `APP`. In fact, we can think of CNI as a special kind of `APP`.
# And multiple `CNI` definitions can be specified. If the name is the same, the last one takes precedence.
# In addition, the CNI plugin is not only an app, but also reflected in the label `cluster.alpha.sealer.io/kube-cni-xxx`.
CNI calico local://install-calico.sh
CNI calico local://install-calico-new.sh
CNI flannel local://flannel.yaml
# Override or provide CRI plugins just like `CNI`.
# In addition, the CNI plugin is not only an app, but also reflected in the label `cluster.alpha.sealer.io/kube-csi-xxx`.
CSI alibaba-cloud-csi-driver local://install-alibaba-cloud-csi-driver.sh
# Add some metadata to an image just like `Dockerfile LABEL instruction`.
# An image can have more than one label. You can specify multiple labels on a single line.
#
# NOTE:
# 1. In general, a base image should declare supported cluster runtimes, container runtimes, etc.
# 2. Sealer reserves all label keys prefixed with `sealer.io`.
# 3. All labels will be inherited by child image.
LABEL <key>=<value> <key>=<value> <key>=<value> ...
LABEL <key>=<value> \
<key>=<value> \
<key>=<value> ...
LABEL "cluster.alpha.sealer.io/cluster-runtime-version"="v1.22.15"
LABEL "cluster.alpha.sealer.io/cluster-runtime-type"="kubernetes" # such as kubernetes, k0s, k3s, etc
LABEL "cluster.alpha.sealer.io/container-runtime-type"="docker"
LABEL "cluster.alpha.sealer.io/container-runtime-version"="20.10.14"
# NOTE: we need a clear launch `CNI`, `CSI` here just like launch `APP`.
LAUNCH ["calico"]
FROM scratch
# A SemVer range of compatible Kubernetes versions by the applications.
# If there are multiple apps in the `Kubefile`, you should take the intersection of the cluster versions they support
# NOTE: This value will not be inherited.
# The label `app.alpha.sealer.io/supported-kube-version` will be gernetated with `KUBEVERSION`.
# For a detailed explanation of supported semver constraints see [Masterminds/semver](https://github.com/Masterminds/semver).
KUBEVERSION 1.22 - 1.24
# add redis app
# ["kubectl apply -f redis.yaml"] will be executed
APP redis local://redis.yaml
# add nginx app
# ["kubectl apply -f nginx.yaml -n nginx-namespace"] will be executed
APP nginx local://nginx.yaml
# `APPCMDS` specify the cmds for a specified app and the context is the dir of specified app.
# The `APPCMDS` instruction format: ["executable","param1","param2"]
# If there are more than one `APPCMDS` for a `APP` then only the last `APPCMDS` will take effect.
APPCMDS nginx ["kubectl apply -f nginx.yaml -n nginx-namespace"]
# add mysql app
# ["helm install mysql . -f values.yaml --set key=value"] will be executed
APP mysql local://charts/mysql/ local://values.yaml
# `APPCMDS` must be specified when the app has multiple files
APPCMDS mysql ["helm install mysql .", "-f values.yaml", "--set key=value"]
LABEL <key>=<value> <key>=<value> <key>=<value> ...
LABEL "created-by"="sealer.io"
# The following operation will be executed:
# ["kubectl apply -f nginx.yaml -n nginx-namespace", "helm install mysql . -f values.yaml --set key=value"]
LAUNCH ["nginx", "mysql"]
Add any other context or screenshots about the feature request here.
Describe what feature you want
Additional context
Add any other context or screenshots about the feature request here.
In my opinion, we have two remaining problems to resolve:
How to modify the container runtime configuration and cluster runtime configuration in the Sealer Kubefile? Currently, files in basefs can be overwritten by COPY instruction, however, it is not a very standard, user-friendly approach.
How to delete the app when we delete a Sealer image? So far the sealer delete is cluster-oriented, but now that we support running an app Sealer Image, we should support deleting an app Sealer Image as well. For helm and kube type apps, the deletion operation is also standard by helm uninstall or kubectl delete. However, how do we implement uninstallation operations for shell-type apps?
The text was updated successfully, but these errors were encountered:
Q: I learn that there will be only one APPCMDS for an app, will there be the situation that users need more than one execuation commands for a single app?
Issue Description
Type: feature request
Issue Description
Type: feature request
As we know, we can use the
Kubefile
to define aSealer Image
that can be shared and deployed, and theKubefile
has implemented the basic abilities. After that, we need to continue refiningKubefile
and enriching its capabilities.Let's first agree on what a complete
Kubefile
needs to contain. In my opinion, the following items need to be included:FROM
,COPY
,APP
LAUNCH
,CMDS
Sealer Image
user. However, we do not currently support such instructions.Combined with the design in this PR, the following suggestions are made for the
Kubefile
andSealer Image Spec
definitioncluster image:
cluster image spec:
app image:
app image spec
Describe what feature you want
Additional context
Add any other context or screenshots about the feature request here.
Describe what feature you want
Additional context
Add any other context or screenshots about the feature request here.
In my opinion, we have two remaining problems to resolve:
Sealer Kubefile
? Currently, files inbasefs
can be overwritten byCOPY
instruction, however, it is not a very standard, user-friendly approach.Sealer image
? So far thesealer delete
is cluster-oriented, but now that we support running an appSealer Image
, we should support deleting an appSealer Image
as well. Forhelm
andkube
type apps, the deletion operation is also standard byhelm uninstall
orkubectl delete
. However, how do we implement uninstallation operations for shell-type apps?The text was updated successfully, but these errors were encountered: