Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a docker image and a helm chart #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
5 changes: 5 additions & 0 deletions charts/octo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions charts/octo/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}
data:
config.yaml: {{ toYaml .Values.config | indent 2 }}
31 changes: 31 additions & 0 deletions charts/octo/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
15 changes: 15 additions & 0 deletions charts/octo/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
29 changes: 29 additions & 0 deletions charts/octo/values.yaml
Original file line number Diff line number Diff line change
@@ -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