Build, Share and Run Both Your Kubernetes Cluster and Distributed Applications (Project under CNCF) http://sealer.cool/
天问 c9a145dd12 Update 'README.md' | 1 year ago | |
---|---|---|
README.md | 1 year ago |
Build, Share and Run Both Your Kubernetes Cluster and Distributed Applications (Project under CNCF)
sealer 是阿里巴巴开源的集群镜像的一个实现方式
Sealer[ˈsiːlər] provides a new way of distributed application delivery which is reducing the difficulty and complexity by packaging Kubernetes cluster and all application's dependencies into one ClusterImage.
We can write a Kubefile to build the ClusterImage, and use it to deliver your applications with embedded Kubernetes through Clusterfile.
Concept
Download sealer binary file.
#install Sealer binaries
wget https://github.com/sealerio/sealer/releases/download/v0.9.3/sealer-v0.9.3-linux-amd64.tar.gz && \
tar zxvf sealer-v0.9.3-linux-amd64.tar.gz && mv sealer /usr/bin
# run a kubernetes cluster
sealer run docker.io/sealerio/kubernetes:v1-22-15-sealerio-2 \
--masters 192.168.0.2,192.168.0.3,192.168.0.4 \
--nodes 192.168.0.5,192.168.0.6,192.168.0.7 --passwd xxx
Kubefile:
FROM docker.io/sealerio/kubernetes:v1-22-15-sealerio-2
APP mysql https://charts/mysql.tgz
APP elasticsearch https://charts/elasticsearch.tgz
APP redis local://redis.yaml
APP businessApp local://install.sh
LAUNCH ["calico", "mysql", "elasticsearch", "redis", "businessApp"]
or
FROM docker.io/sealerio/kubernetes:v1-22-15-sealerio-2
COPY mysql.tgz .
COPY elasticsearch.tgz .
COPY redis.yaml .
COPY install.sh .
CMDS ["sh application/apps/calico/calico.sh", "helm install mysql.tgz", "helm install elasticsearch.tgz", "kubectl apply -f redis.yaml", "bash install.sh"]
build command:
NOTE: --type=kube-installer is the default value for sealer build
sealer build -f Kubefile -t my-kubernetes:1.0.0 .
nginx.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-nginx
namespace: default
spec:
replicas: 1
selector:
matchLabels:
run: my-nginx
template:
metadata:
labels:
run: my-nginx
spec:
containers:
- name: my-nginx
image: nginx
ports:
- containerPort: 80
Kubefile:
FROM scratch
APP nginx local://nginx.yaml
LAUNCH ["nginx"]
sealer build -f Kubefile -t sealer-io/nginx:latest --type app-installer
sealer run sealer-io/nginx:latest
# check the pod
kubectl get pod -A
# you can push the app image to docker hub, Ali ACR, or Harbor
sealer tag sealer-io/nginx:latest {registryDomain}/sealer-io/nginx:latest
sealer push {registryDomain}/sealer-io/nginx:latest
Some information of the basic settings will be written to the Clusterfile and stored in /root/.sealer/Clusterfile.
sealer delete -a
Sealer provides a valid image list:
version | image | Arch | OS | Network plugins | container runtime |
---|---|---|---|---|---|
v0.8.6 | registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.22.15-0.8.6 | x86 | CentOS/RHEL 7.5 CentOS/RHEL 7.6 CentOS/RHEL 7.7 CentOS/RHEL 7.8 CentOS/RHEL 7.9 Ubuntu 20.04 |
calico | hack docker v19.03.14 |
v0.9.3 | docker.io/sealerio/kubernetes:v1-18-3-sealerio-2 | x86/arm64 | CentOS/RHEL 7.5 CentOS/RHEL 7.6 CentOS/RHEL 7.7 CentOS/RHEL 7.8 CentOS/RHEL 7.9 Ubuntu 20.04 |
calico | hack docker v19.03.14 |
v0.9.3 | docker.io/sealerio/kubernetes:v1-20-4-sealerio-2 | x86/arm64 | CentOS/RHEL 7.5 CentOS/RHEL 7.6 CentOS/RHEL 7.7 CentOS/RHEL 7.8 CentOS/RHEL 7.9 Ubuntu 20.04 |
calico | hack docker v19.03.14 |
v0.9.3 | docker.io/sealerio/kubernetes:v1-22-15-sealerio-2 | x86/arm64 | CentOS/RHEL 7.5 CentOS/RHEL 7.6 CentOS/RHEL 7.7 CentOS/RHEL 7.8 CentOS/RHEL 7.9 Ubuntu 20.04 |
calico | hack docker v19.03.14 |