Compare commits
19 Commits
bdea52185a
...
master
Author | SHA1 | Date | |
---|---|---|---|
6c2e8fa9b2
|
|||
46f41ea01d
|
|||
d30690a45a
|
|||
00409472b7
|
|||
8174597c55
|
|||
ea11563ee0
|
|||
2de50f5158
|
|||
e3951b144e
|
|||
94792121a2 | |||
b7a036a3dd
|
|||
d1f2957512 | |||
95609a3092 | |||
8e54d611eb | |||
ef1ff2737f | |||
d34f97fa5d | |||
c85e61f5d0 | |||
677b0d7b3c | |||
f539be8f52 | |||
4336490a72 |
160
.gitea/workflows/build-and-package.yaml
Normal file
160
.gitea/workflows/build-and-package.yaml
Normal file
@@ -0,0 +1,160 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "releases/*"
|
||||
|
||||
env:
|
||||
PACKAGE_API: https://repo.katenary.io/api/packages/katenary
|
||||
CGO_ENABLED: 0
|
||||
BIN_TARGET: /usr/bin/katenary
|
||||
FPM_BASE: ../LICENSE=/usr/share/doc/katenary/LICENSE ../README.md=/usr/share/doc/katenary/README.md
|
||||
FPM_COMMON_FILES: ../doc/share/man/man1/katenary.1=/usr/share/man/man1/katenary.1
|
||||
FPM_COMMON_FILES_ARCHLINUX: ../doc/share/man/man1/katenary.1=/usr/man/man1/katenary.1
|
||||
VENDOR: "Katenary Project"
|
||||
MAINTANER: "Patrice Ferlet <metal3d@gmail.com>"
|
||||
LICENSE: MIT
|
||||
DESCRIPTION: "Effortless conversion from compose files (docker, podman) to Helm Charts"
|
||||
URL: "https://katenary.io"
|
||||
VERSION: ${{ gitea.ref_name }}
|
||||
|
||||
jobs:
|
||||
build-packages:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
matrix:
|
||||
goarch: [amd64, arm64]
|
||||
goos: [linux, freebsd, windows, darwin]
|
||||
exclude:
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
|
||||
steps:
|
||||
- name: Extract version
|
||||
run: |
|
||||
VERSION="${VERSION#releases/}"
|
||||
echo "Exporting variable VERSION=$VERSION"
|
||||
echo "VERSION=$VERSION" >> $GITEA_OUTPUT
|
||||
echo "VERSION=$VERSION" >> $GITEA_ENV
|
||||
|
||||
- name: Install Unix dependencies
|
||||
if: matrix.goos == 'linux' || matrix.goos == 'freebsd'
|
||||
run: |-
|
||||
sudo apt-get update && sudo apt-get install -y rpm zstd libarchive-tools binutils ruby curl
|
||||
sudo gem install fpm
|
||||
|
||||
- name: Install Windows dependencies
|
||||
if: matrix.goos == 'windows'
|
||||
run: |-
|
||||
sudo apt-get update && sudo apt-get install -y nsis curl
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.25
|
||||
|
||||
- name: Compile binary
|
||||
if: matrix.goos == 'linux' || matrix.goos == 'freebsd' || matrix.goos == 'darwin'
|
||||
run: |-
|
||||
echo "Building binary version $VERSION"
|
||||
mkdir -p dist
|
||||
GOARCH=${{ matrix.goarch }} GOOS=${{ matrix.goos }}\
|
||||
go build -ldflags="-X 'repo.katenary.io/katenary/katenary/internal/generator.Version=$VERSION'" \
|
||||
-trimpath -o dist/katenary-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/katenary
|
||||
|
||||
- name: Package (Linux)
|
||||
if: matrix.goos == 'linux'
|
||||
run: |-
|
||||
mkdir -p dist
|
||||
cd dist
|
||||
# rpm and deb
|
||||
for p in rpm deb; do
|
||||
fpm -s dir -t $p \
|
||||
--name katenary \
|
||||
--url "$URL" \
|
||||
--vendor "$VENDOR" \
|
||||
--maintainer "$MAINTANER" \
|
||||
--license "$LICENSE" \
|
||||
--description "$DESCRIPTION" \
|
||||
-a ${{ matrix.goarch }} -f $FPM_OPTS --version=$VERSION \
|
||||
$FPM_BASE $FPM_COMMON_FILES \
|
||||
./katenary-${{ matrix.goos }}-${{ matrix.goarch }}=$BIN_TARGET
|
||||
done
|
||||
# arch linux
|
||||
fpm -s dir -t pacman \
|
||||
--name katenary \
|
||||
--url "$URL" \
|
||||
--vendor "$VENDOR" \
|
||||
--maintainer "$MAINTANER" \
|
||||
--license "$LICENSE" \
|
||||
--description "$DESCRIPTION" \
|
||||
-a ${{ matrix.goarch }} -f $FPM_OPTS --version=$VERSION \
|
||||
$FPM_BASE $FPM_COMMON_FILES_ARCHLINUX \
|
||||
./katenary-${{ matrix.goos }}-${{ matrix.goarch }}=$BIN_TARGET
|
||||
|
||||
- name: Package (FreeBSD)
|
||||
if: matrix.goos == 'freebsd'
|
||||
run: |-
|
||||
# freebsd
|
||||
mkdir -p dist
|
||||
cd dist
|
||||
fpm -s dir -t freebsd \
|
||||
--name katenary \
|
||||
--url "$URL" \
|
||||
--vendor "$VENDOR" \
|
||||
--maintainer "$MAINTANER" \
|
||||
--license "$LICENSE" \
|
||||
--description "$DESCRIPTION" \
|
||||
-a ${{ matrix.goarch }} -f $FPM_OPTS --version=$VERSION \
|
||||
$FPM_BASE $FPM_COMMON_FILES \
|
||||
./katenary-${{ matrix.goos }}-${{ matrix.goarch }}=$BIN_TARGET
|
||||
|
||||
- name: Package setup.exe for windows
|
||||
if: matrix.goos == 'windows'
|
||||
run: |-
|
||||
mkdir -p dist
|
||||
GOARCH=${{ matrix.goarch }} GOOS=${{ matrix.goos }}\
|
||||
go build -ldflags="-X 'repo.katenary.io/katenary/katenary/internal/generator.Version=$VERSION'" \
|
||||
-trimpath -o dist/katenary.exe ./cmd/katenary
|
||||
curl https://nsis.sourceforge.io/mediawiki/images/7/7f/EnVar_plugin.zip -o nsis/EnVar_plugin.zip
|
||||
cd nsis
|
||||
unzip -o EnVar_plugin.zip Plugins/x86-unicode/EnVar.dll
|
||||
mv Plugins/x86-unicode/EnVar.dll EnVar.dll
|
||||
cd ..
|
||||
makensis -DAPP_VERSION=$VERSION nsis/katenary.nsi
|
||||
mv nsis/katenary-windows-setup.exe dist/katenary-windows-setup.exe
|
||||
|
||||
- name: Upload to packages repositories
|
||||
run: |-
|
||||
for file in katenary-{freebsd,linux}-{amd64,arm64} katenary-darwin-amd64 katenary.exe katenary-windows-setup.exe; do
|
||||
[[ -f dist/$file ]] || continue
|
||||
echo "Push $file"
|
||||
curl -sSLf --user ${{ gitea.actor }}:${{ secrets.ACCESS_TOKEN }} \
|
||||
--upload-file dist/$file \
|
||||
${PACKAGE_API}/generic/katenary/${VERSION}/$(basename $file)
|
||||
done
|
||||
for file in $(find dist -name "*.rpm"); do
|
||||
echo "Push $file"
|
||||
curl -sSLf --user ${{ gitea.actor }}:${{ secrets.ACCESS_TOKEN }} \
|
||||
--upload-file $file \
|
||||
${PACKAGE_API}/rpm/upload
|
||||
done
|
||||
for file in $(find dist -name "*.deb"); do
|
||||
echo "Push $file"
|
||||
curl -sSLf --user ${{ gitea.actor }}:${{ secrets.ACCESS_TOKEN }} \
|
||||
--upload-file $file \
|
||||
${PACKAGE_API}/debian/pool/any/main/upload
|
||||
done
|
||||
for file in $(find dist -name "*.zst"); do
|
||||
echo "Push $file"
|
||||
curl -sSLf --user ${{ gitea.actor }}:${{ secrets.ACCESS_TOKEN }} \
|
||||
--upload-file $file \
|
||||
${PACKAGE_API}/arch/core
|
||||
done
|
@@ -3,12 +3,13 @@ name: Build and push OCI image
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "**"
|
||||
- "releases/*"
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
VERSION: ${{ github.ref_name }}
|
||||
REGISTRY: repo.katenary.io
|
||||
IMAGE_NAME: ${{ gitea.repository }}
|
||||
STORAGE_DRIVER: vfs
|
||||
VERSION: ${{ gitea.ref_name }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -17,27 +18,38 @@ jobs:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Extract version
|
||||
run: |
|
||||
VERSION="${VERSION#releases/}"
|
||||
echo "Exporting variable VERSION=$VERSION"
|
||||
echo "VERSION=$VERSION" >> $GITEA_OUTPUT
|
||||
echo "VERSION=$VERSION" >> $GITEA_ENV
|
||||
|
||||
- name: Install Buildah
|
||||
run: |-
|
||||
if ! comamnd -v buildah 2>/dev/null; then
|
||||
env
|
||||
if ! command -v buildah 2>/dev/null; then
|
||||
echo "Install Buildah"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y buildah
|
||||
else
|
||||
echo "Buildah already installed"
|
||||
fi
|
||||
- name: Login to repository
|
||||
run: |
|
||||
buildah login $REGISTRY -u ${{ gitea.actor }} -p ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build and tag
|
||||
run: |-
|
||||
buildah build --build-arg VERSION=$VERSION -t katenary -f ./oci/katenary/Containerfile .
|
||||
echo "Building image $REGISTRY/${IMAGE_NAME,,}:$VERSION / latest"
|
||||
buildah build --isolation=chroot --build-arg VERSION=$VERSION -t katenary -f ./oci/katenary/Containerfile .
|
||||
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:$VERSION
|
||||
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:latest
|
||||
|
||||
- name: Push image
|
||||
run: |-
|
||||
buildah login $REGISTRY -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
|
||||
buildah push $REGISTRY/${IMAGE_NAME,,}:$VERSION
|
||||
buildah push $REGISTRY/${IMAGE_NAME,,}:latest
|
68
.gitea/workflows/go-test.yaml
Normal file
68
.gitea/workflows/go-test.yaml
Normal file
@@ -0,0 +1,68 @@
|
||||
name: Go-Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
- "main"
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
permissions:
|
||||
contents: read
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.25
|
||||
- name: Install helm
|
||||
run: |
|
||||
command -v helm || curl -sSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||
|
||||
- name: Tidy
|
||||
run: |
|
||||
go mod tidy
|
||||
- name: Launch Test
|
||||
run: |
|
||||
go vet ./...
|
||||
go test -coverprofile=coverprofile.out -json -v ./... > gotest.json
|
||||
# - uses: actions/upload-artifact@v4
|
||||
- name: Upload artifact
|
||||
uses: christopherhx/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: tests-results
|
||||
path: |
|
||||
coverprofile.out
|
||||
gotest.json
|
||||
sonar:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
runs-on: ubuntu-latest
|
||||
needs: tests
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
#- uses: actions/download-artifact@v4
|
||||
- name: Download artifact
|
||||
uses: christopherhx/gitea-download-artifact@v4
|
||||
with:
|
||||
name: tests-results
|
||||
- name: Sonar
|
||||
run: |
|
||||
export SONAR_SCANNER_VERSION=7.2.0.5079
|
||||
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
|
||||
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
|
||||
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
|
||||
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
|
||||
sonar-scanner \
|
||||
-Dsonar.organization=katenary \
|
||||
-Dsonar.projectKey=katenary_katenary
|
12
.github/dependabot.yml
vendored
12
.github/dependabot.yml
vendored
@@ -1,12 +0,0 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "daily"
|
||||
target-branch: develop
|
50
.github/workflows/go-test.yaml
vendored
50
.github/workflows/go-test.yaml
vendored
@@ -1,50 +0,0 @@
|
||||
name: Go-Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- "releases/**"
|
||||
jobs:
|
||||
tests:
|
||||
permissions:
|
||||
contents: read
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.24
|
||||
- name: Launch Test
|
||||
run: |
|
||||
go mod tidy
|
||||
go vet ./... && go test -coverprofile=coverprofile.out -json -v ./... > gotest.json
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tests-results
|
||||
path: |
|
||||
coverprofile.out
|
||||
gotest.json
|
||||
sonar:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
runs-on: ubuntu-latest
|
||||
needs: tests
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: tests-results
|
||||
- name: SonarQube Scan
|
||||
uses: SonarSource/sonarqube-scan-action@v5.2.0
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
|
37
.github/workflows/rewrite-readme.yaml
vendored
Normal file
37
.github/workflows/rewrite-readme.yaml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Set README on GitHub
|
||||
|
||||
# Trigger this workflow every 12 hours.
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
|
||||
jobs:
|
||||
rewrite_readme:
|
||||
name: Append header on README
|
||||
runs-on: ubuntu-latest
|
||||
if: contains(github.server_url, 'github.com')
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Write header
|
||||
run: |
|
||||
cp README.md __OLD.md
|
||||
|
||||
cat 1> README.md <<-EOF
|
||||
> **⚠️ Project has moved !⚠️**
|
||||
>
|
||||
> **Project moved to https://repo.katenary.io/katenary/katenary**
|
||||
>
|
||||
> Please, update your bookmaks. Discussion about the move is here : https://github.com/orgs/Katenary/discussions/162
|
||||
EOF
|
||||
|
||||
cat __OLD.md >> README.md
|
||||
- name: Commit
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
add: README.md
|
||||
message: "Add mirror information"
|
||||
push: true
|
28
.github/workflows/stale.yaml
vendored
Normal file
28
.github/workflows/stale.yaml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# Thanks to blender authors to provide this.
|
||||
# Adaptation made for Katenary
|
||||
|
||||
name: Close GitHub Pull Requests
|
||||
|
||||
# Trigger this workflow every 12 hours.
|
||||
on:
|
||||
schedule:
|
||||
- cron: "* */12 * * *"
|
||||
|
||||
jobs:
|
||||
close_prs:
|
||||
name: Close Pull Requests
|
||||
runs-on: ubuntu-latest
|
||||
if: contains(github.server_url, 'github.com')
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
# Number of days before a pull request is marked as stale.
|
||||
days-before-pr-stale: 0
|
||||
# Number of days before a pull request is closed.
|
||||
days-before-pr-close: 0
|
||||
# Message posted when closing a pull request.
|
||||
stale-pr-message: |
|
||||
This pull request has been automatically closed because this repository is a read-only mirror.
|
||||
Katenary developement happens on [repo.katenary.io](https://repo.katenary.io/Katenary/katenary).
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,7 +21,6 @@ cover*
|
||||
nsis/*.dll
|
||||
nsis/*.exe
|
||||
|
||||
doc/share
|
||||
__pycache__
|
||||
|
||||
.rpmmacros
|
||||
|
2
Makefile
2
Makefile
@@ -13,7 +13,7 @@ CUR_BRANCH=$(shell git branch --show-current)
|
||||
VERSION=$(shell git describe --exact-match --tags $(CUR_SHA) 2>/dev/null || echo $(CUR_BRANCH)-$(CUR_SHA))# use by golang flags
|
||||
|
||||
# Go build command and environment variables for target OS and architecture
|
||||
GOVERSION=1.24
|
||||
GOVERSION=1.25
|
||||
GO=container# container, local
|
||||
OUTPUT=katenary
|
||||
GOOS=linux
|
||||
|
25
README.md
25
README.md
@@ -33,20 +33,25 @@ Today, it's partially developed in collaboration with [Klee Group](https://www.k
|
||||
and **will stay an open source and free (as freedom) project**. We are convinced that the best way to make it better is to
|
||||
share it with the community.
|
||||
|
||||
The main developer is [Patrice FERLET](https://github.com/metal3d).
|
||||
The main developer is [Patrice FERLET](https://repo.katenary.io/metal3d).
|
||||
|
||||
## Install
|
||||
|
||||
You can download the binaries from the [Release](https://github.com/Katenary/katenary/releases) section. Copy the binary
|
||||
You can download the binaries from the [Release](https://repo.katenary.io/Katenary/katenary/releases) section. Copy the binary
|
||||
and rename it to `katenary`. Place the binary inside your `PATH`. You should now be able to call the `katenary` command.
|
||||
|
||||
You can of course get the binary with `go install -u github.com/Katenary/katenary/cmd/katenary/...` but the `main` branch
|
||||
is continuously updated. It's preferable to use releases.
|
||||
|
||||
You can use this commands on Linux:
|
||||
On Linux, you can use the `install.sh` from the repository to install it in your `$HOME/.local/bin` directory:
|
||||
|
||||
```bash
|
||||
sh <(curl -sSL https://raw.githubusercontent.com/Katenary/katenary/master/install.sh)
|
||||
sh <(curl -sSL https://repo.katenary.io/Katenary/katenary/raw/branch/master/install.sh)
|
||||
```
|
||||
|
||||
All OS, if you've installed Go on your computer, you can install using:
|
||||
|
||||
```bash
|
||||
go install -u katenary.io/cmd@latest
|
||||
# or use a release
|
||||
go install -u katenary.io/cmd@v3.0.0
|
||||
```
|
||||
|
||||
## Or, build yourself
|
||||
@@ -252,7 +257,7 @@ web:
|
||||
|
||||
To validate the `katenary.yaml` file, you can use the JSON schema using the "master" raw content:
|
||||
|
||||
`https://raw.githubusercontent.com/Katenary/katenary/refs/heads/master/katenary.json`
|
||||
`https://repo.katenary.io/Katenary/katenary/raw/branch/master/katenary.json`
|
||||
|
||||
It's easy to configure in [LazyVim](https://www.lazyvim.org/), using `nvim-lspconfig`,
|
||||
create a Lua file in your `plugins` directory, or apply the settings as the example below:
|
||||
@@ -269,7 +274,7 @@ return {
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["https://raw.githubusercontent.com/Katenary/katenary/master/katenary.json"] = "katenary.yaml",
|
||||
["https://repo.katenary.io/Katenary/katenary/raw/branch/master/katenary.json"] = "katenary.yaml",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -285,7 +290,7 @@ Use this address to validate the `katenary.yaml` file in VSCode:
|
||||
```json
|
||||
{
|
||||
"yaml.schemas": {
|
||||
"https://raw.githubusercontent.com/Katenary/katenary/master/katenary.json": "katenary.yaml"
|
||||
"https://repo.katenary.io/Katenary/katenary/raw/branch/master/katenary.json": "katenary.yaml"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@@ -10,10 +10,10 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/katenary/katenary/internal/generator"
|
||||
"github.com/katenary/katenary/internal/generator/katenaryfile"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"katenary.io/internal/generator"
|
||||
"katenary.io/internal/generator/katenaryfile"
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/cli"
|
||||
"github.com/spf13/cobra"
|
||||
|
@@ -39,10 +39,10 @@ share it with the community.
|
||||

|
||||
</div>
|
||||
|
||||
The main developer is [Patrice FERLET](https://github.com/metal3d).
|
||||
The main developer is [Patrice FERLET](https://repo.katenary.io/metal3d).
|
||||
|
||||
The project source
|
||||
code is hosted on the [:fontawesome-brands-github: Katenary GitHub Repository](https://github.com/Katenary/katenary).
|
||||
code is hosted on the [:fontawesome-brands-git: Katenary Repository](https://repo.katenary.io/Katenary/katenary).
|
||||
|
||||
## Install Katenary
|
||||
|
||||
@@ -57,7 +57,7 @@ If you are a Linux user, you can use the "one line installation command" which w
|
||||
`$HOME/.local/bin` directory if it exists.
|
||||
|
||||
```bash
|
||||
sh <(curl -sSL https://raw.githubusercontent.com/Katenary/katenary/master/install.sh)
|
||||
sh <(curl -sSL https://repo.katenary.io/Katenary/katenary/raw/branch/master/install.sh)
|
||||
```
|
||||
|
||||
!!! Info "Upgrading is integrated to the `katenary` command"
|
||||
@@ -77,7 +77,7 @@ You can also build and install it yourself, the provided Makefile has got a `bui
|
||||
To compile it, you can use the following commands:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/Katenary/katenary.git
|
||||
git clone https://repo.katenary.io/Katenary/katenary.git
|
||||
cd katenary
|
||||
make build
|
||||
make install
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# katenary
|
||||
|
||||
```go
|
||||
import "github.com/katenary/katenary/cmd/katenary"
|
||||
import "katenary.io/cmd/katenary"
|
||||
```
|
||||
|
||||
Katenary CLI, main package.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# generator
|
||||
|
||||
```go
|
||||
import "github.com/katenary/katenary/internal/generator"
|
||||
import "katenary.io/internal/generator"
|
||||
```
|
||||
|
||||
Package generator generates kubernetes objects from a "compose" file and transforms them into a helm chart.
|
||||
@@ -35,7 +35,7 @@ var Version = "master" // changed at compile time
|
||||
```
|
||||
|
||||
<a name="Convert"></a>
|
||||
## func [Convert](<https://github.com/katenary/katenary/blob/master/internal/generator/converter.go#L100>)
|
||||
## func [Convert](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/converter.go#L100>)
|
||||
|
||||
```go
|
||||
func Convert(config ConvertOptions, dockerComposeFile ...string) error
|
||||
@@ -44,7 +44,7 @@ func Convert(config ConvertOptions, dockerComposeFile ...string) error
|
||||
Convert a compose \(docker, podman...\) project to a helm chart. It calls Generate\(\) to generate the chart and then write it to the disk.
|
||||
|
||||
<a name="GetLabels"></a>
|
||||
## func [GetLabels](<https://github.com/katenary/katenary/blob/master/internal/generator/labels.go#L12>)
|
||||
## func [GetLabels](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels.go#L13>)
|
||||
|
||||
```go
|
||||
func GetLabels(serviceName, appName string) map[string]string
|
||||
@@ -53,7 +53,7 @@ func GetLabels(serviceName, appName string) map[string]string
|
||||
GetLabels returns the labels for a service. It uses the appName to replace the \_\_replace\_\_ in the labels. This is used to generate the labels in the templates.
|
||||
|
||||
<a name="GetMatchLabels"></a>
|
||||
## func [GetMatchLabels](<https://github.com/katenary/katenary/blob/master/internal/generator/labels.go#L25>)
|
||||
## func [GetMatchLabels](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels.go#L26>)
|
||||
|
||||
```go
|
||||
func GetMatchLabels(serviceName, appName string) map[string]string
|
||||
@@ -62,7 +62,7 @@ func GetMatchLabels(serviceName, appName string) map[string]string
|
||||
GetMatchLabels returns the matchLabels for a service. It uses the appName to replace the \_\_replace\_\_ in the labels. This is used to generate the matchLabels in the templates.
|
||||
|
||||
<a name="GetVersion"></a>
|
||||
## func [GetVersion](<https://github.com/katenary/katenary/blob/master/internal/generator/version.go#L14>)
|
||||
## func [GetVersion](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/version.go#L14>)
|
||||
|
||||
```go
|
||||
func GetVersion() string
|
||||
@@ -71,7 +71,7 @@ func GetVersion() string
|
||||
GetVersion return the version of katneary. It's important to understand that the version is set at compile time for the github release. But, it the user get katneary using \`go install\`, the version should be different.
|
||||
|
||||
<a name="Helper"></a>
|
||||
## func [Helper](<https://github.com/katenary/katenary/blob/master/internal/generator/helper.go#L15>)
|
||||
## func [Helper](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/helper.go#L16>)
|
||||
|
||||
```go
|
||||
func Helper(name string) string
|
||||
@@ -80,7 +80,7 @@ func Helper(name string) string
|
||||
Helper returns the \_helpers.tpl file for a chart.
|
||||
|
||||
<a name="NewCronJob"></a>
|
||||
## func [NewCronJob](<https://github.com/katenary/katenary/blob/master/internal/generator/cronJob.go#L28>)
|
||||
## func [NewCronJob](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/cronJob.go#L29>)
|
||||
|
||||
```go
|
||||
func NewCronJob(service types.ServiceConfig, chart *HelmChart, appName string) (*CronJob, *RBAC)
|
||||
@@ -89,7 +89,7 @@ func NewCronJob(service types.ServiceConfig, chart *HelmChart, appName string) (
|
||||
NewCronJob creates a new CronJob from a compose service. The appName is the name of the application taken from the project name.
|
||||
|
||||
<a name="ToK8SYaml"></a>
|
||||
## func [ToK8SYaml](<https://github.com/katenary/katenary/blob/master/internal/generator/utils.go#L91>)
|
||||
## func [ToK8SYaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/utils.go#L91>)
|
||||
|
||||
```go
|
||||
func ToK8SYaml(obj any) ([]byte, error)
|
||||
@@ -98,7 +98,7 @@ func ToK8SYaml(obj any) ([]byte, error)
|
||||
|
||||
|
||||
<a name="UnWrapTPL"></a>
|
||||
## func [UnWrapTPL](<https://github.com/katenary/katenary/blob/master/internal/generator/utils.go#L87>)
|
||||
## func [UnWrapTPL](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/utils.go#L87>)
|
||||
|
||||
```go
|
||||
func UnWrapTPL(in []byte) []byte
|
||||
@@ -107,7 +107,7 @@ func UnWrapTPL(in []byte) []byte
|
||||
UnWrapTPL removes the line wrapping from a template.
|
||||
|
||||
<a name="ChartTemplate"></a>
|
||||
## type [ChartTemplate](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L22-L25>)
|
||||
## type [ChartTemplate](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/chart.go#L22-L25>)
|
||||
|
||||
ChartTemplate is a template of a chart. It contains the content of the template and the name of the service. This is used internally to generate the templates.
|
||||
|
||||
@@ -119,7 +119,7 @@ type ChartTemplate struct {
|
||||
```
|
||||
|
||||
<a name="ConfigMap"></a>
|
||||
## type [ConfigMap](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L37-L42>)
|
||||
## type [ConfigMap](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L38-L43>)
|
||||
|
||||
ConfigMap is a kubernetes ConfigMap. Implements the DataMap interface.
|
||||
|
||||
@@ -131,7 +131,7 @@ type ConfigMap struct {
|
||||
```
|
||||
|
||||
<a name="NewConfigMap"></a>
|
||||
### func [NewConfigMap](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L46>)
|
||||
### func [NewConfigMap](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L47>)
|
||||
|
||||
```go
|
||||
func NewConfigMap(service types.ServiceConfig, appName string, forFile bool) *ConfigMap
|
||||
@@ -140,7 +140,7 @@ func NewConfigMap(service types.ServiceConfig, appName string, forFile bool) *Co
|
||||
NewConfigMap creates a new ConfigMap from a compose service. The appName is the name of the application taken from the project name. The ConfigMap is filled by environment variables and labels "map\-env".
|
||||
|
||||
<a name="NewConfigMapFromDirectory"></a>
|
||||
### func [NewConfigMapFromDirectory](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L119>)
|
||||
### func [NewConfigMapFromDirectory](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L120>)
|
||||
|
||||
```go
|
||||
func NewConfigMapFromDirectory(service types.ServiceConfig, appName, path string) *ConfigMap
|
||||
@@ -149,7 +149,7 @@ func NewConfigMapFromDirectory(service types.ServiceConfig, appName, path string
|
||||
NewConfigMapFromDirectory creates a new ConfigMap from a compose service. This path is the path to the file or directory. If the path is a directory, all files in the directory are added to the ConfigMap. Each subdirectory are ignored. Note that the Generate\(\) function will create the subdirectories ConfigMaps.
|
||||
|
||||
<a name="ConfigMap.AddBinaryData"></a>
|
||||
### func \(\*ConfigMap\) [AddBinaryData](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L157>)
|
||||
### func \(\*ConfigMap\) [AddBinaryData](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L158>)
|
||||
|
||||
```go
|
||||
func (c *ConfigMap) AddBinaryData(key string, value []byte)
|
||||
@@ -158,7 +158,7 @@ func (c *ConfigMap) AddBinaryData(key string, value []byte)
|
||||
AddBinaryData adds binary data to the configmap. Append or overwrite the value if the key already exists.
|
||||
|
||||
<a name="ConfigMap.AddData"></a>
|
||||
### func \(\*ConfigMap\) [AddData](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L152>)
|
||||
### func \(\*ConfigMap\) [AddData](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L153>)
|
||||
|
||||
```go
|
||||
func (c *ConfigMap) AddData(key, value string)
|
||||
@@ -167,7 +167,7 @@ func (c *ConfigMap) AddData(key, value string)
|
||||
AddData adds a key value pair to the configmap. Append or overwrite the value if the key already exists.
|
||||
|
||||
<a name="ConfigMap.AppendDir"></a>
|
||||
### func \(\*ConfigMap\) [AppendDir](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L166>)
|
||||
### func \(\*ConfigMap\) [AppendDir](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L167>)
|
||||
|
||||
```go
|
||||
func (c *ConfigMap) AppendDir(path string) error
|
||||
@@ -176,7 +176,7 @@ func (c *ConfigMap) AppendDir(path string) error
|
||||
AppendDir adds files from given path to the configmap. It is not recursive, to add all files in a directory, you need to call this function for each subdirectory.
|
||||
|
||||
<a name="ConfigMap.AppendFile"></a>
|
||||
### func \(\*ConfigMap\) [AppendFile](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L213>)
|
||||
### func \(\*ConfigMap\) [AppendFile](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L214>)
|
||||
|
||||
```go
|
||||
func (c *ConfigMap) AppendFile(path string) error
|
||||
@@ -185,7 +185,7 @@ func (c *ConfigMap) AppendFile(path string) error
|
||||
|
||||
|
||||
<a name="ConfigMap.Filename"></a>
|
||||
### func \(\*ConfigMap\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L237>)
|
||||
### func \(\*ConfigMap\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L238>)
|
||||
|
||||
```go
|
||||
func (c *ConfigMap) Filename() string
|
||||
@@ -194,7 +194,7 @@ func (c *ConfigMap) Filename() string
|
||||
Filename returns the filename of the configmap. If the configmap is used for files, the filename contains the path.
|
||||
|
||||
<a name="ConfigMap.SetData"></a>
|
||||
### func \(\*ConfigMap\) [SetData](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L247>)
|
||||
### func \(\*ConfigMap\) [SetData](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L248>)
|
||||
|
||||
```go
|
||||
func (c *ConfigMap) SetData(data map[string]string)
|
||||
@@ -203,7 +203,7 @@ func (c *ConfigMap) SetData(data map[string]string)
|
||||
SetData sets the data of the configmap. It replaces the entire data.
|
||||
|
||||
<a name="ConfigMap.Yaml"></a>
|
||||
### func \(\*ConfigMap\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L252>)
|
||||
### func \(\*ConfigMap\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L253>)
|
||||
|
||||
```go
|
||||
func (c *ConfigMap) Yaml() ([]byte, error)
|
||||
@@ -212,7 +212,7 @@ func (c *ConfigMap) Yaml() ([]byte, error)
|
||||
Yaml returns the yaml representation of the configmap
|
||||
|
||||
<a name="ConfigMapMount"></a>
|
||||
## type [ConfigMapMount](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L28-L31>)
|
||||
## type [ConfigMapMount](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L29-L32>)
|
||||
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ type ConfigMapMount struct {
|
||||
```
|
||||
|
||||
<a name="ConvertOptions"></a>
|
||||
## type [ConvertOptions](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L28-L37>)
|
||||
## type [ConvertOptions](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/chart.go#L28-L37>)
|
||||
|
||||
ConvertOptions are the options to convert a compose project to a helm chart.
|
||||
|
||||
@@ -241,7 +241,7 @@ type ConvertOptions struct {
|
||||
```
|
||||
|
||||
<a name="CronJob"></a>
|
||||
## type [CronJob](<https://github.com/katenary/katenary/blob/master/internal/generator/cronJob.go#L22-L25>)
|
||||
## type [CronJob](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/cronJob.go#L23-L26>)
|
||||
|
||||
CronJob is a kubernetes CronJob.
|
||||
|
||||
@@ -253,7 +253,7 @@ type CronJob struct {
|
||||
```
|
||||
|
||||
<a name="CronJob.Filename"></a>
|
||||
### func \(\*CronJob\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/cronJob.go#L114>)
|
||||
### func \(\*CronJob\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/cronJob.go#L113>)
|
||||
|
||||
```go
|
||||
func (c *CronJob) Filename() string
|
||||
@@ -264,7 +264,7 @@ Filename returns the filename of the cronjob.
|
||||
Implements the Yaml interface.
|
||||
|
||||
<a name="CronJob.Yaml"></a>
|
||||
### func \(\*CronJob\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/cronJob.go#L121>)
|
||||
### func \(\*CronJob\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/cronJob.go#L120>)
|
||||
|
||||
```go
|
||||
func (c *CronJob) Yaml() ([]byte, error)
|
||||
@@ -275,7 +275,7 @@ Yaml returns the yaml representation of the cronjob.
|
||||
Implements the Yaml interface.
|
||||
|
||||
<a name="CronJobValue"></a>
|
||||
## type [CronJobValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L118-L123>)
|
||||
## type [CronJobValue](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/values.go#L118-L123>)
|
||||
|
||||
CronJobValue is a cronjob configuration that will be saved in values.yaml.
|
||||
|
||||
@@ -289,7 +289,7 @@ type CronJobValue struct {
|
||||
```
|
||||
|
||||
<a name="DataMap"></a>
|
||||
## type [DataMap](<https://github.com/katenary/katenary/blob/master/internal/generator/types.go#L4-L7>)
|
||||
## type [DataMap](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/types.go#L4-L7>)
|
||||
|
||||
DataMap is a kubernetes ConfigMap or Secret. It can be used to add data to the ConfigMap or Secret.
|
||||
|
||||
@@ -301,7 +301,7 @@ type DataMap interface {
|
||||
```
|
||||
|
||||
<a name="Deployment"></a>
|
||||
## type [Deployment](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L34-L44>)
|
||||
## type [Deployment](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L35-L45>)
|
||||
|
||||
Deployment is a kubernetes Deployment.
|
||||
|
||||
@@ -313,7 +313,7 @@ type Deployment struct {
|
||||
```
|
||||
|
||||
<a name="NewDeployment"></a>
|
||||
### func [NewDeployment](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L48>)
|
||||
### func [NewDeployment](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L49>)
|
||||
|
||||
```go
|
||||
func NewDeployment(service types.ServiceConfig, chart *HelmChart) *Deployment
|
||||
@@ -322,7 +322,7 @@ func NewDeployment(service types.ServiceConfig, chart *HelmChart) *Deployment
|
||||
NewDeployment creates a new Deployment from a compose service. The appName is the name of the application taken from the project name. It also creates the Values map that will be used to create the values.yaml file.
|
||||
|
||||
<a name="Deployment.AddContainer"></a>
|
||||
### func \(\*Deployment\) [AddContainer](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L115>)
|
||||
### func \(\*Deployment\) [AddContainer](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L116>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) AddContainer(service types.ServiceConfig)
|
||||
@@ -331,7 +331,7 @@ func (d *Deployment) AddContainer(service types.ServiceConfig)
|
||||
AddContainer adds a container to the deployment.
|
||||
|
||||
<a name="Deployment.AddHealthCheck"></a>
|
||||
### func \(\*Deployment\) [AddHealthCheck](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L161>)
|
||||
### func \(\*Deployment\) [AddHealthCheck](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L163>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) AddHealthCheck(service types.ServiceConfig, container *corev1.Container)
|
||||
@@ -340,7 +340,7 @@ func (d *Deployment) AddHealthCheck(service types.ServiceConfig, container *core
|
||||
|
||||
|
||||
<a name="Deployment.AddIngress"></a>
|
||||
### func \(\*Deployment\) [AddIngress](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L190>)
|
||||
### func \(\*Deployment\) [AddIngress](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L192>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) AddIngress(service types.ServiceConfig, appName string) *Ingress
|
||||
@@ -349,7 +349,7 @@ func (d *Deployment) AddIngress(service types.ServiceConfig, appName string) *In
|
||||
AddIngress adds an ingress to the deployment. It creates the ingress object.
|
||||
|
||||
<a name="Deployment.AddLegacyVolume"></a>
|
||||
### func \(\*Deployment\) [AddLegacyVolume](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L220>)
|
||||
### func \(\*Deployment\) [AddLegacyVolume](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L222>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) AddLegacyVolume(name, kind string)
|
||||
@@ -358,7 +358,7 @@ func (d *Deployment) AddLegacyVolume(name, kind string)
|
||||
|
||||
|
||||
<a name="Deployment.AddVolumes"></a>
|
||||
### func \(\*Deployment\) [AddVolumes](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L196>)
|
||||
### func \(\*Deployment\) [AddVolumes](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L198>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) AddVolumes(service types.ServiceConfig, appName string)
|
||||
@@ -367,7 +367,7 @@ func (d *Deployment) AddVolumes(service types.ServiceConfig, appName string)
|
||||
AddVolumes adds a volume to the deployment. It does not create the PVC, it only adds the volumes to the deployment. If the volume is a bind volume it will warn the user that it is not supported yet.
|
||||
|
||||
<a name="Deployment.BindFrom"></a>
|
||||
### func \(\*Deployment\) [BindFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L241>)
|
||||
### func \(\*Deployment\) [BindFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L243>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) BindFrom(service types.ServiceConfig, binded *Deployment)
|
||||
@@ -376,7 +376,7 @@ func (d *Deployment) BindFrom(service types.ServiceConfig, binded *Deployment)
|
||||
|
||||
|
||||
<a name="Deployment.BindMapFilesToContainer"></a>
|
||||
### func \(\*Deployment\) [BindMapFilesToContainer](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L375>)
|
||||
### func \(\*Deployment\) [BindMapFilesToContainer](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L377>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) BindMapFilesToContainer(service types.ServiceConfig, secrets []string, appName string) (*corev1.Container, int)
|
||||
@@ -385,7 +385,7 @@ func (d *Deployment) BindMapFilesToContainer(service types.ServiceConfig, secret
|
||||
|
||||
|
||||
<a name="Deployment.DependsOn"></a>
|
||||
### func \(\*Deployment\) [DependsOn](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L269>)
|
||||
### func \(\*Deployment\) [DependsOn](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L271>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) DependsOn(to *Deployment, servicename string) error
|
||||
@@ -394,7 +394,7 @@ func (d *Deployment) DependsOn(to *Deployment, servicename string) error
|
||||
DependsOn adds a initContainer to the deployment that will wait for the service to be up.
|
||||
|
||||
<a name="Deployment.Filename"></a>
|
||||
### func \(\*Deployment\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L300>)
|
||||
### func \(\*Deployment\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L302>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) Filename() string
|
||||
@@ -403,7 +403,7 @@ func (d *Deployment) Filename() string
|
||||
Filename returns the filename of the deployment.
|
||||
|
||||
<a name="Deployment.MountExchangeVolumes"></a>
|
||||
### func \(\*Deployment\) [MountExchangeVolumes](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L426>)
|
||||
### func \(\*Deployment\) [MountExchangeVolumes](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L428>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) MountExchangeVolumes()
|
||||
@@ -412,7 +412,7 @@ func (d *Deployment) MountExchangeVolumes()
|
||||
|
||||
|
||||
<a name="Deployment.SetEnvFrom"></a>
|
||||
### func \(\*Deployment\) [SetEnvFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L305>)
|
||||
### func \(\*Deployment\) [SetEnvFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L307>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) SetEnvFrom(service types.ServiceConfig, appName string, samePod ...bool)
|
||||
@@ -421,7 +421,7 @@ func (d *Deployment) SetEnvFrom(service types.ServiceConfig, appName string, sam
|
||||
SetEnvFrom sets the environment variables to a configmap. The configmap is created.
|
||||
|
||||
<a name="Deployment.Yaml"></a>
|
||||
### func \(\*Deployment\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/deployment.go#L450>)
|
||||
### func \(\*Deployment\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/deployment.go#L452>)
|
||||
|
||||
```go
|
||||
func (d *Deployment) Yaml() ([]byte, error)
|
||||
@@ -430,7 +430,7 @@ func (d *Deployment) Yaml() ([]byte, error)
|
||||
Yaml returns the yaml representation of the deployment.
|
||||
|
||||
<a name="FileMapUsage"></a>
|
||||
## type [FileMapUsage](<https://github.com/katenary/katenary/blob/master/internal/generator/configMap.go#L21>)
|
||||
## type [FileMapUsage](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/configMap.go#L22>)
|
||||
|
||||
FileMapUsage is the usage of the filemap.
|
||||
|
||||
@@ -448,7 +448,7 @@ const (
|
||||
```
|
||||
|
||||
<a name="HelmChart"></a>
|
||||
## type [HelmChart](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L41-L54>)
|
||||
## type [HelmChart](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/chart.go#L41-L54>)
|
||||
|
||||
HelmChart is a Helm Chart representation. It contains all the templates, values, versions, helpers...
|
||||
|
||||
@@ -471,7 +471,7 @@ type HelmChart struct {
|
||||
```
|
||||
|
||||
<a name="Generate"></a>
|
||||
### func [Generate](<https://github.com/katenary/katenary/blob/master/internal/generator/generator.go#L32>)
|
||||
### func [Generate](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/generator.go#L32>)
|
||||
|
||||
```go
|
||||
func Generate(project *types.Project) (*HelmChart, error)
|
||||
@@ -491,7 +491,7 @@ The Generate function will create the HelmChart object this way:
|
||||
- Merge the same\-pod services.
|
||||
|
||||
<a name="NewChart"></a>
|
||||
### func [NewChart](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L57>)
|
||||
### func [NewChart](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/chart.go#L57>)
|
||||
|
||||
```go
|
||||
func NewChart(name string) *HelmChart
|
||||
@@ -500,7 +500,7 @@ func NewChart(name string) *HelmChart
|
||||
NewChart creates a new empty chart with the given name.
|
||||
|
||||
<a name="HelmChart.SaveTemplates"></a>
|
||||
### func \(\*HelmChart\) [SaveTemplates](<https://github.com/katenary/katenary/blob/master/internal/generator/chart.go#L72>)
|
||||
### func \(\*HelmChart\) [SaveTemplates](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/chart.go#L72>)
|
||||
|
||||
```go
|
||||
func (chart *HelmChart) SaveTemplates(templateDir string)
|
||||
@@ -509,7 +509,7 @@ func (chart *HelmChart) SaveTemplates(templateDir string)
|
||||
SaveTemplates the templates of the chart to the given directory.
|
||||
|
||||
<a name="Ingress"></a>
|
||||
## type [Ingress](<https://github.com/katenary/katenary/blob/master/internal/generator/ingress.go#L18-L22>)
|
||||
## type [Ingress](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/ingress.go#L18-L22>)
|
||||
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ type Ingress struct {
|
||||
```
|
||||
|
||||
<a name="NewIngress"></a>
|
||||
### func [NewIngress](<https://github.com/katenary/katenary/blob/master/internal/generator/ingress.go#L25>)
|
||||
### func [NewIngress](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/ingress.go#L25>)
|
||||
|
||||
```go
|
||||
func NewIngress(service types.ServiceConfig, Chart *HelmChart) *Ingress
|
||||
@@ -530,7 +530,7 @@ func NewIngress(service types.ServiceConfig, Chart *HelmChart) *Ingress
|
||||
NewIngress creates a new Ingress from a compose service.
|
||||
|
||||
<a name="Ingress.Filename"></a>
|
||||
### func \(\*Ingress\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/ingress.go#L129>)
|
||||
### func \(\*Ingress\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/ingress.go#L129>)
|
||||
|
||||
```go
|
||||
func (ingress *Ingress) Filename() string
|
||||
@@ -539,7 +539,7 @@ func (ingress *Ingress) Filename() string
|
||||
|
||||
|
||||
<a name="Ingress.Yaml"></a>
|
||||
### func \(\*Ingress\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/ingress.go#L133>)
|
||||
### func \(\*Ingress\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/ingress.go#L133>)
|
||||
|
||||
```go
|
||||
func (ingress *Ingress) Yaml() ([]byte, error)
|
||||
@@ -548,7 +548,7 @@ func (ingress *Ingress) Yaml() ([]byte, error)
|
||||
|
||||
|
||||
<a name="IngressValue"></a>
|
||||
## type [IngressValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L29-L36>)
|
||||
## type [IngressValue](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/values.go#L29-L36>)
|
||||
|
||||
IngressValue is a ingress configuration that will be saved in values.yaml.
|
||||
|
||||
@@ -564,7 +564,7 @@ type IngressValue struct {
|
||||
```
|
||||
|
||||
<a name="PersistenceValue"></a>
|
||||
## type [PersistenceValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L16-L21>)
|
||||
## type [PersistenceValue](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/values.go#L16-L21>)
|
||||
|
||||
PersistenceValue is a persistence configuration that will be saved in values.yaml.
|
||||
|
||||
@@ -578,7 +578,7 @@ type PersistenceValue struct {
|
||||
```
|
||||
|
||||
<a name="RBAC"></a>
|
||||
## type [RBAC](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L20-L24>)
|
||||
## type [RBAC](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L20-L24>)
|
||||
|
||||
RBAC is a kubernetes RBAC containing a role, a rolebinding and an associated serviceaccount.
|
||||
|
||||
@@ -591,7 +591,7 @@ type RBAC struct {
|
||||
```
|
||||
|
||||
<a name="NewRBAC"></a>
|
||||
### func [NewRBAC](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L27>)
|
||||
### func [NewRBAC](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L27>)
|
||||
|
||||
```go
|
||||
func NewRBAC(service types.ServiceConfig, appName string) *RBAC
|
||||
@@ -600,7 +600,7 @@ func NewRBAC(service types.ServiceConfig, appName string) *RBAC
|
||||
NewRBAC creates a new RBAC from a compose service. The appName is the name of the application taken from the project name.
|
||||
|
||||
<a name="RepositoryValue"></a>
|
||||
## type [RepositoryValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L10-L13>)
|
||||
## type [RepositoryValue](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/values.go#L10-L13>)
|
||||
|
||||
RepositoryValue is a docker repository image and tag that will be saved in values.yaml.
|
||||
|
||||
@@ -612,7 +612,7 @@ type RepositoryValue struct {
|
||||
```
|
||||
|
||||
<a name="Role"></a>
|
||||
## type [Role](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L114-L117>)
|
||||
## type [Role](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L114-L117>)
|
||||
|
||||
Role is a kubernetes Role.
|
||||
|
||||
@@ -624,7 +624,7 @@ type Role struct {
|
||||
```
|
||||
|
||||
<a name="Role.Filename"></a>
|
||||
### func \(\*Role\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L119>)
|
||||
### func \(\*Role\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L119>)
|
||||
|
||||
```go
|
||||
func (r *Role) Filename() string
|
||||
@@ -633,7 +633,7 @@ func (r *Role) Filename() string
|
||||
|
||||
|
||||
<a name="Role.Yaml"></a>
|
||||
### func \(\*Role\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L123>)
|
||||
### func \(\*Role\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L123>)
|
||||
|
||||
```go
|
||||
func (r *Role) Yaml() ([]byte, error)
|
||||
@@ -642,7 +642,7 @@ func (r *Role) Yaml() ([]byte, error)
|
||||
|
||||
|
||||
<a name="RoleBinding"></a>
|
||||
## type [RoleBinding](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L100-L103>)
|
||||
## type [RoleBinding](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L100-L103>)
|
||||
|
||||
RoleBinding is a kubernetes RoleBinding.
|
||||
|
||||
@@ -654,7 +654,7 @@ type RoleBinding struct {
|
||||
```
|
||||
|
||||
<a name="RoleBinding.Filename"></a>
|
||||
### func \(\*RoleBinding\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L105>)
|
||||
### func \(\*RoleBinding\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L105>)
|
||||
|
||||
```go
|
||||
func (r *RoleBinding) Filename() string
|
||||
@@ -663,7 +663,7 @@ func (r *RoleBinding) Filename() string
|
||||
|
||||
|
||||
<a name="RoleBinding.Yaml"></a>
|
||||
### func \(\*RoleBinding\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L109>)
|
||||
### func \(\*RoleBinding\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L109>)
|
||||
|
||||
```go
|
||||
func (r *RoleBinding) Yaml() ([]byte, error)
|
||||
@@ -672,7 +672,7 @@ func (r *RoleBinding) Yaml() ([]byte, error)
|
||||
|
||||
|
||||
<a name="Secret"></a>
|
||||
## type [Secret](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L22-L25>)
|
||||
## type [Secret](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/secret.go#L23-L26>)
|
||||
|
||||
Secret is a kubernetes Secret.
|
||||
|
||||
@@ -686,7 +686,7 @@ type Secret struct {
|
||||
```
|
||||
|
||||
<a name="NewSecret"></a>
|
||||
### func [NewSecret](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L28>)
|
||||
### func [NewSecret](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/secret.go#L29>)
|
||||
|
||||
```go
|
||||
func NewSecret(service types.ServiceConfig, appName string) *Secret
|
||||
@@ -695,7 +695,7 @@ func NewSecret(service types.ServiceConfig, appName string) *Secret
|
||||
NewSecret creates a new Secret from a compose service
|
||||
|
||||
<a name="Secret.AddData"></a>
|
||||
### func \(\*Secret\) [AddData](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L70>)
|
||||
### func \(\*Secret\) [AddData](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/secret.go#L71>)
|
||||
|
||||
```go
|
||||
func (s *Secret) AddData(key, value string)
|
||||
@@ -704,7 +704,7 @@ func (s *Secret) AddData(key, value string)
|
||||
AddData adds a key value pair to the secret.
|
||||
|
||||
<a name="Secret.Filename"></a>
|
||||
### func \(\*Secret\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L86>)
|
||||
### func \(\*Secret\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/secret.go#L87>)
|
||||
|
||||
```go
|
||||
func (s *Secret) Filename() string
|
||||
@@ -713,7 +713,7 @@ func (s *Secret) Filename() string
|
||||
Filename returns the filename of the secret.
|
||||
|
||||
<a name="Secret.SetData"></a>
|
||||
### func \(\*Secret\) [SetData](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L91>)
|
||||
### func \(\*Secret\) [SetData](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/secret.go#L92>)
|
||||
|
||||
```go
|
||||
func (s *Secret) SetData(data map[string]string)
|
||||
@@ -722,7 +722,7 @@ func (s *Secret) SetData(data map[string]string)
|
||||
SetData sets the data of the secret.
|
||||
|
||||
<a name="Secret.Yaml"></a>
|
||||
### func \(\*Secret\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/secret.go#L98>)
|
||||
### func \(\*Secret\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/secret.go#L99>)
|
||||
|
||||
```go
|
||||
func (s *Secret) Yaml() ([]byte, error)
|
||||
@@ -731,7 +731,7 @@ func (s *Secret) Yaml() ([]byte, error)
|
||||
Yaml returns the yaml representation of the secret.
|
||||
|
||||
<a name="Service"></a>
|
||||
## type [Service](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L18-L21>)
|
||||
## type [Service](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/service.go#L19-L22>)
|
||||
|
||||
Service is a kubernetes Service.
|
||||
|
||||
@@ -743,7 +743,7 @@ type Service struct {
|
||||
```
|
||||
|
||||
<a name="NewService"></a>
|
||||
### func [NewService](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L24>)
|
||||
### func [NewService](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/service.go#L25>)
|
||||
|
||||
```go
|
||||
func NewService(service types.ServiceConfig, appName string) *Service
|
||||
@@ -752,7 +752,7 @@ func NewService(service types.ServiceConfig, appName string) *Service
|
||||
NewService creates a new Service from a compose service.
|
||||
|
||||
<a name="Service.AddPort"></a>
|
||||
### func \(\*Service\) [AddPort](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L53>)
|
||||
### func \(\*Service\) [AddPort](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/service.go#L54>)
|
||||
|
||||
```go
|
||||
func (s *Service) AddPort(port types.ServicePortConfig, serviceName ...string)
|
||||
@@ -761,7 +761,7 @@ func (s *Service) AddPort(port types.ServicePortConfig, serviceName ...string)
|
||||
AddPort adds a port to the service.
|
||||
|
||||
<a name="Service.Filename"></a>
|
||||
### func \(\*Service\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L74>)
|
||||
### func \(\*Service\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/service.go#L75>)
|
||||
|
||||
```go
|
||||
func (s *Service) Filename() string
|
||||
@@ -770,7 +770,7 @@ func (s *Service) Filename() string
|
||||
Filename returns the filename of the service.
|
||||
|
||||
<a name="Service.Yaml"></a>
|
||||
### func \(\*Service\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/service.go#L79>)
|
||||
### func \(\*Service\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/service.go#L80>)
|
||||
|
||||
```go
|
||||
func (s *Service) Yaml() ([]byte, error)
|
||||
@@ -779,7 +779,7 @@ func (s *Service) Yaml() ([]byte, error)
|
||||
Yaml returns the yaml representation of the service.
|
||||
|
||||
<a name="ServiceAccount"></a>
|
||||
## type [ServiceAccount](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L132-L135>)
|
||||
## type [ServiceAccount](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L132-L135>)
|
||||
|
||||
ServiceAccount is a kubernetes ServiceAccount.
|
||||
|
||||
@@ -791,7 +791,7 @@ type ServiceAccount struct {
|
||||
```
|
||||
|
||||
<a name="ServiceAccount.Filename"></a>
|
||||
### func \(\*ServiceAccount\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L137>)
|
||||
### func \(\*ServiceAccount\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L137>)
|
||||
|
||||
```go
|
||||
func (r *ServiceAccount) Filename() string
|
||||
@@ -800,7 +800,7 @@ func (r *ServiceAccount) Filename() string
|
||||
|
||||
|
||||
<a name="ServiceAccount.Yaml"></a>
|
||||
### func \(\*ServiceAccount\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/rbac.go#L141>)
|
||||
### func \(\*ServiceAccount\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/rbac.go#L141>)
|
||||
|
||||
```go
|
||||
func (r *ServiceAccount) Yaml() ([]byte, error)
|
||||
@@ -809,7 +809,7 @@ func (r *ServiceAccount) Yaml() ([]byte, error)
|
||||
|
||||
|
||||
<a name="TLS"></a>
|
||||
## type [TLS](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L23-L26>)
|
||||
## type [TLS](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/values.go#L23-L26>)
|
||||
|
||||
|
||||
|
||||
@@ -821,7 +821,7 @@ type TLS struct {
|
||||
```
|
||||
|
||||
<a name="Value"></a>
|
||||
## type [Value](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L39-L50>)
|
||||
## type [Value](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/values.go#L39-L50>)
|
||||
|
||||
Value will be saved in values.yaml. It contains configuration for all deployment and services.
|
||||
|
||||
@@ -841,7 +841,7 @@ type Value struct {
|
||||
```
|
||||
|
||||
<a name="NewValue"></a>
|
||||
### func [NewValue](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L57>)
|
||||
### func [NewValue](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/values.go#L57>)
|
||||
|
||||
```go
|
||||
func NewValue(service types.ServiceConfig, main ...bool) *Value
|
||||
@@ -852,7 +852,7 @@ NewValue creates a new Value from a compose service. The value contains the nece
|
||||
If \`main\` is true, the tag will be empty because it will be set in the helm chart appVersion.
|
||||
|
||||
<a name="Value.AddIngress"></a>
|
||||
### func \(\*Value\) [AddIngress](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L90>)
|
||||
### func \(\*Value\) [AddIngress](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/values.go#L90>)
|
||||
|
||||
```go
|
||||
func (v *Value) AddIngress(host, path string)
|
||||
@@ -861,7 +861,7 @@ func (v *Value) AddIngress(host, path string)
|
||||
|
||||
|
||||
<a name="Value.AddPersistence"></a>
|
||||
### func \(\*Value\) [AddPersistence](<https://github.com/katenary/katenary/blob/master/internal/generator/values.go#L104>)
|
||||
### func \(\*Value\) [AddPersistence](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/values.go#L104>)
|
||||
|
||||
```go
|
||||
func (v *Value) AddPersistence(volumeName string)
|
||||
@@ -870,7 +870,7 @@ func (v *Value) AddPersistence(volumeName string)
|
||||
AddPersistence adds persistence configuration to the Value.
|
||||
|
||||
<a name="VolumeClaim"></a>
|
||||
## type [VolumeClaim](<https://github.com/katenary/katenary/blob/master/internal/generator/volume.go#L18-L23>)
|
||||
## type [VolumeClaim](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/volume.go#L19-L24>)
|
||||
|
||||
VolumeClaim is a kubernetes VolumeClaim. This is a PersistentVolumeClaim.
|
||||
|
||||
@@ -882,7 +882,7 @@ type VolumeClaim struct {
|
||||
```
|
||||
|
||||
<a name="NewVolumeClaim"></a>
|
||||
### func [NewVolumeClaim](<https://github.com/katenary/katenary/blob/master/internal/generator/volume.go#L26>)
|
||||
### func [NewVolumeClaim](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/volume.go#L27>)
|
||||
|
||||
```go
|
||||
func NewVolumeClaim(service types.ServiceConfig, volumeName, appName string) *VolumeClaim
|
||||
@@ -891,7 +891,7 @@ func NewVolumeClaim(service types.ServiceConfig, volumeName, appName string) *Vo
|
||||
NewVolumeClaim creates a new VolumeClaim from a compose service.
|
||||
|
||||
<a name="VolumeClaim.Filename"></a>
|
||||
### func \(\*VolumeClaim\) [Filename](<https://github.com/katenary/katenary/blob/master/internal/generator/volume.go#L62>)
|
||||
### func \(\*VolumeClaim\) [Filename](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/volume.go#L63>)
|
||||
|
||||
```go
|
||||
func (v *VolumeClaim) Filename() string
|
||||
@@ -900,7 +900,7 @@ func (v *VolumeClaim) Filename() string
|
||||
Filename returns the suggested filename for a VolumeClaim.
|
||||
|
||||
<a name="VolumeClaim.Yaml"></a>
|
||||
### func \(\*VolumeClaim\) [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/volume.go#L67>)
|
||||
### func \(\*VolumeClaim\) [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/volume.go#L68>)
|
||||
|
||||
```go
|
||||
func (v *VolumeClaim) Yaml() ([]byte, error)
|
||||
@@ -909,7 +909,7 @@ func (v *VolumeClaim) Yaml() ([]byte, error)
|
||||
Yaml marshals a VolumeClaim into yaml.
|
||||
|
||||
<a name="Yaml"></a>
|
||||
## type [Yaml](<https://github.com/katenary/katenary/blob/master/internal/generator/types.go#L10-L13>)
|
||||
## type [Yaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/types.go#L10-L13>)
|
||||
|
||||
Yaml is a kubernetes object that can be converted to yaml.
|
||||
|
||||
|
@@ -3,12 +3,12 @@
|
||||
# extrafiles
|
||||
|
||||
```go
|
||||
import "github.com/katenary/katenary/internal/generator/extrafiles"
|
||||
import "katenary.io/internal/generator/extrafiles"
|
||||
```
|
||||
|
||||
Package extrafiles provides function to generate the Chart files that are not objects. Like README.md and notes.txt...
|
||||
|
||||
## func [NotesFile](<https://github.com/katenary/katenary/blob/master/internal/generator/extrafiles/notes.go#L13>)
|
||||
## func [NotesFile](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/extrafiles/notes.go#L13>)
|
||||
|
||||
```go
|
||||
func NotesFile(services []string) string
|
||||
@@ -17,7 +17,7 @@ func NotesFile(services []string) string
|
||||
NotesFile returns the content of the note.txt file.
|
||||
|
||||
<a name="ReadMeFile"></a>
|
||||
## func [ReadMeFile](<https://github.com/katenary/katenary/blob/master/internal/generator/extrafiles/readme.go#L46>)
|
||||
## func [ReadMeFile](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/extrafiles/readme.go#L46>)
|
||||
|
||||
```go
|
||||
func ReadMeFile(charname, description string, values map[string]any) string
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# katenaryfile
|
||||
|
||||
```go
|
||||
import "github.com/katenary/katenary/internal/generator/katenaryfile"
|
||||
import "katenary.io/internal/generator/katenaryfile"
|
||||
```
|
||||
|
||||
Package katenaryfile is a package for reading and writing katenary files.
|
||||
@@ -12,7 +12,7 @@ A katenary file, named "katenary.yml" or "katenary.yaml", is a file where you ca
|
||||
|
||||
Formely, the file describe the same structure as in labels, and so that can be validated and completed by LSP. It also ease the use of katenary.
|
||||
|
||||
## func [GenerateSchema](<https://github.com/katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L137>)
|
||||
## func [GenerateSchema](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L138>)
|
||||
|
||||
```go
|
||||
func GenerateSchema() string
|
||||
@@ -21,7 +21,7 @@ func GenerateSchema() string
|
||||
GenerateSchema generates the schema for the katenary.yaml file.
|
||||
|
||||
<a name="OverrideWithConfig"></a>
|
||||
## func [OverrideWithConfig](<https://github.com/katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L49>)
|
||||
## func [OverrideWithConfig](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L50>)
|
||||
|
||||
```go
|
||||
func OverrideWithConfig(project *types.Project)
|
||||
@@ -30,7 +30,7 @@ func OverrideWithConfig(project *types.Project)
|
||||
OverrideWithConfig overrides the project with the katenary.yaml file. It will set the labels of the services with the values from the katenary.yaml file. It work in memory, so it will not modify the original project.
|
||||
|
||||
<a name="Service"></a>
|
||||
## type [Service](<https://github.com/katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L27-L44>)
|
||||
## type [Service](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L28-L45>)
|
||||
|
||||
Service is a struct that contains the service configuration for katenary
|
||||
|
||||
@@ -56,7 +56,7 @@ type Service struct {
|
||||
```
|
||||
|
||||
<a name="StringOrMap"></a>
|
||||
## type [StringOrMap](<https://github.com/katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L24>)
|
||||
## type [StringOrMap](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/katenaryfile/main.go#L25>)
|
||||
|
||||
StringOrMap is a struct that can be either a string or a map of strings. It's a helper struct to unmarshal the katenary.yaml file and produce the schema
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# labels
|
||||
|
||||
```go
|
||||
import "github.com/katenary/katenary/internal/generator/labels"
|
||||
import "katenary.io/internal/generator/labels"
|
||||
```
|
||||
|
||||
Package labels provides functionality to parse and manipulate labels.
|
||||
@@ -17,7 +17,7 @@ const KatenaryLabelPrefix = "katenary.v3"
|
||||
```
|
||||
|
||||
<a name="GetLabelHelp"></a>
|
||||
## func [GetLabelHelp](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L88>)
|
||||
## func [GetLabelHelp](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L89>)
|
||||
|
||||
```go
|
||||
func GetLabelHelp(asMarkdown bool) string
|
||||
@@ -26,7 +26,7 @@ func GetLabelHelp(asMarkdown bool) string
|
||||
GetLabelHelp return the help for the labels.
|
||||
|
||||
<a name="GetLabelHelpFor"></a>
|
||||
## func [GetLabelHelpFor](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L97>)
|
||||
## func [GetLabelHelpFor](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L98>)
|
||||
|
||||
```go
|
||||
func GetLabelHelpFor(labelname string, asMarkdown bool) string
|
||||
@@ -35,7 +35,7 @@ func GetLabelHelpFor(labelname string, asMarkdown bool) string
|
||||
GetLabelHelpFor returns the help for a specific label.
|
||||
|
||||
<a name="GetLabelNames"></a>
|
||||
## func [GetLabelNames](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L72>)
|
||||
## func [GetLabelNames](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L73>)
|
||||
|
||||
```go
|
||||
func GetLabelNames() []string
|
||||
@@ -44,7 +44,7 @@ func GetLabelNames() []string
|
||||
GetLabelNames returns a sorted list of all katenary label names.
|
||||
|
||||
<a name="Prefix"></a>
|
||||
## func [Prefix](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L235>)
|
||||
## func [Prefix](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L236>)
|
||||
|
||||
```go
|
||||
func Prefix() string
|
||||
@@ -53,7 +53,7 @@ func Prefix() string
|
||||
|
||||
|
||||
<a name="Help"></a>
|
||||
## type [Help](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L64-L69>)
|
||||
## type [Help](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L65-L70>)
|
||||
|
||||
Help is the documentation of a label.
|
||||
|
||||
@@ -67,7 +67,7 @@ type Help struct {
|
||||
```
|
||||
|
||||
<a name="Label"></a>
|
||||
## type [Label](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L57>)
|
||||
## type [Label](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L58>)
|
||||
|
||||
Label is a katenary label to find in compose files.
|
||||
|
||||
@@ -99,7 +99,7 @@ const (
|
||||
```
|
||||
|
||||
<a name="LabelName"></a>
|
||||
### func [LabelName](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L59>)
|
||||
### func [LabelName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/katenaryLabels.go#L60>)
|
||||
|
||||
```go
|
||||
func LabelName(name string) Label
|
||||
|
@@ -3,12 +3,12 @@
|
||||
# labelstructs
|
||||
|
||||
```go
|
||||
import "github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
import "katenary.io/internal/generator/labels/labelstructs"
|
||||
```
|
||||
|
||||
Package labelstructs is a package that contains the structs used to represent the labels in the yaml files.
|
||||
|
||||
## type [ConfigMapFiles](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/configMap.go#L5>)
|
||||
## type [ConfigMapFiles](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/configMap.go#L5>)
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ type ConfigMapFiles []string
|
||||
```
|
||||
|
||||
<a name="ConfigMapFileFrom"></a>
|
||||
### func [ConfigMapFileFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/configMap.go#L7>)
|
||||
### func [ConfigMapFileFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/configMap.go#L7>)
|
||||
|
||||
```go
|
||||
func ConfigMapFileFrom(data string) (ConfigMapFiles, error)
|
||||
@@ -26,7 +26,7 @@ func ConfigMapFileFrom(data string) (ConfigMapFiles, error)
|
||||
|
||||
|
||||
<a name="CronJob"></a>
|
||||
## type [CronJob](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/cronJob.go#L5-L10>)
|
||||
## type [CronJob](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/cronJob.go#L5-L10>)
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ type CronJob struct {
|
||||
```
|
||||
|
||||
<a name="CronJobFrom"></a>
|
||||
### func [CronJobFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/cronJob.go#L12>)
|
||||
### func [CronJobFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/cronJob.go#L12>)
|
||||
|
||||
```go
|
||||
func CronJobFrom(data string) (*CronJob, error)
|
||||
@@ -49,7 +49,7 @@ func CronJobFrom(data string) (*CronJob, error)
|
||||
|
||||
|
||||
<a name="Dependency"></a>
|
||||
## type [Dependency](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/dependencies.go#L6-L12>)
|
||||
## type [Dependency](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/dependencies.go#L6-L12>)
|
||||
|
||||
Dependency is a dependency of a chart to other charts.
|
||||
|
||||
@@ -64,7 +64,7 @@ type Dependency struct {
|
||||
```
|
||||
|
||||
<a name="DependenciesFrom"></a>
|
||||
### func [DependenciesFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/dependencies.go#L15>)
|
||||
### func [DependenciesFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/dependencies.go#L15>)
|
||||
|
||||
```go
|
||||
func DependenciesFrom(data string) ([]Dependency, error)
|
||||
@@ -73,7 +73,7 @@ func DependenciesFrom(data string) ([]Dependency, error)
|
||||
DependenciesFrom returns a slice of dependencies from the given string.
|
||||
|
||||
<a name="EnvFrom"></a>
|
||||
## type [EnvFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/envFrom.go#L5>)
|
||||
## type [EnvFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/envFrom.go#L5>)
|
||||
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ type EnvFrom []string
|
||||
```
|
||||
|
||||
<a name="EnvFromFrom"></a>
|
||||
### func [EnvFromFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/envFrom.go#L8>)
|
||||
### func [EnvFromFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/envFrom.go#L8>)
|
||||
|
||||
```go
|
||||
func EnvFromFrom(data string) (EnvFrom, error)
|
||||
@@ -91,7 +91,7 @@ func EnvFromFrom(data string) (EnvFrom, error)
|
||||
EnvFromFrom returns a EnvFrom from the given string.
|
||||
|
||||
<a name="ExchangeVolume"></a>
|
||||
## type [ExchangeVolume](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/exchangeVolume.go#L5-L10>)
|
||||
## type [ExchangeVolume](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/exchangeVolume.go#L5-L10>)
|
||||
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ type ExchangeVolume struct {
|
||||
```
|
||||
|
||||
<a name="NewExchangeVolumes"></a>
|
||||
### func [NewExchangeVolumes](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/exchangeVolume.go#L12>)
|
||||
### func [NewExchangeVolumes](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/exchangeVolume.go#L12>)
|
||||
|
||||
```go
|
||||
func NewExchangeVolumes(data string) ([]*ExchangeVolume, error)
|
||||
@@ -114,7 +114,7 @@ func NewExchangeVolumes(data string) ([]*ExchangeVolume, error)
|
||||
|
||||
|
||||
<a name="HealthCheck"></a>
|
||||
## type [HealthCheck](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/probes.go#L11-L14>)
|
||||
## type [HealthCheck](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/probes.go#L11-L14>)
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ type HealthCheck struct {
|
||||
```
|
||||
|
||||
<a name="ProbeFrom"></a>
|
||||
### func [ProbeFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/probes.go#L16>)
|
||||
### func [ProbeFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/probes.go#L16>)
|
||||
|
||||
```go
|
||||
func ProbeFrom(data string) (*HealthCheck, error)
|
||||
@@ -135,7 +135,7 @@ func ProbeFrom(data string) (*HealthCheck, error)
|
||||
|
||||
|
||||
<a name="Ingress"></a>
|
||||
## type [Ingress](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ingress.go#L14-L22>)
|
||||
## type [Ingress](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/ingress.go#L15-L23>)
|
||||
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ type Ingress struct {
|
||||
```
|
||||
|
||||
<a name="IngressFrom"></a>
|
||||
### func [IngressFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ingress.go#L25>)
|
||||
### func [IngressFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/ingress.go#L26>)
|
||||
|
||||
```go
|
||||
func IngressFrom(data string) (*Ingress, error)
|
||||
@@ -161,7 +161,7 @@ func IngressFrom(data string) (*Ingress, error)
|
||||
IngressFrom creates a new Ingress from a compose service.
|
||||
|
||||
<a name="MapEnv"></a>
|
||||
## type [MapEnv](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/mapenv.go#L5>)
|
||||
## type [MapEnv](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/mapenv.go#L5>)
|
||||
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ type MapEnv map[string]string
|
||||
```
|
||||
|
||||
<a name="MapEnvFrom"></a>
|
||||
### func [MapEnvFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/mapenv.go#L8>)
|
||||
### func [MapEnvFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/mapenv.go#L8>)
|
||||
|
||||
```go
|
||||
func MapEnvFrom(data string) (MapEnv, error)
|
||||
@@ -179,7 +179,7 @@ func MapEnvFrom(data string) (MapEnv, error)
|
||||
MapEnvFrom returns a MapEnv from the given string.
|
||||
|
||||
<a name="Ports"></a>
|
||||
## type [Ports](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ports.go#L5>)
|
||||
## type [Ports](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/ports.go#L5>)
|
||||
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ type Ports []uint32
|
||||
```
|
||||
|
||||
<a name="PortsFrom"></a>
|
||||
### func [PortsFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ports.go#L8>)
|
||||
### func [PortsFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/ports.go#L8>)
|
||||
|
||||
```go
|
||||
func PortsFrom(data string) (Ports, error)
|
||||
@@ -197,7 +197,7 @@ func PortsFrom(data string) (Ports, error)
|
||||
PortsFrom returns a Ports from the given string.
|
||||
|
||||
<a name="Secrets"></a>
|
||||
## type [Secrets](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/secrets.go#L5>)
|
||||
## type [Secrets](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/secrets.go#L5>)
|
||||
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ type Secrets []string
|
||||
```
|
||||
|
||||
<a name="SecretsFrom"></a>
|
||||
### func [SecretsFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/secrets.go#L7>)
|
||||
### func [SecretsFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/secrets.go#L7>)
|
||||
|
||||
```go
|
||||
func SecretsFrom(data string) (Secrets, error)
|
||||
@@ -215,7 +215,7 @@ func SecretsFrom(data string) (Secrets, error)
|
||||
|
||||
|
||||
<a name="TLS"></a>
|
||||
## type [TLS](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/ingress.go#L10-L12>)
|
||||
## type [TLS](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/ingress.go#L11-L13>)
|
||||
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ type TLS struct {
|
||||
```
|
||||
|
||||
<a name="ValueFrom"></a>
|
||||
## type [ValueFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/valueFrom.go#L5>)
|
||||
## type [ValueFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/valueFrom.go#L5>)
|
||||
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ type ValueFrom map[string]string
|
||||
```
|
||||
|
||||
<a name="GetValueFrom"></a>
|
||||
### func [GetValueFrom](<https://github.com/katenary/katenary/blob/master/internal/generator/labels/labelstructs/valueFrom.go#L7>)
|
||||
### func [GetValueFrom](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/generator/labels/labelstructs/valueFrom.go#L7>)
|
||||
|
||||
```go
|
||||
func GetValueFrom(data string) (*ValueFrom, error)
|
||||
|
@@ -3,12 +3,12 @@
|
||||
# parser
|
||||
|
||||
```go
|
||||
import "github.com/katenary/katenary/internal/parser"
|
||||
import "katenary.io/internal/parser"
|
||||
```
|
||||
|
||||
Package parser is a wrapper around compose\-go to parse compose files.
|
||||
|
||||
## func [Parse](<https://github.com/katenary/katenary/blob/master/internal/parser/main.go#L29>)
|
||||
## func [Parse](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/parser/main.go#L29>)
|
||||
|
||||
```go
|
||||
func Parse(profiles []string, envFiles []string, dockerComposeFile ...string) (*types.Project, error)
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# utils
|
||||
|
||||
```go
|
||||
import "github.com/katenary/katenary/internal/utils"
|
||||
import "katenary.io/internal/utils"
|
||||
```
|
||||
|
||||
Package utils provides some utility functions used in katenary. It defines some constants and functions used in the whole project.
|
||||
@@ -17,7 +17,7 @@ const DirectoryPermission = 0o755
|
||||
```
|
||||
|
||||
<a name="AsResourceName"></a>
|
||||
## func [AsResourceName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L196>)
|
||||
## func [AsResourceName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L196>)
|
||||
|
||||
```go
|
||||
func AsResourceName(name string) string
|
||||
@@ -26,7 +26,7 @@ func AsResourceName(name string) string
|
||||
AsResourceName returns a resource name with underscores to respect the kubernetes naming convention. It's the opposite of FixedResourceName.
|
||||
|
||||
<a name="Confirm"></a>
|
||||
## func [Confirm](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L164>)
|
||||
## func [Confirm](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L164>)
|
||||
|
||||
```go
|
||||
func Confirm(question string, icon ...Icon) bool
|
||||
@@ -35,7 +35,7 @@ func Confirm(question string, icon ...Icon) bool
|
||||
Confirm asks a question and returns true if the answer is y.
|
||||
|
||||
<a name="CountStartingSpaces"></a>
|
||||
## func [CountStartingSpaces](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L41>)
|
||||
## func [CountStartingSpaces](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L41>)
|
||||
|
||||
```go
|
||||
func CountStartingSpaces(line string) int
|
||||
@@ -44,7 +44,7 @@ func CountStartingSpaces(line string) int
|
||||
CountStartingSpaces counts the number of spaces at the beginning of a string.
|
||||
|
||||
<a name="EncodeBasicYaml"></a>
|
||||
## func [EncodeBasicYaml](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L178>)
|
||||
## func [EncodeBasicYaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L178>)
|
||||
|
||||
```go
|
||||
func EncodeBasicYaml(data any) ([]byte, error)
|
||||
@@ -53,7 +53,7 @@ func EncodeBasicYaml(data any) ([]byte, error)
|
||||
EncodeBasicYaml encodes a basic yaml from an interface.
|
||||
|
||||
<a name="FixedResourceName"></a>
|
||||
## func [FixedResourceName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L190>)
|
||||
## func [FixedResourceName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L190>)
|
||||
|
||||
```go
|
||||
func FixedResourceName(name string) string
|
||||
@@ -62,7 +62,7 @@ func FixedResourceName(name string) string
|
||||
FixedResourceName returns a resource name without underscores to respect the kubernetes naming convention.
|
||||
|
||||
<a name="GetContainerByName"></a>
|
||||
## func [GetContainerByName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L87>)
|
||||
## func [GetContainerByName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L87>)
|
||||
|
||||
```go
|
||||
func GetContainerByName(name string, containers []corev1.Container) (*corev1.Container, int)
|
||||
@@ -71,7 +71,7 @@ func GetContainerByName(name string, containers []corev1.Container) (*corev1.Con
|
||||
GetContainerByName returns a container by name and its index in the array. It returns nil, \-1 if not found.
|
||||
|
||||
<a name="GetKind"></a>
|
||||
## func [GetKind](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L54>)
|
||||
## func [GetKind](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L54>)
|
||||
|
||||
```go
|
||||
func GetKind(path string) (kind string)
|
||||
@@ -80,7 +80,7 @@ func GetKind(path string) (kind string)
|
||||
GetKind returns the kind of the resource from the file path.
|
||||
|
||||
<a name="GetServiceNameByPort"></a>
|
||||
## func [GetServiceNameByPort](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L77>)
|
||||
## func [GetServiceNameByPort](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L77>)
|
||||
|
||||
```go
|
||||
func GetServiceNameByPort(port int) string
|
||||
@@ -89,7 +89,7 @@ func GetServiceNameByPort(port int) string
|
||||
GetServiceNameByPort returns the service name for a port. It the service name is not found, it returns an empty string.
|
||||
|
||||
<a name="GetValuesFromLabel"></a>
|
||||
## func [GetValuesFromLabel](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L129>)
|
||||
## func [GetValuesFromLabel](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L129>)
|
||||
|
||||
```go
|
||||
func GetValuesFromLabel(service types.ServiceConfig, LabelValues string) map[string]*EnvConfig
|
||||
@@ -98,7 +98,7 @@ func GetValuesFromLabel(service types.ServiceConfig, LabelValues string) map[str
|
||||
GetValuesFromLabel returns a map of values from a label.
|
||||
|
||||
<a name="HashComposefiles"></a>
|
||||
## func [HashComposefiles](<https://github.com/katenary/katenary/blob/master/internal/utils/hash.go#L12>)
|
||||
## func [HashComposefiles](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/hash.go#L12>)
|
||||
|
||||
```go
|
||||
func HashComposefiles(files []string) (string, error)
|
||||
@@ -107,7 +107,7 @@ func HashComposefiles(files []string) (string, error)
|
||||
HashComposefiles returns a hash of the compose files.
|
||||
|
||||
<a name="Int32Ptr"></a>
|
||||
## func [Int32Ptr](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L35>)
|
||||
## func [Int32Ptr](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L35>)
|
||||
|
||||
```go
|
||||
func Int32Ptr(i int32) *int32
|
||||
@@ -116,7 +116,7 @@ func Int32Ptr(i int32) *int32
|
||||
Int32Ptr returns a pointer to an int32.
|
||||
|
||||
<a name="PathToName"></a>
|
||||
## func [PathToName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L106>)
|
||||
## func [PathToName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L106>)
|
||||
|
||||
```go
|
||||
func PathToName(path string) string
|
||||
@@ -125,7 +125,7 @@ func PathToName(path string) string
|
||||
PathToName converts a path to a kubernetes complient name.
|
||||
|
||||
<a name="StrPtr"></a>
|
||||
## func [StrPtr](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L38>)
|
||||
## func [StrPtr](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L38>)
|
||||
|
||||
```go
|
||||
func StrPtr(s string) *string
|
||||
@@ -134,7 +134,7 @@ func StrPtr(s string) *string
|
||||
StrPtr returns a pointer to a string.
|
||||
|
||||
<a name="TplName"></a>
|
||||
## func [TplName](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L22>)
|
||||
## func [TplName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L22>)
|
||||
|
||||
```go
|
||||
func TplName(serviceName, appname string, suffix ...string) string
|
||||
@@ -143,7 +143,7 @@ func TplName(serviceName, appname string, suffix ...string) string
|
||||
TplName returns the name of the kubernetes resource as a template string. It is used in the templates and defined in \_helper.tpl file.
|
||||
|
||||
<a name="TplValue"></a>
|
||||
## func [TplValue](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L97>)
|
||||
## func [TplValue](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L97>)
|
||||
|
||||
```go
|
||||
func TplValue(serviceName, variable string, pipes ...string) string
|
||||
@@ -152,7 +152,7 @@ func TplValue(serviceName, variable string, pipes ...string) string
|
||||
TplValue returns a string that can be used in a template to access a value from the values file.
|
||||
|
||||
<a name="Warn"></a>
|
||||
## func [Warn](<https://github.com/katenary/katenary/blob/master/internal/utils/icons.go#L25>)
|
||||
## func [Warn](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/icons.go#L25>)
|
||||
|
||||
```go
|
||||
func Warn(msg ...any)
|
||||
@@ -161,7 +161,7 @@ func Warn(msg ...any)
|
||||
Warn prints a warning message
|
||||
|
||||
<a name="WordWrap"></a>
|
||||
## func [WordWrap](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L159>)
|
||||
## func [WordWrap](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L159>)
|
||||
|
||||
```go
|
||||
func WordWrap(text string, lineWidth int) string
|
||||
@@ -170,7 +170,7 @@ func WordWrap(text string, lineWidth int) string
|
||||
WordWrap wraps a string to a given line width. Warning: it may break the string. You need to check the result.
|
||||
|
||||
<a name="Wrap"></a>
|
||||
## func [Wrap](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L71>)
|
||||
## func [Wrap](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L71>)
|
||||
|
||||
```go
|
||||
func Wrap(src, above, below string) string
|
||||
@@ -179,7 +179,7 @@ func Wrap(src, above, below string) string
|
||||
Wrap wraps a string with a string above and below. It will respect the indentation of the src string.
|
||||
|
||||
<a name="EnvConfig"></a>
|
||||
## type [EnvConfig](<https://github.com/katenary/katenary/blob/master/internal/utils/utils.go#L123-L126>)
|
||||
## type [EnvConfig](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L123-L126>)
|
||||
|
||||
EnvConfig is a struct to hold the description of an environment variable.
|
||||
|
||||
@@ -191,7 +191,7 @@ type EnvConfig struct {
|
||||
```
|
||||
|
||||
<a name="Icon"></a>
|
||||
## type [Icon](<https://github.com/katenary/katenary/blob/master/internal/utils/icons.go#L6>)
|
||||
## type [Icon](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/icons.go#L6>)
|
||||
|
||||
Icon is a unicode icon
|
||||
|
||||
|
@@ -4,7 +4,7 @@ plugins:
|
||||
- search
|
||||
- inline-svg
|
||||
- manpage:
|
||||
enabled: !ENV [MANPAGE, false]
|
||||
enabled: true
|
||||
preprocess: preprocess.py
|
||||
pages:
|
||||
- title: Katenary
|
||||
@@ -51,8 +51,8 @@ copyright: Copyright © 2021 - 2024 - Katenary authors
|
||||
extra:
|
||||
generator: false
|
||||
social:
|
||||
- icon: fontawesome/brands/github
|
||||
link: https://github.com/katenary/katenary
|
||||
- icon: fontawesome/brands/git
|
||||
link: https://repo.katenary.io/katenary/katenary
|
||||
nav:
|
||||
- "Home": index.md
|
||||
- usage.md
|
||||
|
796
doc/share/man/man1/katenary.1
Normal file
796
doc/share/man/man1/katenary.1
Normal file
@@ -0,0 +1,796 @@
|
||||
'\" t
|
||||
.\" Automatically generated by Pandoc 3.1.11.1
|
||||
.\"
|
||||
.TH "Katenary" "1" "2025-08-21" "mkdocs-manpage v2.0.1" "Katenary helm chart generator"
|
||||
.SH Basic Usage
|
||||
Basically, you can use \f[CR]katenary\f[R] to transpose a docker\-compose file (or any compose file compatible with \f[CR]podman\-compose\f[R] and \f[CR]docker\-compose\f[R]) to a configurable Helm Chart.
|
||||
This resulting helm chart can be installed with \f[CR]helm\f[R] command to your Kubernetes cluster.
|
||||
.PP
|
||||
For very basic compose files, without any specific configuration, Katenary will create a working helm chart using the simple command line:
|
||||
.IP
|
||||
.EX
|
||||
katenary convert
|
||||
.EE
|
||||
.PP
|
||||
This will create a \f[CR]chart\f[R] directory with the helm chart inside.
|
||||
.PP
|
||||
But, in general, you will need to add a few configurations to help Katenary to transpose the compose file to a working helm chart.
|
||||
.PP
|
||||
There are two ways to configure Katenary:
|
||||
.IP \[bu] 2
|
||||
Using the compose files, adding labels to the services
|
||||
.IP \[bu] 2
|
||||
Using a specific file named \f[CR]katenary.yaml\f[R]
|
||||
.PP
|
||||
The Katenary file \f[CR]katenary.yaml\f[R] has benefits over the labels in the compose file:
|
||||
.IP \[bu] 2
|
||||
you can validate the configuration with a schema, and use completion in your editor
|
||||
.IP \[bu] 2
|
||||
you separate the configuration and leave the compose file \[dq]intact\[dq]
|
||||
.IP \[bu] 2
|
||||
the syntax is a bit simpler, instead of using \f[CR]katenary.v3/xxx: |\-\f[R] you can use \f[CR]xxx: ...\f[R]
|
||||
.PP
|
||||
But: \f[B]this implies that you have to maintain two files if the compose file changes.\f[R]
|
||||
.PP
|
||||
For example.
|
||||
With \[dq]labels\[dq], you should do:
|
||||
.IP
|
||||
.EX
|
||||
# in compose file
|
||||
services:
|
||||
webapp:
|
||||
image: php:7\-apache
|
||||
ports:
|
||||
\- 8080:80
|
||||
environment:
|
||||
DB_HOST: database
|
||||
labels:
|
||||
katenary.v3/ingress: |\-
|
||||
hostname: myapp.example.com
|
||||
port: 8080
|
||||
katenary.v3/map\-env: |\-
|
||||
DB_HOST: \[dq]{{ .Release.Name }}\-database\[dq]
|
||||
.EE
|
||||
.PP
|
||||
Using a Katenary file, you can do:
|
||||
.IP
|
||||
.EX
|
||||
# in compose file, no need to add labels
|
||||
services:
|
||||
webapp:
|
||||
image: php:7\-apache
|
||||
ports:
|
||||
\- 8080:80
|
||||
environment:
|
||||
DB_HOST: database
|
||||
|
||||
# in katenary.yaml
|
||||
webapp:
|
||||
ingress:
|
||||
hostname: myapp.example.com
|
||||
port: 8080
|
||||
|
||||
map\-env:
|
||||
DB_HOST: \[dq]{{ .Release.Name }}\-database\[dq]
|
||||
.EE
|
||||
.PP
|
||||
YAML in multiline label
|
||||
.PP
|
||||
Compose only accept text label.
|
||||
So, to put a complete YAML content in the target label, you need to use a pipe char (\f[CR]|\f[R] or \f[CR]|\-\f[R]) and to \f[B]indent\f[R] your content.
|
||||
.PP
|
||||
For example :
|
||||
.IP
|
||||
.EX
|
||||
labels:
|
||||
# your labels
|
||||
foo: bar
|
||||
# katenary labels with multiline
|
||||
katenary.v3/ingress: |\-
|
||||
hostname: my.website.tld
|
||||
port: 80
|
||||
katenary.v3/ports: |\-
|
||||
\- 1234
|
||||
.EE
|
||||
.PP
|
||||
Katenary transforms compose services this way:
|
||||
.IP \[bu] 2
|
||||
Takes the service and create a \[dq]Deployment\[dq] file
|
||||
.IP \[bu] 2
|
||||
if a port is declared, Katenary creates a service (\f[CR]ClusterIP\f[R])
|
||||
.IP \[bu] 2
|
||||
if a port is exposed, Katenary creates a service (\f[CR]NodePort\f[R])
|
||||
.IP \[bu] 2
|
||||
environment variables will be stored inside a \f[CR]ConfigMap\f[R]
|
||||
.IP \[bu] 2
|
||||
image, tags, and ingresses configuration are also stored in \f[CR]values.yaml\f[R] file
|
||||
.IP \[bu] 2
|
||||
if named volumes are declared, Katenary create \f[CR]PersistentVolumeClaims\f[R] \- not enabled in values file
|
||||
.IP \[bu] 2
|
||||
\f[CR]depends_on\f[R] needs that the pointed service declared a port.
|
||||
If not, you can use labels to inform Katenary
|
||||
.PP
|
||||
For any other specific configuration, like binding local files as \f[CR]ConfigMap\f[R], bind variables, add values with documentation, etc.
|
||||
You\[aq]ll need to use labels.
|
||||
.PP
|
||||
Katenary can also configure containers grouping in pods, declare dependencies, ignore some services, force variables as secrets, mount files as \f[CR]configMap\f[R], and many others things.
|
||||
To adapt the helm chart generation, you will need to use some specific labels.
|
||||
.PP
|
||||
For more complete label usage, see the labels page.
|
||||
.PP
|
||||
Overriding file
|
||||
.PP
|
||||
It could be sometimes more convinient to separate the configuration related to Katenary inside a secondary file.
|
||||
.PP
|
||||
Instead of adding labels inside the \f[CR]compose.yaml\f[R] file, you can create a file named \f[CR]compose.katenary.yaml\f[R] and declare your labels inside.
|
||||
Katenary will detect it by default.
|
||||
.PP
|
||||
\f[B]No need to precise the file in the command line.\f[R]
|
||||
.SS Make conversion
|
||||
After having installed \f[CR]katenary\f[R], the standard usage is to call:
|
||||
.IP
|
||||
.EX
|
||||
katenary convert
|
||||
.EE
|
||||
.PP
|
||||
It will search standard compose files in the current directory and try to create a helm chart in \[dq]chart\[dq] directory.
|
||||
.PP
|
||||
Info
|
||||
.PP
|
||||
Katenary uses the compose\-go library which respects the Docker and Docker\-Compose specification.
|
||||
Keep in mind that it will find files exactly the same way as \f[CR]docker\-compose\f[R] and \f[CR]podman\-compose\f[R] do it.
|
||||
.PP
|
||||
Of course, you can provide others files than the default with (cumulative) \f[CR]\-c\f[R] options:
|
||||
.IP
|
||||
.EX
|
||||
katenary convert \-c file1.yaml \-c file2.yaml
|
||||
.EE
|
||||
.SS Some common labels to use
|
||||
Katenary proposes a lot of labels to configure the helm chart generation, but some are very important.
|
||||
.PP
|
||||
Info
|
||||
.PP
|
||||
For more complete label usage, see the labels page.
|
||||
.SS Work with Depends On?
|
||||
Kubernetes does not provide service or pod starting detection from others pods.
|
||||
But Katenary will create \f[CR]initContainer\f[R] to make you able to wait for a service to respond.
|
||||
But you\[aq]ll probably need to adapt a bit the compose file.
|
||||
.PP
|
||||
See this compose file:
|
||||
.IP
|
||||
.EX
|
||||
version: \[dq]3\[dq]
|
||||
|
||||
services:
|
||||
webapp:
|
||||
image: php:8\-apache
|
||||
depends_on:
|
||||
\- database
|
||||
|
||||
database:
|
||||
image: mariadb
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: foobar
|
||||
.EE
|
||||
.PP
|
||||
In this case, \f[CR]webapp\f[R] needs to know the \f[CR]database\f[R] port because the \f[CR]depends_on\f[R] points on it and Kubernetes has not (yet) solution to check the database startup.
|
||||
Katenary wants to create a \f[CR]initContainer\f[R] to hit on the related service.
|
||||
So, instead of exposing the port in the compose definition, let\[aq]s declare this to Katenary with labels:
|
||||
.IP
|
||||
.EX
|
||||
version: \[dq]3\[dq]
|
||||
|
||||
services:
|
||||
webapp:
|
||||
image: php:8\-apache
|
||||
depends_on:
|
||||
\- database
|
||||
|
||||
database:
|
||||
image: mariadb
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: foobar
|
||||
labels:
|
||||
katenary.v3/ports: |\-
|
||||
\- 3306
|
||||
.EE
|
||||
.SS Declare ingresses
|
||||
It\[aq]s very common to have an Ingress resource on web application to deploy on Kubernetes.
|
||||
It allows exposing the service to the outside of the cluster (you need to install an ingress controller).
|
||||
.PP
|
||||
Katenary can create this resource for you.
|
||||
You just need to declare the hostname and the port to bind.
|
||||
.IP
|
||||
.EX
|
||||
services:
|
||||
webapp:
|
||||
image: ...
|
||||
ports: 8080:5050
|
||||
labels:
|
||||
katenary.v3/ingress: |\-
|
||||
# the target port is 5050 wich is the \[dq]service\[dq] port
|
||||
port: 5050
|
||||
hostname: myapp.example.com
|
||||
.EE
|
||||
.PP
|
||||
Note that the port to bind is the one used by the container, not the used locally.
|
||||
This is because Katenary create a service to bind the container itself.
|
||||
.SS Map environment to helm values
|
||||
A lot of framework needs to receive service host or IP in an environment variable to configure the connection.
|
||||
For example, to connect a PHP application to a database.
|
||||
.PP
|
||||
With a compose file, there is no problem as Docker/Podman allows resolving the name by container name:
|
||||
.IP
|
||||
.EX
|
||||
services:
|
||||
webapp:
|
||||
image: php:7\-apache
|
||||
environment:
|
||||
DB_HOST: database
|
||||
|
||||
database:
|
||||
image: mariadb
|
||||
.EE
|
||||
.PP
|
||||
Katenary prefixes the services with \f[CR]{{ .Release.Name }}\f[R] (to make it possible to install the application several times in a namespace), so you need to \[dq]remap\[dq] the environment variable to the right one.
|
||||
.IP
|
||||
.EX
|
||||
services:
|
||||
webapp:
|
||||
image: php:7\-apache
|
||||
environment:
|
||||
DB_HOST: database
|
||||
labels:
|
||||
katenary.v3/mapenv: |\-
|
||||
DB_HOST: \[dq]{{ .Release.Name }}\-database\[dq]
|
||||
|
||||
database:
|
||||
image: mariadb
|
||||
.EE
|
||||
.PP
|
||||
This label can be used to map others environment for any others reason.
|
||||
E.g.
|
||||
to change an informational environment variable.
|
||||
.IP
|
||||
.EX
|
||||
services:
|
||||
webapp:
|
||||
#...
|
||||
environment:
|
||||
RUNNING: docker
|
||||
labels:
|
||||
katenary.v3/mapenv: |\-
|
||||
RUNNING: kubernetes
|
||||
.EE
|
||||
.PP
|
||||
In the above example, \f[CR]RUNNING\f[R] will be set to \f[CR]kubernetes\f[R] when you\[aq]ll deploy the application with helm, and it\[aq]s \f[CR]docker\f[R] for \[dq]Podman\[dq] and \[dq]Docker\[dq] executions.
|
||||
.SH Labels documentation
|
||||
Katenary proposes labels to set in \f[CR]compose.yaml\f[R] files (or override files) to configure the Helm Chart generation.
|
||||
Because it is sometimes needed to have structured values, it is necessary to use the YAML syntax.
|
||||
While compose labels are string, we can use \f[I]here\-doc\f[R] syntax using \f[CR]|\f[R] to use YAML multiline as value.
|
||||
.IP
|
||||
.EX
|
||||
label\-name: |\-
|
||||
# this is actually a multiline string here
|
||||
key1: value1
|
||||
key2: value2
|
||||
.EE
|
||||
.PP
|
||||
Katenary will try to \f[I]Unmarshal\f[R] these labels.
|
||||
.SS Label list and types
|
||||
.PP
|
||||
.TS
|
||||
tab(@);
|
||||
l l l.
|
||||
T{
|
||||
Label name
|
||||
T}@T{
|
||||
Description
|
||||
T}@T{
|
||||
Type
|
||||
T}
|
||||
_
|
||||
T{
|
||||
\f[CR]katenary.v3/configmap\-files\f[R]
|
||||
T}@T{
|
||||
Inject files as Configmap.
|
||||
T}@T{
|
||||
\f[CR][]string\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/cronjob\f[R]
|
||||
T}@T{
|
||||
Create a cronjob from the service.
|
||||
T}@T{
|
||||
\f[CR]object\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/dependencies\f[R]
|
||||
T}@T{
|
||||
Add Helm dependencies to the service.
|
||||
T}@T{
|
||||
\f[CR][]object\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/description\f[R]
|
||||
T}@T{
|
||||
Description of the service
|
||||
T}@T{
|
||||
\f[CR]string\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/env\-from\f[R]
|
||||
T}@T{
|
||||
Add environment variables from another service.
|
||||
T}@T{
|
||||
\f[CR][]string\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/exchange\-volumes\f[R]
|
||||
T}@T{
|
||||
Add exchange volumes (empty directory on the node) to share data
|
||||
T}@T{
|
||||
\f[CR][]object\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/health\-check\f[R]
|
||||
T}@T{
|
||||
Health check to be added to the deployment.
|
||||
T}@T{
|
||||
\f[CR]object\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/ignore\f[R]
|
||||
T}@T{
|
||||
Ignore the service
|
||||
T}@T{
|
||||
\f[CR]bool\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/ingress\f[R]
|
||||
T}@T{
|
||||
Ingress rules to be added to the service.
|
||||
T}@T{
|
||||
\f[CR]object\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/main\-app\f[R]
|
||||
T}@T{
|
||||
Mark the service as the main app.
|
||||
T}@T{
|
||||
\f[CR]bool\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/map\-env\f[R]
|
||||
T}@T{
|
||||
Map env vars from the service to the deployment.
|
||||
T}@T{
|
||||
\f[CR]map[string]string\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/ports\f[R]
|
||||
T}@T{
|
||||
Ports to be added to the service.
|
||||
T}@T{
|
||||
\f[CR][]uint32\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/same\-pod\f[R]
|
||||
T}@T{
|
||||
Move the same\-pod deployment to the target deployment.
|
||||
T}@T{
|
||||
\f[CR]string\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/secrets\f[R]
|
||||
T}@T{
|
||||
Env vars to be set as secrets.
|
||||
T}@T{
|
||||
\f[CR][]string\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/values\f[R]
|
||||
T}@T{
|
||||
Environment variables to be added to the values.yaml
|
||||
T}@T{
|
||||
\f[CR][]string or map[string]string\f[R]
|
||||
T}
|
||||
T{
|
||||
\f[CR]katenary.v3/values\-from\f[R]
|
||||
T}@T{
|
||||
Add values from another service.
|
||||
T}@T{
|
||||
\f[CR]map[string]string\f[R]
|
||||
T}
|
||||
.TE
|
||||
.SS Detailed description
|
||||
.SS katenary.v3/configmap\-files
|
||||
Inject files as Configmap.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR][]string\f[R]
|
||||
.PP
|
||||
It makes a file or directory to be converted to one or more ConfigMaps and mounted in the pod.
|
||||
The file or directory is relative to the service directory.
|
||||
.PP
|
||||
If it is a directory, all files inside it are added to the ConfigMap.
|
||||
.PP
|
||||
If the directory as subdirectories, so one configmap per subpath are created.
|
||||
.PP
|
||||
Warning
|
||||
.PP
|
||||
It is not intended to be used to store an entire project in configmaps.
|
||||
It is intended to be used to store configuration files that are not managed by the application, like nginx configuration files.
|
||||
Keep in mind that your project sources should be stored in an application image or in a storage.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
volumes
|
||||
\- ./conf.d:/etc/nginx/conf.d
|
||||
labels:
|
||||
katenary.v3/configmap\-files: |\-
|
||||
\- ./conf.d
|
||||
.EE
|
||||
.SS katenary.v3/cronjob
|
||||
Create a cronjob from the service.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR]object\f[R]
|
||||
.PP
|
||||
This adds a cronjob to the chart.
|
||||
.PP
|
||||
The label value is a YAML object with the following attributes: \- command: the command to be executed \- schedule: the cron schedule (cron format or \[at]every where \[dq]every\[dq] is a duration like 1h30m, daily, hourly...)
|
||||
\- rbac: false (optionnal), if true, it will create a role, a rolebinding and a serviceaccount to make your cronjob able to connect the Kubernetes API
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
labels:
|
||||
katenary.v3/cronjob: |\-
|
||||
command: echo \[dq]hello world\[dq]
|
||||
schedule: \[dq]* */1 * * *\[dq] # or \[at]hourly for example
|
||||
.EE
|
||||
.SS katenary.v3/dependencies
|
||||
Add Helm dependencies to the service.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR][]object\f[R]
|
||||
.PP
|
||||
Set the service to be, actually, a Helm dependency.
|
||||
This means that the service will not be exported as template.
|
||||
The dependencies are added to the Chart.yaml file and the values are added to the values.yaml file.
|
||||
.PP
|
||||
It\[aq]s a list of objects with the following attributes:
|
||||
.IP \[bu] 2
|
||||
name: the name of the dependency
|
||||
.IP \[bu] 2
|
||||
repository: the repository of the dependency
|
||||
.IP \[bu] 2
|
||||
alias: the name of the dependency in values.yaml (optional)
|
||||
.IP \[bu] 2
|
||||
values: the values to be set in values.yaml (optional)
|
||||
.PP
|
||||
Info
|
||||
.PP
|
||||
Katenary doesn\[aq]t update the helm depenedencies by default.
|
||||
.PP
|
||||
Use \f[CR]\-\-helm\-update\f[R] (or \f[CR]\-u\f[R]) flag to update the dependencies.
|
||||
.PP
|
||||
example: \f[CR]katenary convert \-u\f[R]
|
||||
.PP
|
||||
By setting an alias, it is possible to change the name of the dependency in values.yaml.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
labels:
|
||||
katenary.v3/dependencies: |\-
|
||||
\- name: mariadb
|
||||
repository: oci://registry\-1.docker.io/bitnamicharts
|
||||
|
||||
## optional, it changes the name of the section in values.yaml
|
||||
# alias: mydatabase
|
||||
|
||||
## optional, it adds the values to values.yaml
|
||||
values:
|
||||
auth:
|
||||
database: mydatabasename
|
||||
username: myuser
|
||||
password: the secret password
|
||||
.EE
|
||||
.SS katenary.v3/description
|
||||
Description of the service
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR]string\f[R]
|
||||
.PP
|
||||
This replaces the default comment in values.yaml file to the given description.
|
||||
It is useful to document the service and configuration.
|
||||
.PP
|
||||
The value can be set with a documentation in multiline format.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
labels:
|
||||
katenary.v3/description: |\-
|
||||
This is a description of the service.
|
||||
It can be multiline.
|
||||
.EE
|
||||
.SS katenary.v3/env\-from
|
||||
Add environment variables from another service.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR][]string\f[R]
|
||||
.PP
|
||||
It adds environment variables from another service to the current service.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
service1:
|
||||
image: nginx:1.19
|
||||
environment:
|
||||
FOO: bar
|
||||
|
||||
service2:
|
||||
image: php:7.4\-fpm
|
||||
labels:
|
||||
# get the congigMap from service1 where FOO is
|
||||
# defined inside this service too
|
||||
katenary.v3/env\-from: |\-
|
||||
\- myservice1
|
||||
.EE
|
||||
.SS katenary.v3/exchange\-volumes
|
||||
Add exchange volumes (empty directory on the node) to share data
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR][]object\f[R]
|
||||
.PP
|
||||
This label allows sharing data between containres.
|
||||
The volume is created in the node and mounted in the pod.
|
||||
It is useful to share data between containers in a \[dq]same pod\[dq] logic.
|
||||
For example to let PHP\-FPM and Nginx share the same direcotory.
|
||||
.PP
|
||||
This will create:
|
||||
.IP \[bu] 2
|
||||
an \f[CR]emptyDir\f[R] volume in the deployment
|
||||
.IP \[bu] 2
|
||||
a \f[CR]voumeMount\f[R] in the pod for \f[B]each container\f[R]
|
||||
.IP \[bu] 2
|
||||
a \f[CR]initContainer\f[R] for each definition
|
||||
.PP
|
||||
Fields: \- name: the name of the volume (manadatory) \- mountPath: the path where the volume is mounted in the pod (optional, default is \f[CR]/opt\f[R]) \- init: a command to run to initialize the volume with data (optional)
|
||||
.PP
|
||||
Warning
|
||||
.PP
|
||||
This is highly experimental.
|
||||
This is mainly useful when using the \[dq]same\-pod\[dq] label.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
nginx:
|
||||
# ...
|
||||
labels;
|
||||
katenary.v3/exchange\-volumes: |\-
|
||||
\- name: php\-fpm
|
||||
mountPath: /var/www/html
|
||||
php:
|
||||
# ...
|
||||
labels:
|
||||
katenary.v3/exchange\-volumes: |\-
|
||||
\- name: php\-fpm
|
||||
mountPath: /opt
|
||||
init: cp \-ra /var/www/html/* /opt
|
||||
.EE
|
||||
.SS katenary.v3/health\-check
|
||||
Health check to be added to the deployment.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR]object\f[R]
|
||||
.PP
|
||||
Health check to be added to the deployment.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
labels:
|
||||
katenary.v3/health\-check: |\-
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8080
|
||||
.EE
|
||||
.SS katenary.v3/ignore
|
||||
Ignore the service
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR]bool\f[R]
|
||||
.PP
|
||||
Ingoring a service to not be exported in helm chart.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
labels:
|
||||
katenary.v3/ignore: \[dq]true\[dq]
|
||||
.EE
|
||||
.SS katenary.v3/ingress
|
||||
Ingress rules to be added to the service.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR]object\f[R]
|
||||
.PP
|
||||
Declare an ingress rule for the service.
|
||||
The port should be exposed or declared with \f[CR]katenary.v3/ports\f[R].
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
labels:
|
||||
katenary.v3/ingress: |\-
|
||||
port: 80
|
||||
hostname: mywebsite.com (optional)
|
||||
.EE
|
||||
.SS katenary.v3/main\-app
|
||||
Mark the service as the main app.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR]bool\f[R]
|
||||
.PP
|
||||
This makes the service to be the main application.
|
||||
Its image tag is considered to be the Chart appVersion and to be the defaultvalue in Pod container image attribute.
|
||||
.PP
|
||||
Warning
|
||||
.PP
|
||||
This label cannot be repeated in others services.
|
||||
If this label is set in more than one service as true, Katenary will return an error.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
ghost:
|
||||
image: ghost:1.25.5
|
||||
labels:
|
||||
# The chart is now named ghost, and the appVersion is 1.25.5.
|
||||
# In Deployment, the image attribute is set to ghost:1.25.5 if
|
||||
# you don\[aq]t change the \[dq]tag\[dq] attribute in values.yaml
|
||||
katenary.v3/main\-app: true
|
||||
.EE
|
||||
.SS katenary.v3/map\-env
|
||||
Map env vars from the service to the deployment.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR]map[string]string\f[R]
|
||||
.PP
|
||||
Because you may need to change the variable for Kubernetes, this label forces the value to another.
|
||||
It is also particullary helpful to use a template value instead.
|
||||
For example, you could bind the value to a service name with Helm attributes: \f[CR]{{ tpl .Release.Name . }}\f[R].
|
||||
.PP
|
||||
If you use \f[CR]__APP__\f[R] in the value, it will be replaced by the Chart name.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
env:
|
||||
DB_HOST: database
|
||||
RUNNING: docker
|
||||
OTHER: value
|
||||
labels:
|
||||
katenary.v3/map\-env: |\-
|
||||
RUNNING: kubernetes
|
||||
DB_HOST: \[aq]{{ include \[dq]__APP__.fullname\[dq] . }}\-database\[aq]
|
||||
.EE
|
||||
.SS katenary.v3/ports
|
||||
Ports to be added to the service.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR][]uint32\f[R]
|
||||
.PP
|
||||
Only useful for services without exposed port.
|
||||
It is mandatory if the service is a dependency of another service.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
labels:
|
||||
katenary.v3/ports: |\-
|
||||
\- 8080
|
||||
\- 8081
|
||||
.EE
|
||||
.SS katenary.v3/same\-pod
|
||||
Move the same\-pod deployment to the target deployment.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR]string\f[R]
|
||||
.PP
|
||||
This will make the service to be included in another service pod.
|
||||
Some services must work together in the same pod, like a sidecar or a proxy or nginx + php\-fpm.
|
||||
.PP
|
||||
Note that volume and VolumeMount are copied from the source to the target deployment.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
web:
|
||||
image: nginx:1.19
|
||||
|
||||
php:
|
||||
image: php:7.4\-fpm
|
||||
labels:
|
||||
katenary.v3/same\-pod: web
|
||||
.EE
|
||||
.SS katenary.v3/secrets
|
||||
Env vars to be set as secrets.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR][]string\f[R]
|
||||
.PP
|
||||
This label allows setting the environment variables as secrets.
|
||||
The variable is removed from the environment and added to a secret object.
|
||||
.PP
|
||||
The variable can be set to the \f[CR]katenary.v3/values\f[R] too, so the secret value can be configured in values.yaml
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
env:
|
||||
PASSWORD: a very secret password
|
||||
NOT_A_SECRET: a public value
|
||||
labels:
|
||||
katenary.v3/secrets: |\-
|
||||
\- PASSWORD
|
||||
.EE
|
||||
.SS katenary.v3/values
|
||||
Environment variables to be added to the values.yaml
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR][]string or map[string]string\f[R]
|
||||
.PP
|
||||
By default, all environment variables in the \[dq]env\[dq] and environment files are added to configmaps with the static values set.
|
||||
This label allows adding environment variables to the values.yaml file.
|
||||
.PP
|
||||
Note that the value inside the configmap is \f[CR]{{ tpl vaname . }}\f[R], so you can set the value to a template that will be rendered with the values.yaml file.
|
||||
.PP
|
||||
The value can be set with a documentation.
|
||||
This may help to understand the purpose of the variable.
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
env:
|
||||
FOO: bar
|
||||
DB_NAME: mydb
|
||||
TO_CONFIGURE: something that can be changed in values.yaml
|
||||
A_COMPLEX_VALUE: example
|
||||
labels:
|
||||
katenary.v3/values: |\-
|
||||
# simple values, set as is in values.yaml
|
||||
\- TO_CONFIGURE
|
||||
# complex values, set as a template in values.yaml with a documentation
|
||||
\- A_COMPLEX_VALUE: |\-
|
||||
This is the documentation for the variable to
|
||||
configure in values.yaml.
|
||||
It can be, of course, a multiline text.
|
||||
.EE
|
||||
.SS katenary.v3/values\-from
|
||||
Add values from another service.
|
||||
.PP
|
||||
\f[B]Type\f[R]: \f[CR]map[string]string\f[R]
|
||||
.PP
|
||||
This label allows adding values from another service to the current service.
|
||||
It avoid duplicating values, environment or secrets that should be the same.
|
||||
.PP
|
||||
The key is the value to be added, and the value is the \[dq]key\[dq] to fetch in the form \f[CR]service_name.environment_name\f[R].
|
||||
.PP
|
||||
\f[B]Example:\f[R]
|
||||
.IP
|
||||
.EX
|
||||
database:
|
||||
image: mariadb:10.5
|
||||
environment:
|
||||
MARIADB_USER: myuser
|
||||
MARIADB_PASSWORD: mypassword
|
||||
labels:
|
||||
# we can declare secrets
|
||||
katenary.v3/secrets: |\-
|
||||
\- MARIADB_PASSWORD
|
||||
php:
|
||||
image: php:7.4\-fpm
|
||||
environment:
|
||||
# it\[aq]s duplicated in docker / podman
|
||||
DB_USER: myuser
|
||||
DB_PASSWORD: mypassword
|
||||
labels:
|
||||
# removes the duplicated, use the configMap and secrets from \[dq]database\[dq]
|
||||
katenary.v3/values\-from: |\-
|
||||
DB_USER: database.MARIADB_USER
|
||||
DB_PASSWORD: database.MARIADB_PASSWORD
|
||||
.EE
|
20
go.mod
20
go.mod
@@ -1,8 +1,6 @@
|
||||
module github.com/katenary/katenary
|
||||
module katenary.io
|
||||
|
||||
go 1.24.0
|
||||
|
||||
toolchain go1.24.3
|
||||
go 1.25
|
||||
|
||||
require (
|
||||
github.com/compose-spec/compose-go v1.20.2
|
||||
@@ -11,8 +9,8 @@ require (
|
||||
github.com/spf13/cobra v1.9.1
|
||||
github.com/thediveo/netdb v1.1.2
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
k8s.io/api v0.33.3
|
||||
k8s.io/apimachinery v0.33.3
|
||||
k8s.io/api v0.33.4
|
||||
k8s.io/apimachinery v0.33.4
|
||||
sigs.k8s.io/yaml v1.6.0
|
||||
)
|
||||
|
||||
@@ -20,7 +18,7 @@ require (
|
||||
github.com/bahlo/generic-list-go v0.2.0 // indirect
|
||||
github.com/buger/jsonparser v1.1.1 // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/docker/go-connections v0.5.0 // indirect
|
||||
github.com/docker/go-connections v0.6.0 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
@@ -45,11 +43,11 @@ require (
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect
|
||||
golang.org/x/net v0.42.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20250813145105-42675adae3e6 // indirect
|
||||
golang.org/x/net v0.43.0 // indirect
|
||||
golang.org/x/sync v0.16.0 // indirect
|
||||
golang.org/x/sys v0.34.0 // indirect
|
||||
golang.org/x/text v0.27.0 // indirect
|
||||
golang.org/x/sys v0.35.0 // indirect
|
||||
golang.org/x/text v0.28.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
|
||||
|
32
go.sum
32
go.sum
@@ -11,8 +11,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
|
||||
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
|
||||
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
|
||||
github.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pMmjSD94=
|
||||
github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE=
|
||||
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
|
||||
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
|
||||
@@ -103,16 +103,16 @@ go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 h1:R9PFI6EUdfVKgwKjZef7QIwGcBKu86OEFpJ9nUEP2l4=
|
||||
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc=
|
||||
golang.org/x/exp v0.0.0-20250813145105-42675adae3e6 h1:SbTAbRFnd5kjQXbczszQ0hdk3ctwYf3qBNH9jIsGclE=
|
||||
golang.org/x/exp v0.0.0-20250813145105-42675adae3e6/go.mod h1:4QTo5u+SEIbbKW1RacMZq1YEfOBqeXa19JeshGi+zc4=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
|
||||
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
|
||||
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
|
||||
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -122,18 +122,18 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
||||
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
|
||||
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
|
||||
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
|
||||
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
|
||||
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0=
|
||||
golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw=
|
||||
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
|
||||
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
@@ -148,10 +148,10 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
|
||||
gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g=
|
||||
k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8=
|
||||
k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE=
|
||||
k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA=
|
||||
k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
|
||||
k8s.io/api v0.33.4 h1:oTzrFVNPXBjMu0IlpA2eDDIU49jsuEorGHB4cvKupkk=
|
||||
k8s.io/api v0.33.4/go.mod h1:VHQZ4cuxQ9sCUMESJV5+Fe8bGnqAARZ08tSTdHWfeAc=
|
||||
k8s.io/apimachinery v0.33.4 h1:SOf/JW33TP0eppJMkIgQ+L6atlDiP/090oaX0y9pd9s=
|
||||
k8s.io/apimachinery v0.33.4/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
|
||||
|
@@ -9,9 +9,9 @@ import (
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels"
|
||||
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
|
@@ -2,9 +2,6 @@ package generator
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -12,6 +9,10 @@ import (
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@@ -3,11 +3,12 @@ package generator
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"os"
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
@@ -12,12 +12,12 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/katenary/katenary/internal/generator/extrafiles"
|
||||
"github.com/katenary/katenary/internal/generator/katenaryfile"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"github.com/katenary/katenary/internal/parser"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"katenary.io/internal/generator/extrafiles"
|
||||
"katenary.io/internal/generator/katenaryfile"
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
"katenary.io/internal/parser"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
)
|
||||
|
@@ -1,12 +1,13 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
batchv1 "k8s.io/api/batch/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
@@ -82,9 +83,7 @@ func NewCronJob(service types.ServiceConfig, chart *HelmChart, appName string) (
|
||||
{
|
||||
Name: "cronjob",
|
||||
Image: "{{ .Values." + service.Name + ".cronjob.repository.image }}:{{ default .Values." + service.Name + ".cronjob.repository.tag \"latest\" }}",
|
||||
Command: []string{
|
||||
"sh",
|
||||
"-c",
|
||||
Args: []string{
|
||||
mapping.Command,
|
||||
},
|
||||
},
|
||||
|
@@ -38,8 +38,8 @@ services:
|
||||
if cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Image != "alpine:latest" {
|
||||
t.Errorf("Expected image to be alpine, got %s", cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Image)
|
||||
}
|
||||
combinedCommand := strings.Join(cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Command, " ")
|
||||
if combinedCommand != "sh -c echo hello" {
|
||||
combinedCommand := strings.Join(cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Args, " ")
|
||||
if combinedCommand != "echo hello" {
|
||||
t.Errorf("Expected command to be sh -c echo hello, got %s", combinedCommand)
|
||||
}
|
||||
if cronJob.Spec.Schedule != "*/1 * * * *" {
|
||||
|
@@ -2,9 +2,6 @@ package generator
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -12,6 +9,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
@@ -136,7 +137,8 @@ func (d *Deployment) AddContainer(service types.ServiceConfig) {
|
||||
Resources: corev1.ResourceRequirements{
|
||||
Requests: corev1.ResourceList{},
|
||||
},
|
||||
Command: service.Command,
|
||||
Command: service.Entrypoint,
|
||||
Args: service.Command,
|
||||
}
|
||||
if _, ok := d.chart.Values[service.Name]; !ok {
|
||||
d.chart.Values[service.Name] = NewValue(service, d.isMainApp)
|
||||
|
@@ -2,11 +2,12 @@ package generator
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
|
||||
yaml3 "gopkg.in/yaml.v3"
|
||||
v1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
@@ -523,7 +524,7 @@ services:
|
||||
t.Errorf(unmarshalError, err)
|
||||
}
|
||||
// find the command in the container
|
||||
command := dt.Spec.Template.Spec.Containers[0].Command
|
||||
command := dt.Spec.Template.Spec.Containers[0].Args
|
||||
if len(command) != 3 {
|
||||
t.Errorf("Expected command to have 3 elements, got %d", len(command))
|
||||
}
|
||||
@@ -531,3 +532,34 @@ services:
|
||||
t.Errorf("Expected command to be 'sh -c', got %s", strings.Join(command, " "))
|
||||
}
|
||||
}
|
||||
|
||||
func TestEntryPoint(t *testing.T) {
|
||||
composeFile := `
|
||||
services:
|
||||
web:
|
||||
image: nginx:1.29
|
||||
entrypoint: /bin/foo
|
||||
command: bar baz
|
||||
`
|
||||
tmpDir := setup(composeFile)
|
||||
defer teardown(tmpDir)
|
||||
|
||||
currentDir, _ := os.Getwd()
|
||||
os.Chdir(tmpDir)
|
||||
defer os.Chdir(currentDir)
|
||||
|
||||
output := internalCompileTest(t, "-s", "templates/web/deployment.yaml")
|
||||
t.Logf("Output: %s", output)
|
||||
deployment := v1.Deployment{}
|
||||
if err := yaml.Unmarshal([]byte(output), &deployment); err != nil {
|
||||
t.Errorf(unmarshalError, err)
|
||||
}
|
||||
entryPoint := deployment.Spec.Template.Spec.Containers[0].Command
|
||||
command := deployment.Spec.Template.Spec.Containers[0].Args
|
||||
if entryPoint[0] != "/bin/foo" {
|
||||
t.Errorf("Expected entrypoint to be /bin/foo, got %s", entryPoint[0])
|
||||
}
|
||||
if len(command) != 2 || command[0] != "bar" || command[1] != "baz" {
|
||||
t.Errorf("Expected command to be 'bar baz', got %s", strings.Join(command, " "))
|
||||
}
|
||||
}
|
||||
|
@@ -7,9 +7,9 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
@@ -3,7 +3,7 @@ package generator
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -2,8 +2,9 @@ package generator
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"strings"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
)
|
||||
|
||||
// helmHelper is a template for the _helpers.tpl file in the chart templates directory.
|
||||
|
@@ -4,9 +4,9 @@ import (
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
networkv1 "k8s.io/api/networking/v1"
|
||||
|
@@ -2,10 +2,11 @@ package generator
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
|
||||
v1 "k8s.io/api/networking/v1"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
@@ -4,14 +4,15 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"log"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
"github.com/invopop/jsonschema"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
@@ -1,12 +1,13 @@
|
||||
package katenaryfile
|
||||
|
||||
import (
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
|
||||
"github.com/compose-spec/compose-go/cli"
|
||||
)
|
||||
|
||||
|
@@ -2,7 +2,8 @@ package generator
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
)
|
||||
|
||||
var componentLabel = labels.LabelName("component")
|
||||
|
@@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"log"
|
||||
"regexp"
|
||||
"sort"
|
||||
@@ -12,6 +11,8 @@ import (
|
||||
"text/tabwriter"
|
||||
"text/template"
|
||||
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
|
@@ -1,8 +1,9 @@
|
||||
package labelstructs_test
|
||||
|
||||
import (
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"testing"
|
||||
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
)
|
||||
|
||||
func TestConfigMapFileFrom(t *testing.T) {
|
||||
|
@@ -2,7 +2,8 @@ package labelstructs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
@@ -2,10 +2,11 @@ package generator
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"strings"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@@ -3,10 +3,11 @@ package generator
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
@@ -2,10 +2,11 @@ package generator
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"os/exec"
|
||||
"testing"
|
||||
|
||||
"github.com/katenary/katenary/internal/parser"
|
||||
"katenary.io/internal/parser"
|
||||
)
|
||||
|
||||
const unmarshalError = "Failed to unmarshal the output: %s"
|
||||
|
@@ -5,9 +5,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/generator/labels/labelstructs"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/generator/labels/labelstructs"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
@@ -2,12 +2,13 @@ package generator
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/cli"
|
||||
)
|
||||
|
||||
|
@@ -3,6 +3,7 @@ package generator
|
||||
import (
|
||||
"regexp"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Version is the version of katenary. It is set at compile time.
|
||||
@@ -14,8 +15,15 @@ var Version = "master" // changed at compile time
|
||||
func GetVersion() string {
|
||||
// try to get the semantic version from the Version variable (theorically set at compile time)
|
||||
if reg := regexp.MustCompile(`^v?\d+.\d+.\d+.*|^release-.*`); reg.MatchString(Version) {
|
||||
Version = strings.Replace(Version, "release-", "v", 1)
|
||||
if Version[0] != 'v' {
|
||||
Version = "v" + Version
|
||||
}
|
||||
return Version
|
||||
}
|
||||
if reg := regexp.MustCompile(`^releases/.*`); reg.MatchString(Version) {
|
||||
return strings.Replace(Version, "releases/", "v", 1)
|
||||
}
|
||||
|
||||
// OK... let's try to get the version from the build info
|
||||
// get the version from the build info (when installed with go install)
|
||||
|
@@ -6,29 +6,53 @@ import (
|
||||
)
|
||||
|
||||
func TestVersion(t *testing.T) {
|
||||
expected := "v1.0.0"
|
||||
|
||||
errorMessage := func(value, expected any) string {
|
||||
return "Expected version to be " + expected.(string) + ", got " + value.(string)
|
||||
}
|
||||
|
||||
// first, let's test the default behavior
|
||||
// when we compile from source, without setting the Version variable,
|
||||
|
||||
// by default, when we are developing, the Version variable is set to "master"
|
||||
// we build on "devel" branch
|
||||
v := GetVersion()
|
||||
// by default, the version comes from build info and it's a development version
|
||||
if !strings.Contains(v, "(devel)") {
|
||||
t.Errorf("Expected version to be set, got %s", v)
|
||||
errorMessage(v, "(devel)")
|
||||
}
|
||||
|
||||
// now, imagine we are on a release branch
|
||||
Version = "1.0.0"
|
||||
v = GetVersion()
|
||||
if !strings.Contains(v, "1.0.0") {
|
||||
t.Errorf("Expected version to be set, got %s", v)
|
||||
if !strings.Contains(v, expected) {
|
||||
errorMessage(v, expected)
|
||||
}
|
||||
// now, imagine we are on v1.0.0
|
||||
Version = "v1.0.0"
|
||||
v = GetVersion()
|
||||
if !strings.Contains(v, "v1.0.0") {
|
||||
t.Errorf("Expected version to be set, got %s", v)
|
||||
if !strings.Contains(v, expected) {
|
||||
errorMessage(v, expected)
|
||||
}
|
||||
// we can also compile a release branch
|
||||
Version = "release-1.0.0"
|
||||
v = GetVersion()
|
||||
if !strings.Contains(v, "release-1.0.0") {
|
||||
t.Errorf("Expected version to be set, got %s", v)
|
||||
if !strings.Contains(v, expected) {
|
||||
errorMessage(v, expected)
|
||||
}
|
||||
|
||||
// for releases-* tags
|
||||
Version = "release-1.0.0"
|
||||
v = GetVersion()
|
||||
if !strings.Contains(v, expected) {
|
||||
errorMessage(v, expected)
|
||||
}
|
||||
|
||||
// and for releases/* tags
|
||||
Version = "releases/1.0.0"
|
||||
v = GetVersion()
|
||||
if !strings.Contains(v, expected) {
|
||||
errorMessage(v, expected)
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,10 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"strings"
|
||||
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
|
@@ -5,13 +5,14 @@ import (
|
||||
"image"
|
||||
"image/color"
|
||||
"image/png"
|
||||
"github.com/katenary/katenary/internal/generator/labels"
|
||||
"github.com/katenary/katenary/internal/utils"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"katenary.io/internal/generator/labels"
|
||||
"katenary.io/internal/utils"
|
||||
|
||||
v1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
## BUILD
|
||||
GO_BUILD=go build -ldflags="-X 'github.com/katenary/katenary/internal/generator.Version=$(VERSION)'" -trimpath -o $(OUTPUT) ./cmd/katenary
|
||||
GO_BUILD=go build -ldflags="-X 'katenary.io/internal/generator.Version=$(VERSION)'" -trimpath -o $(OUTPUT) ./cmd/katenary
|
||||
|
||||
# Simply build the binary for the current OS and architecture
|
||||
build: pull katenary
|
||||
@@ -23,7 +23,7 @@ endif
|
||||
# Also generate the windows installer.
|
||||
binaries: prepare $(BINARIES)
|
||||
dist: binaries upx packages
|
||||
dist-full: clean-dist dist gpg-sign check-sign rpm-sign check-dist-all
|
||||
dist-full: clean-dist dist check-dist-all
|
||||
|
||||
prepare: pull packager-oci-image
|
||||
mkdir -p dist
|
||||
|
@@ -45,8 +45,10 @@ builder-oci-image:
|
||||
@$(CTN) build -t go-builder:$(GOVERSION) ./oci/builder \
|
||||
--build-arg GOVERSION=$(GOVERSION) 1>/dev/null
|
||||
katenary-oci:
|
||||
$(CTN) build -f oci/katenary/Containerfile -t katenary:$(VERSION) \
|
||||
VERSION=$(VERSION) \
|
||||
VERSION=$${VERSION#releases/}; \
|
||||
$(CTN) build -f oci/katenary/Containerfile -t katenary:$$VERSION \
|
||||
--build-arg GOVERSION=$(GOVERSION) \
|
||||
--build-arg VERSION=$(VERSION) \
|
||||
./
|
||||
$(CTN) tag katenary:$(VERSION) katenary:latest
|
||||
$(CTN) tag katenary:$$VERSION katenary:latest
|
||||
|
@@ -1,9 +1,10 @@
|
||||
## Linux / FreeBSD packages with fpm
|
||||
|
||||
PACKAGE_API=https://repo.katenary.io/api/packages/katenary
|
||||
DESCRIPTION := $(shell cat oci/description | sed ':a;N;$$!ba;s/\n/\\n/g')
|
||||
|
||||
FPM_OPTS=--name katenary \
|
||||
--url https://katenary.org \
|
||||
--url https://katenary.io \
|
||||
--vendor "Katenary Project" \
|
||||
--maintainer "Patrice Ferlet <metal3d@gmail.com>" \
|
||||
--license "MIT" \
|
||||
@@ -16,7 +17,7 @@ FPM_BASES=../LICENSE=/usr/local/share/doc/katenary/LICENSE \
|
||||
FPM_COMMON_FILES=$(FPM_BASES) ../doc/share/man/man1/katenary.1=/usr/local/share/man/man1/katenary.1
|
||||
|
||||
# ArchLinux has got inconsistent /usr/local/man directory
|
||||
FPM_COMMON_FILES_ARCHLINUX=$(FPM_BASES) ../doc/share/man/man1/katenary.1=/usr/local/man/man1/katenary.1 \
|
||||
FPM_COMMON_FILES_ARCHLINUX=$(FPM_BASES) ../doc/share/man/man1/katenary.1=/usr/local/man/man1/katenary.1
|
||||
|
||||
# Pacman refuses dashes in version, and should start with a number
|
||||
PACMAN_VERSION=$(shell echo $(VERSION) | sed 's/-/./g; s/^v//')
|
||||
@@ -35,6 +36,8 @@ rpm: dist/katenary-linux-$(GOARCH)
|
||||
fpm -s dir -t rpm -a $(GOARCH) -f $(FPM_OPTS) --version=$(VERSION) \
|
||||
$(FPM_COMMON_FILES) \
|
||||
./katenary-linux-$(GOARCH)=/usr/local/bin/katenary
|
||||
|
||||
# could be now removed, as gitea sign packages for us
|
||||
rpm-sign:
|
||||
[ -f .rpmmacros ] || echo "$(RPM_MACROS)" > .rpmmacros
|
||||
[ -f .secret.gpg ] || gpg --export-secret-keys -a $(SIGNER) > .secret.gpg
|
||||
@@ -136,3 +139,30 @@ check-dist-all:
|
||||
$(MAKE) check-dist-debian
|
||||
$(MAKE) check-dist-ubuntu
|
||||
$(MAKE) check-dist-archlinux
|
||||
|
||||
push-packages: rpm deb pacman
|
||||
source .gitea.env
|
||||
for file in $$(find dist -type f -name "*.rpm"); do \
|
||||
curl --user $$GITEA_USERNAME:$$GITEA_TOKEN \
|
||||
--upload-file $$file \
|
||||
$(PACKAGE_API)/rpm/upload
|
||||
done
|
||||
for file in $$(find dist -type f -name "*.deb"); do \
|
||||
curl --user $$GITEA_USERNAME:$$GITEA_TOKEN \
|
||||
--upload-file $$file \
|
||||
$(PACKAGE_API)/debian/pool/any/main/upload
|
||||
done
|
||||
for file in $$(find dist -type f -name "*.tar.zst"); do \
|
||||
curl --user $$GITEA_USERNAME:$$GITEA_TOKEN \
|
||||
--upload-file $$file \
|
||||
$(PACKAGE_API)/arch/core
|
||||
done
|
||||
|
||||
push-generic-packages: $(BINARIES)
|
||||
@source .gitea.env
|
||||
for bin in $^; do \
|
||||
echo "pushing $$bin to Gitea..."; \
|
||||
curl --user $$GITEA_USERNAME:$$GITEA_TOKEN \
|
||||
--upload-file $$bin \
|
||||
$(PACKAGE_API)/generic/katenary/$(VERSION)/$$(basename $$bin);
|
||||
done
|
||||
|
@@ -1,5 +1,5 @@
|
||||
|
||||
## TESTS, security analysis, and code quality
|
||||
## TESTS, security analysis, and code quality
|
||||
|
||||
# Scan the source code.
|
||||
# - we don't need detection of text/template as it's not a web application, and
|
||||
|
@@ -1,4 +1,4 @@
|
||||
ARG GOVERSION=1.24
|
||||
ARG GOVERSION=1.25
|
||||
|
||||
FROM docker.io/golang:${GOVERSION} AS builder
|
||||
ARG VERSION
|
||||
@@ -7,20 +7,21 @@ RUN \
|
||||
echo "You must set VERSION build argument"; \
|
||||
exit 1; \
|
||||
fi
|
||||
COPY go.mod go.sum /go/src/github.com/katenary/katenary/
|
||||
COPY cmd /go/src/github.com/katenary/katenary/cmd
|
||||
COPY internal /go/src/github.com/katenary/katenary/internal
|
||||
WORKDIR /go/src/github.com/katenary/katenary
|
||||
COPY go.mod go.sum /go/src/repo.katenary.io/katenary/katenary/
|
||||
COPY cmd /go/src/repo.katenary.io/katenary/katenary/cmd
|
||||
COPY internal /go/src/repo.katenary.io/katenary/katenary/internal
|
||||
WORKDIR /go/src/repo.katenary.io/katenary/katenary
|
||||
ENV CGO_ENABLED=0
|
||||
RUN set -xe; \
|
||||
go build -ldflags="-X 'github.com/katenary/katenary/internal/generator.Version=v${VERSION}'" -trimpath -o katenary ./cmd/katenary
|
||||
export VERSION=${VERSION#releases/}; \
|
||||
go build -ldflags="-X 'katenary.io/internal/generator.Version=v${VERSION}'" -trimpath -o katenary ./cmd/katenary
|
||||
|
||||
|
||||
FROM scratch
|
||||
LABEL org.opencontainers.image.source=https://github.com/katenary/katenary
|
||||
LABEL org.opencontainers.image.source=https://repo.katenary.io/katenary/katenary
|
||||
LABEL org.opencontainers.image.description="Katenary converts compose files to Helm Chart"
|
||||
LABEL org.opencontainers.image.licenses=MIT
|
||||
COPY --from=builder /go/src/github.com/katenary/katenary/katenary /katenary
|
||||
COPY --from=builder /go/src/repo.katenary.io/katenary/katenary/katenary /katenary
|
||||
VOLUME /project
|
||||
WORKDIR /project
|
||||
ENTRYPOINT ["/katenary"]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
sonar.projectKey=metal3d_katenary
|
||||
sonar.organization=metal3d
|
||||
sonar.projectKey=katenary_katenary
|
||||
sonar.organization=katenary
|
||||
|
||||
|
||||
sonar.go.tests.reportPaths=gotest.json
|
||||
|
Reference in New Issue
Block a user