chore: rename prj

This commit is contained in:
2026-01-18 20:18:51 +08:00
parent 6843ce2f56
commit 4afe3b0100
5 changed files with 16 additions and 16 deletions

View File

@@ -49,14 +49,14 @@ jobs:
- name: Build Docker image
run: |
cd ${{ gitea.workspace }}
docker build -t localhost:8180/k8s-example/k8s-example:${{ gitea.sha }} .
docker build -t localhost:8180/go-example/go-example:${{ gitea.sha }} .
- name: Push Docker image to local registry
run: |
docker push localhost:8180/k8s-example/k8s-example:${{ gitea.sha }}
docker push localhost:8180/go-example/go-example:${{ gitea.sha }}
- name: Update manifest and Push to Git
run: |
# 使用 kustomize 或 sed 修改镜像版本
sed -i "s|image: .*:.*|image: localhost:8180/k8s-example/k8s-example:${{ gitea.sha }}|g" deployment.yaml
sed -i "s|image: .*:.*|image: localhost:8180/go-example/go-example:${{ gitea.sha }}|g" deployment.yaml
# 配置 Git 并提交回仓库
git config --global user.name "Gitea Action"

View File

@@ -1,11 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: k8s-example
name: go-example
namespace: helloapp
spec:
selector:
app: k8s-example
app: go-example
ports:
- port: 8800
targetPort: 8800
@@ -14,21 +14,21 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8s-example
name: go-example
namespace: helloapp
spec:
selector:
matchLabels:
app: k8s-example
app: go-example
replicas: 3
template:
metadata:
labels:
app: k8s-example
app: go-example
spec:
containers:
- name: k8s-example
image: localhost:8180/k8s-example/k8s-example:0b2c48ee261873d5a5b2146f424e2a68ce33d4da
- name: go-example
image: localhost:8180/go-example/go-example:0b2c48ee261873d5a5b2146f424e2a68ce33d4da
imagePullPolicy: IfNotPresent
resources:
requests:
@@ -49,7 +49,7 @@ spec:
volumes:
- name: config-volume
configMap:
name: k8s-example-config
name: go-example-config
- name: helloapp-test-key
secret:
secretName: helloapp-test-key
@@ -57,7 +57,7 @@ spec:
apiVersion: v1
kind: ConfigMap
metadata:
name: k8s-example-config
name: go-example-config
namespace: helloapp
data:
.linux-config.yaml: |

2
go.mod
View File

@@ -1,4 +1,4 @@
module k8s-example
module go-example
go 1.25.5

View File

@@ -3,7 +3,7 @@ package hello
import (
"encoding/base64"
"fmt"
"k8s-example/cmn/utils"
"go-example/cmn/utils"
"net/http"
"github.com/spf13/viper"

View File

@@ -3,8 +3,8 @@ package main
import (
"flag"
"fmt"
"k8s-example/cmn/conf"
"k8s-example/hello"
"go-example/cmn/conf"
"go-example/hello"
"net/http"
"github.com/spf13/viper"