Skip to content

Commit

Permalink
namefix
Browse files Browse the repository at this point in the history
  • Loading branch information
archmagece committed Sep 5, 2024
1 parent 57f2608 commit 3e084b6
Show file tree
Hide file tree
Showing 33 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
# context: .
push: true
tags: scriptonbasestar/deproxy:latest
tags: scriptonbasestar/proxynd:latest
# secrets: |
# GIT_AUTH_TOKEN=${{ secrets.MYTOKEN }}
- name: Image digest
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ docker-build:
docker compose build --no-cache

docker-push:
docker tag 'local_dev/deproxy' ${DOCKER_REGISTRY}/deproxy:latest
docker push ${DOCKER_REGISTRY}/deproxy:latest
docker tag 'local_dev/proxynd' ${DOCKER_REGISTRY}/proxynd:latest
docker push ${DOCKER_REGISTRY}/proxynd:latest

docker-run:
@echo "Running..."
docker compose up -d
@echo "image name : deproxy"
@echo "image name : proxynd"

docker-enter:
@echo "Entering..."
docker exec -it deproxy bash
docker exec -it proxynd bash

.PHONY: build
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

```yaml
services:
deproxy:
proxynd:
build:
context: .
dockerfile: Dockerfile
image: local_dev/deproxy
container_name: deproxy
image: local_dev/proxynd
container_name: proxynd
ports:
- "8080:8080"
volumes:
Expand All @@ -56,7 +56,7 @@ volumes:
#### helm
helm repo install deproxy https://github.com/ScriptonBasestar-io/deproxy/releases/download
helm repo install proxynd https://github.com/ScriptonBasestar-io/proxynd/releases/download
## REF
Expand Down
2 changes: 1 addition & 1 deletion configs/apt_mirror_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package configs

import (
"deproxy/helpers"
"path"
"proxynd/helpers"
)

type AptMirror struct {
Expand Down
2 changes: 1 addition & 1 deletion configs/apt_mirror_config_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package configs

import (
"deproxy/helpers"
"fmt"
"github.com/go-playground/assert/v2"
"os"
"proxynd/helpers"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion configs/apt_proxy_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package configs

import (
"deproxy/helpers"
"path"
"proxynd/helpers"
)

type AptProxy struct {
Expand Down
2 changes: 1 addition & 1 deletion configs/apt_proxy_config_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package configs

import (
"deproxy/helpers"
"fmt"
"github.com/go-playground/assert/v2"
"os"
"proxynd/helpers"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion configs/global_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package configs

import (
"deproxy/helpers"
"path"
"proxynd/helpers"
)

type Cache struct {
Expand Down
2 changes: 1 addition & 1 deletion configs/global_config_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package configs

import (
"deproxy/helpers"
"fmt"
"github.com/go-playground/assert/v2"
"os"
"proxynd/helpers"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion configs/maven_mirror_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package configs

import (
"deproxy/helpers"
"path"
"proxynd/helpers"
)

type MavenMirrorServer struct {
Expand Down
2 changes: 1 addition & 1 deletion configs/maven_mirror_config_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package configs

import (
"deproxy/helpers"
"fmt"
"github.com/go-playground/assert/v2"
"os"
"proxynd/helpers"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion configs/maven_proxy_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package configs

import (
"deproxy/helpers"
"path"
"proxynd/helpers"
)

type MavenProxyServer struct {
Expand Down
2 changes: 1 addition & 1 deletion configs/maven_proxy_config_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package configs

import (
"deproxy/helpers"
"fmt"
"github.com/go-playground/assert/v2"
"gopkg.in/yaml.v3"
"log"
"os"
"proxynd/helpers"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion configs/vagrant_config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package configs

import (
"deproxy/helpers"
"proxynd/helpers"
)

type VagrantServer struct {
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
services:
deproxy:
proxynd:
build:
context: .
dockerfile: Dockerfile
image: local_dev/deproxy
container_name: deproxy
image: local_dev/proxynd
container_name: proxynd
ports:
- "8080:8080"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module deproxy
module proxynd

go 1.22

Expand Down
4 changes: 2 additions & 2 deletions handlers/proxy/apt_proxy_controller.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package proxy

import (
"deproxy/configs"
"deproxy/helpers"
"fmt"
"github.com/gin-gonic/gin"
"io"
Expand All @@ -11,6 +9,8 @@ import (
"os"
"path"
"path/filepath"
"proxynd/configs"
"proxynd/helpers"
)

func AptProxy(c *gin.Context) {
Expand Down
4 changes: 2 additions & 2 deletions handlers/proxy/maven_proxy_controller.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package proxy

import (
"deproxy/configs"
"deproxy/helpers"
"fmt"
"github.com/gin-gonic/gin"
"io"
Expand All @@ -11,6 +9,8 @@ import (
"os"
"path"
"path/filepath"
"proxynd/configs"
"proxynd/helpers"
"strings"
)

Expand Down
8 changes: 4 additions & 4 deletions helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "deproxy.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "proxynd.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "deproxy.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "deproxy.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "proxynd.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "proxynd.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "deproxy.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "proxynd.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
Expand Down
22 changes: 11 additions & 11 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "deproxy.name" -}}
{{- define "proxynd.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -11,7 +11,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name.
release-name이라고 나오는거 없애기
*/}}
{{- define "deproxy.fullname" -}}
{{- define "proxynd.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -31,16 +31,16 @@ release-name이라고 나오는거 없애기
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "deproxy.chart" -}}
{{- define "proxynd.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "deproxy.labels" -}}
helm.sh/chart: {{ include "deproxy.chart" . }}
{{ include "deproxy.selectorLabels" . }}
{{- define "proxynd.labels" -}}
helm.sh/chart: {{ include "proxynd.chart" . }}
{{ include "proxynd.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -50,17 +50,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "deproxy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "deproxy.name" . }}
app.kubernetes.io/instance: {{ include "deproxy.fullname" . }}
{{- define "proxynd.selectorLabels" -}}
app.kubernetes.io/name: {{ include "proxynd.name" . }}
app.kubernetes.io/instance: {{ include "proxynd.fullname" . }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "deproxy.serviceAccountName" -}}
{{- define "proxynd.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "deproxy.fullname" .) .Values.serviceAccount.name }}
{{- default (include "proxynd.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
10 changes: 5 additions & 5 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "deproxy.fullname" . }}
name: {{ include "proxynd.fullname" . }}
labels:
{{- include "deproxy.labels" . | nindent 4 }}
{{- include "proxynd.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "deproxy.selectorLabels" . | nindent 6 }}
{{- include "proxynd.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "deproxy.labels" . | nindent 8 }}
{{- include "proxynd.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -24,7 +24,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "deproxy.serviceAccountName" . }}
serviceAccountName: {{ include "proxynd.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand Down
4 changes: 2 additions & 2 deletions helm/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "deproxy.fullname" . -}}
{{- $fullName := include "proxynd.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
Expand All @@ -17,7 +17,7 @@ kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "deproxy.labels" . | nindent 4 }}
{{- include "proxynd.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
6 changes: 3 additions & 3 deletions helm/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "deproxy.fullname" . }}
name: {{ include "proxynd.fullname" . }}
labels:
{{- include "deproxy.labels" . | nindent 4 }}
{{- include "proxynd.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "deproxy.selectorLabels" . | nindent 4 }}
{{- include "proxynd.selectorLabels" . | nindent 4 }}
4 changes: 2 additions & 2 deletions helm/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "deproxy.serviceAccountName" . }}
name: {{ include "proxynd.serviceAccountName" . }}
labels:
{{- include "deproxy.labels" . | nindent 4 }}
{{- include "proxynd.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
Loading

0 comments on commit 3e084b6

Please sign in to comment.