Skip to content

Commit

Permalink
1. k8s initial structure (broken for sure)
Browse files Browse the repository at this point in the history
2. gha: meta secret server, docker push action
  • Loading branch information
cypherkitty committed Dec 23, 2024
1 parent b9cb413 commit 1d7cfe2
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 24 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/actions/project-cache/action.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Docker Automation"

on:
workflow_dispatch:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docker_push:
runs-on: ubuntu-latest

env:
FORCE_COLOR: 1

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.0

- uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: cypherkitty
password: ${{ secrets.META_SECRET_GH_PAT }}

- name: run tests
run: |
earthly \
--allow-privileged \
--ci \
--remote-cache=ghcr.io/meta-secret/core:cache \
--push \
./meta-secret+build-meta-server-image
7 changes: 5 additions & 2 deletions infra/Earthfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
VERSION 0.8
FROM scratch

sub-sub:
FROM ubuntu:latest
kcl-config-gen:
FROM --platform=linux/amd64 kcllang/kcl:v0.11.0
RUN --no-cache kcl


12 changes: 12 additions & 0 deletions infra/k8s/meta-secret-server/common.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
schema Metadata:
name: str
labels: Labels

schema Labels:
type: str
location: str


projectName = "meta-secret-server"
volumeName = "${projectName}-vol"
appPath = "/meta-secret/app/meta-server"
5 changes: 5 additions & 0 deletions infra/k8s/meta-secret-server/kcl.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[package]
name = "meta-secret-server"
edition = "v0.8.0"
version = "0.0.1"

50 changes: 50 additions & 0 deletions infra/k8s/meta-secret-server/statefulset.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import .common

apiVersion = "apps/v1"
kind = "StatefulSet"

metadata = {
name = common.projectName
}

spec = {
replicas = 1
serviceName = common.projectName
selector = {
matchLabels = {
app = common.projectName
}
}
template = {
metadata = {
labels = {
app = common.projectName
}
}
spec = {
containers = [
{
name = common.projectName
imagePullPolicy = "Always"
image = option("imageName")
command = ["/bin/sh", "-c", "./meta-server"]
volumeMounts = [
{
name = "config"
mountPath = "${common.appPath}/config.yaml"
subPath = "config.yaml"
}
]
}
]
volumes = [
{
name = "config"
configMap = {
name = "${common.projectName}-config"
}
}
]
}
}
}
2 changes: 1 addition & 1 deletion meta-secret/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ build-meta-server-image:
WORKDIR /app
COPY +meta-server-builder/target/release/meta-server .
CMD ./meta-server
SAVE IMAGE meta-secret-server:latest
SAVE IMAGE --push meta-secret-server:latest

wasm-build:
FROM +builder
Expand Down

0 comments on commit 1d7cfe2

Please sign in to comment.