Skip to content

Commit 9476192

Browse files
authored
Updates for release (#3)
1 parent 4cb4002 commit 9476192

File tree

4 files changed

+70
-9
lines changed

4 files changed

+70
-9
lines changed

Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ARG BASE
2+
FROM $BASE
3+
4+
###########################Add any other image customizations here #######################
5+
6+
#### Examples ####
7+
8+
### To install the nginx package for Ubuntu ###
9+
10+
#RUN apt-get update && apt-get install nginx
11+
12+
### or
13+
14+
### To install the nginx package for opensuse ###
15+
16+
#RUN zypper refresh && zypper install nginx

Earthfile

+10-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ FROM alpine
44
# Variables used in the builds. Update for ADVANCED use cases only
55
ARG OS_DISTRIBUTION
66
ARG OS_VERSION
7-
ARG IMAGE_REPOSITORY
7+
ARG IMAGE_REGISTRY
8+
ARG IMAGE_REPOSITORY=$OS_DISTRIBUTION
89
ARG K8S_DISTRIBUTION
910
ARG MY_ENVIRONMENT
1011
ARG STYLUS_VERSION=v3.3.3
@@ -28,7 +29,7 @@ build-all-images:
2829
BUILD +build-iso
2930

3031
build-provider-images:
31-
BUILD +provider-image --K8S_VERSION=1.24.7
32+
BUILD +provider-image --K8S_VERSION=1.24.6
3233
BUILD +provider-image --K8S_VERSION=1.25.2
3334

3435
build-iso:
@@ -55,7 +56,10 @@ build-iso:
5556
provider-image:
5657
# added PROVIDER_K8S_VERSION to fix missing image in ghcr.io/kairos-io/provider-*
5758
ARG PROVIDER_K8S_VERSION=1.25.2
59+
ARG IMAGE_REPOSITORY
5860
ARG K8S_VERSION
61+
ARG IMAGE_TAG=$K8S_DISTRIBUTION-$K8S_VERSION-$STYLUS_VERSION
62+
ARG IMAGE_PATH=$IMAGE_REGISTRY/$IMAGE_REPOSITORY-$MY_ENVIRONMENT:$IMAGE_TAG
5963
FROM +base-image
6064

6165
IF [ "$K8S_DISTRIBUTION" = "kubeadm" ]
@@ -75,7 +79,8 @@ provider-image:
7579
RUN touch /etc/machine-id \
7680
&& chmod 444 /etc/machine-id
7781

78-
SAVE IMAGE --push $IMAGE_REPOSITORY/$OS_DISTRIBUTION-$MY_ENVIRONMENT:$K8S_DISTRIBUTION-v$K8S_VERSION-$STYLUS_VERSION
82+
83+
SAVE IMAGE --push $IMAGE_PATH
7984

8085
elemental:
8186
FROM $OSBUILDER_IMAGE
@@ -126,7 +131,7 @@ base-image:
126131
ENV OS_ID=$OS_DISTRIBUTION
127132
ENV OS_VERSION=$OS_VERSION.04
128133
ENV OS_NAME=core-$OS_DISTRIBUTION-$OS_VERSION-lts-$K8S_DISTRIBUTION_TAG:$STYLUS_VERSION
129-
ENV OS_REPO=$IMAGE_REPOSITORY
134+
ENV OS_REPO=$IMAGE_REGISTRY
130135
ENV OS_LABEL=$KAIROS_VERSION_$K8S_VERSION_$SPECTRO_VERSION
131136
RUN envsubst >/etc/os-release </usr/lib/os-release.tmpl
132137
RUN apt update \
@@ -151,7 +156,7 @@ base-image:
151156
ENV OS_ID=$OS_DISTRIBUTION
152157
ENV OS_VERSION=15.4
153158
ENV OS_NAME=core-$OS_DISTRIBUTION-$K8S_DISTRIBUTION_TAG:$STYLUS_VERSION
154-
ENV OS_REPO=$IMAGE_REPOSITORY
159+
ENV OS_REPO=$IMAGE_REGISTRY
155160
ENV OS_LABEL=$KAIROS_VERSION_$K8S_VERSION_$SPECTRO_VERSION
156161
RUN envsubst >/etc/os-release </usr/lib/os-release.tmpl
157162
RUN zypper refresh \

README.md

+42-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,51 @@ The base image definitions reside in the Earthfile located in this repo. This d
1212
<br>
1313
<br>
1414

15-
## Knowledgebase
15+
## Image Build Architecture
16+
17+
### Base Image
18+
19+
From the Kairos project, this is derived from the operating system distribution chosen (currently Ubuntu and OpenSuse-Leap supported). It is pulled down as the base image and some adjustments are made to better support Palette. Those adjustments are used to clean and update the image as well as install some required packages.
20+
21+
### Provider Image
22+
23+
From the Base Image, the provider image is used to package in the Kubernetes distribution and version(s) that are part of the build. This layer is required to initialize the system and prepare it for configuration to build the Kubernetes cluster.
24+
25+
### Installer Image
26+
27+
From the base image, this image is used to provide the initial flashing of a device (bare-metal or virtual machine). This image contains the user-data configuration that has been provided in `user-data`. It will also contain the contents of any content bundle for pre-staged builds. Pre-staged builds can be used to embed all of the artifacts that are required to build a cluster. These artifacts include Helm charts, manifests, and container images. These images are loaded into containerd when the cluster is initialized elminating the need for the initial download. For more information on how to build pre-loaded content checkout the Palette Docs at [Build your Own Content](https://docs.spectrocloud.com/clusters/edge/edgeforge-workflow/build-content-bundle).
28+
29+
### Custom Configuration
30+
31+
For advanced use cases, there may be a need to add additional packages not included in the [Base Images](https://github.com/kairos-io/kairos/tree/master/images). If those packages or configuration elements need to be added, they can be included in the empty `Dockerfile` located in this repo and they will be included in the build process and output artifacts.
32+
33+
### Basic Usage
34+
35+
1. Clone this repo
36+
```shell
37+
[email protected]:spectrocloud/CanvOS.git
38+
```
39+
40+
2. Checkout the version you want.
41+
```shell
42+
git checkout <tag>
43+
```
44+
45+
3. Modify the `.arg` file as needed
46+
47+
4. Build the images
48+
```shell
49+
./earthly.sh +build-all-images
50+
```
51+
52+
5. Rename images if needed and push to your registry
53+
54+
6. Flash VM or Baremetal device with the generated ISO.
55+
56+
7. Build clusters in [Palette](https://console.spectrocloud.com)
1657

1758
### How-Tos
1859

1960
* [Building Edge Native Artifacts](https://docs.spectrocloud.com/knowledgebase/how-to/edge-native/edgeforge)
2061

2162
### Tutorials
22-

user-data.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ stylus:
88
edgeHostToken: aUAxxxxxxxxx0ChYCrO
99

1010
# projectUid <Optional :need to provide if token is not generated using project id>
11-
projectUid: 12345677788
12-
# tags which will be assigned to devices as labels
11+
projectName: stores
12+
# tags which will be assigned to devices as labels. These are examples
1313
tags:
1414
key1: value1
1515
key2: value2

0 commit comments

Comments
 (0)