Creating SINA package #
sina create #
To create a sina package, you must first run the sina create
command in your directory.
The sina create
command creates four files (package.yaml, template.yaml, logo.png and docs.tgz) in the current directory. These files can be edited.
[root@localhost ~]# sina create
Created files:
- package.yaml - Defines properties of the SINA package. (see below)
- template.yaml - Required if the template engine Scriban is to be used.
- logo.png - A package-thumbnail with the size of 50x50px, for showing logo on the KubeOpsHub.
- docs.tgz - A zipped directory with the documentation of the package, for showing documentation on the KubeOpsHub.
The documentation of the package is written in markdown. The file for the documentation is called readme.md.
To edit the markdown, you can unzip the docs.tgz in your directory with the commandtar -xzf docs.tgz
and zip it again with the commandtar -czf docs.tgz docs/
after you finished.
Note: Please name your markdown files inside docs.tgz without a version-tag (docs/documentation-1.0.0.md).
Do not change the file names of any of the files above generated with thesina create
command.
package.yaml #
The package.yaml defines a package in a specific version as well as the tasks needed to install it. The tasks which are used in the package.yaml are plugins, which can be created by the user.
Elements:
includes.files
: Describes the files which are inluded in the SINA package.includes.containers
: Used for docker images. A container for the docker images will be created when thesina install
,sina update
orsina delete
command is used.installation.tasks
: The tree describes the tasks (SINA plugins), which are executed with thesina install
command.update.tasks
: The tree describes the tasks (SINA plugins), which are executed with thesina update
command.delete.tasks
: The tree describes the tasks (SINA plugins), which are executed with thesina delete
command.
IMPORTANT: It is required to enter the package name in lowercase.
Do not use any docker tags (:v1.0.0) in your package name.
Example package.yaml #
apiversion: kubernative/kubeops/sina/user/v3 # Required field
name: sina-example-packagev3 # Required field
description: sina-example-package # Required field
version: 0.1.0 # Required field
includes: # Required field: When "files" or "containers" are needed.
files: # Optional field: IF file is attached, e.g. "rpm, .extension"
input: "template.yaml"
containers: # Optional field: When "containers" are needed.
example:
registry: docker.io
image: nginx
tag: latest
docs: docs.tgz
logo: logo.png
installation: # Required field
includes: # Optional field: When "files" or "containers" are needed.
files: # Optional field:
- input # Reference to includes
containers: # Optional field:
- example # Reference to includes
tasks:
- cmd:
command: "touch ~/sinaExample1"
update: # Required field
includes: # Optional field: When "files" or "containers" are needed.
files: # Optional field:
- input # Reference to includes
containers: # Optional field:
- example # Reference to includes
tasks:
- cmd:
command: "touch ~/sinaExample2"
delete: # Required field
includes: # Optional field: When "files" or "containers" are needed.
files: # Optional field:
- input # Reference to includes
containers: # Optional field:
- example # Reference to includes
tasks:
- cmd:
command: "rm ~/sinaExample1"
- cmd:
command: "rm ~/sinaExample2"
sina build #
Now, after you created and edited the files from sina create
, you can simply build a SINA package by just running the sina build
command in your directory.
[root@localhost ~]# sina build
All files specified in the package.yaml are combined together with the package.yaml to form a SINA package.
In these few steps, you can successfully create and use the SINA package. This is the basic functionality offered by SINA.
You can always explore Full Documentation to go through all the functionality and features provided by SINA.