diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3c4a9e5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:1.23-alpine AS builder + +WORKDIR /usr/src/app + +COPY go.mod go.sum ./ +RUN go mod download && go mod verify + +COPY . . +RUN go build -v -o /usr/local/bin/octo ./cmd/octo + +FROM scratch + +COPY --from=builder /usr/local/bin/octo /usr/local/bin/octo + +CMD ["/usr/local/bin/octo"] \ No newline at end of file diff --git a/charts/octo/Chart.yaml b/charts/octo/Chart.yaml new file mode 100644 index 0000000..1eccbe5 --- /dev/null +++ b/charts/octo/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +name: octo +description: octo-proxy is a simple TCP/TLS proxy with mTLS +version: 1.0.0 +appVersion: 1.1.0 diff --git a/charts/octo/templates/configmap.yaml b/charts/octo/templates/configmap.yaml new file mode 100644 index 0000000..2588379 --- /dev/null +++ b/charts/octo/templates/configmap.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }} +data: + config.yaml: {{ toYaml .Values.config | indent 2 }} \ No newline at end of file diff --git a/charts/octo/templates/deployment.yaml b/charts/octo/templates/deployment.yaml new file mode 100644 index 0000000..a9de50b --- /dev/null +++ b/charts/octo/templates/deployment.yaml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app: {{ .Release.Name }} +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: octo + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + volumeMounts: + - name: octo-config + mountPath: /etc/octo + readOnly: true + command: ["/usr/local/bin/octo", "-config", "/etc/octo/config.yaml"] + resources: + {{ toYaml .Values.resources | nindent 10 }} + volumes: + - name: octo-config + configMap: + name: {{ .Release.Name }} \ No newline at end of file diff --git a/charts/octo/templates/service.yaml b/charts/octo/templates/service.yaml new file mode 100644 index 0000000..6ec82ab --- /dev/null +++ b/charts/octo/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }} + ports: + {{- range .Values.ports }} + - port: {{ .port }} + targetPort: {{ .targetPort }} + protocol: {{ .protocol }} + name: {{ .name }} + {{- end }} \ No newline at end of file diff --git a/charts/octo/values.yaml b/charts/octo/values.yaml new file mode 100644 index 0000000..f29ca14 --- /dev/null +++ b/charts/octo/values.yaml @@ -0,0 +1,29 @@ +image: + repository: octo + tag: 1.1.0 + pullPolicy: IfNotPresent + +ports: + - name: http + port: 80 + targetPort: 8080 + +replicas: 1 + +resources: + requests: + memory: "64Mi" + cpu: "250m" + limits: + memory: "128Mi" + cpu: "500m" + +config: | + servers: + - name: web-proxy + listener: + host: 127.0.0.1 + port: 8080 + targets: + - host: 127.0.0.1 + port: 80 \ No newline at end of file