No description
  • Go 95.6%
  • Makefile 2.6%
  • Shell 1.4%
  • Go Template 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Roger Westerbø 31ac63d994
Some checks failed
Build and Test / Build (push) Successful in 1m21s
Build and Test / Lint (push) Successful in 4m25s
Build and Test / Test (push) Failing after 7m10s
Build and Test / Security Scan (push) Successful in 8m23s
Merge pull request #34 from vitistack/dependabot/github_actions/actions/checkout-7
chore(deps): bump actions/checkout from 6 to 7
2026-06-22 11:01:55 +02:00
.github chore(deps): bump actions/checkout from 6 to 7 2026-06-18 23:22:43 +00:00
.vscode refactor(logging): implement new logging interface and migrate to Go's slog package 2025-09-25 11:29:32 +02:00
charts/vitistack-crds feat(crd): add VLANID column to NetworkNamespace status 2026-06-04 14:40:44 +02:00
cmd refactor: remove commented-out S3 delete logic from s3ListBucketFilesExample 2026-04-04 16:44:26 +02:00
crds feat(crd): add VLANID column to NetworkNamespace status 2026-06-04 14:40:44 +02:00
docs docs: update CRD definitions for NetworkConfiguration and NetworkNamespace with new fields and examples 2026-04-23 08:06:56 +02:00
examples/machineclasses feat: Add govulncheck and gosec security scans to workflows; update MachineClass CRD with enabled field 2025-12-04 14:49:25 +01:00
hack feat: Add script to clear GitHub Actions caches for vitistack repositories 2026-02-11 10:04:21 +01:00
pkg feat(crd): add VLANID column to NetworkNamespace status 2026-06-04 14:40:44 +02:00
.env.example some more comments changed 2026-02-11 09:05:56 +01:00
.env.production Add initial documentation for Vitistack including README, CRD reference, Go libraries, and quick start guide 2025-11-12 14:01:59 +01:00
.gitignore feat: Add govulncheck and gosec security scans to workflows; update MachineClass CRD with enabled field 2025-12-04 14:49:25 +01:00
.golangci.yml feat(k8sclient): add Kubernetes client initialization 2025-09-04 14:00:17 +02:00
crds.yaml feat(crd): add VLANID column to NetworkNamespace status 2026-06-04 14:40:44 +02:00
go.mod chore(deps): update k8s and golang.org/x dependencies to latest versions 2026-06-15 14:25:35 +02:00
go.sum chore(deps): update k8s and golang.org/x dependencies to latest versions 2026-06-15 14:25:35 +02:00
LICENSE Initial commit 2025-09-04 12:21:13 +02:00
Makefile feat: Add fix target to run go fix against code 2026-02-24 07:43:38 +01:00
README.md readme example added, divided s3client into seperate packages: s3interface, s3minioclient, s3mock 2026-02-11 13:51:28 +01:00

Vitistack Common

Build and Test Security Scan Go Report Card Go Reference

Shared infrastructure management components for Kubernetes-native platforms.

What's Included

🎯 Custom Resource Definitions (CRDs)

Kubernetes-native APIs for declarative infrastructure management:

  • Machine - Virtual machine provisioning and lifecycle
  • MachineProvider - Multi-cloud provider configuration (Proxmox, KubeVirt)
  • MachineClass - Machine size and resource presets
  • NetworkConfiguration - Network topology and VLANs
  • NetworkNamespace - Network isolation and segmentation
  • KubernetesCluster - Kubernetes cluster management
  • KubernetesProvider - Kubernetes cluster provider configuration
  • ControlPlaneVirtualSharedIP - Shared IP management for control planes
  • EtcdBackup - Etcd backup configuration and scheduling
  • VitiStack - Infrastructure stack definition with auto-discovery of providers and clusters
  • ProxmoxConfig - Proxmox-specific configuration
  • KubevirtConfig - KubeVirt-specific configuration

📖 View full CRD documentation →

📦 Go Libraries

Small, focused libraries for cloud-native applications:

  • vlog - Structured logging with Zap and logr adapter
  • serialize - JSON helpers for quick serialization
  • k8sclient - Kubernetes client initialization
  • S3client - General s3 client
  • crdcheck - CRD prerequisite validation
  • dotenv - Smart environment configuration

📖 View Go library documentation →

Quick Start

Install CRDs

# Using Helm (recommended)
# First, login to GitHub Container Registry
# Username: your GitHub username
# Password: a Personal Access Token (PAT) with `read:packages` scope
# Create a PAT at: https://github.com/settings/tokens/new?scopes=read:packages
helm registry login ghcr.io

helm install vitistack-crds oci://ghcr.io/vitistack/helm/crds

# Or using kubectl (no authentication required)
kubectl apply -f https://github.com/vitistack/common/releases/latest/download/crds.yaml

Use Go Libraries

go get github.com/vitistack/common@latest

k8sclient

import (
    "github.com/vitistack/common/pkg/loggers/vlog"
    "github.com/vitistack/common/pkg/clients/k8sclient"
)

func main() {
    vlog.Setup(vlog.Options{Level: "info", JSON: true})
    defer vlog.Sync()

    k8sclient.Init()
    vlog.Info("connected to kubernetes")
}

s3Client

package main

import (
    "github.com/vitistack/common/pkg/loggers/vlog"
    "github.com/vitistack/common/pkg/clients/s3client/s3interface"
    "github.com/vitistack/common/pkg/clients/s3client/s3minioclient"
)

func main() {
  vlog.Setup(vlog.Options{Level: "info", JSON: true})
  defer vlog.Sync()

  s3, err := s3minioclient.NewS3Client(
	  s3interface.WithAccessKey("accesskey"),
	  s3interface.WithSecretKey("secretkey"),
	  s3interface.WithEndpoint("your-endpoint"),
	  s3interface.WithRegion("your region"),
	  s3interface.WithSecure(false),
  )
  vlog.Info("s3 client created")
}

Documentation

Resource Link
🚀 Quick Start Guide docs/quick-start.md
📚 CRD Reference docs/crds.md
💻 Go Libraries docs/go-libraries.md
📖 Full Documentation docs/
🔍 API Reference pkg.go.dev
💡 Examples examples/

Examples

Provision a Virtual Machine

apiVersion: vitistack.io/v1alpha1
kind: Machine
metadata:
  name: web-server
spec:
  providerRef:
    name: my-proxmox
  instanceType: medium
  cpu:
    cores: 4
  memory: 8192
  os:
    distribution: ubuntu
    version: "22.04"

Create a Kubernetes Cluster

apiVersion: vitistack.io/v1alpha1
kind: KubernetesCluster
metadata:
  name: production
spec:
  topology:
    controlPlane:
      replicas: 3
      machineClass: medium
    workers:
      nodePools:
        - name: general
          replicas: 5
          autoscaling:
            enabled: true
            minReplicas: 3
            maxReplicas: 10

Use Go Libraries

package main

import (
    "github.com/vitistack/common/pkg/loggers/vlog"
    "github.com/vitistack/common/pkg/settings/dotenv"
)

func main() {
    dotenv.LoadDotEnv()
    vlog.Setup(vlog.Options{Level: "info"})
    defer vlog.Sync()

    vlog.With("app", "myapp").Info("starting application")
}

Development

# Clone repository
git clone https://github.com/vitistack/common
cd common

# Install dependencies
make deps

# Run tests
make test

# Generate CRDs
make generate

# Build
make build

# Lint code
make lint

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Adding New Features

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Support

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


Built with ❤️ by the Vitistack Team