Skip to content

Commit 81997f2

Browse files
Create a basic container image and helm chart
1 parent 34c212f commit 81997f2

File tree

6 files changed

+101
-0
lines changed

6 files changed

+101
-0
lines changed

Diff for: Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM golang:1.23-alpine AS builder
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY go.mod go.sum ./
6+
RUN go mod download && go mod verify
7+
8+
COPY . .
9+
RUN go build -v -o /usr/local/bin/octo ./cmd/octo
10+
11+
FROM scratch
12+
13+
COPY --from=builder /usr/local/bin/octo /usr/local/bin/octo
14+
15+
CMD ["/usr/local/bin/octo"]

Diff for: charts/octo/Chart.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
name: octo
3+
description: octo-proxy is a simple TCP/TLS proxy with mTLS
4+
version: 1.0.0
5+
appVersion: 1.1.0

Diff for: charts/octo/templates/configmap.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ .Release.Name }}
5+
data:
6+
config.yaml: {{ toYaml .Values.config | indent 2 }}

Diff for: charts/octo/templates/deployment.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ .Release.Name }}
5+
labels:
6+
app: {{ .Release.Name }}
7+
spec:
8+
replicas: {{ .Values.replicas }}
9+
selector:
10+
matchLabels:
11+
app: {{ .Release.Name }}
12+
template:
13+
metadata:
14+
labels:
15+
app: {{ .Release.Name }}
16+
spec:
17+
containers:
18+
- name: octo
19+
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
20+
imagePullPolicy: {{ .Values.image.pullPolicy }}
21+
volumeMounts:
22+
- name: octo-config
23+
mountPath: /etc/octo
24+
readOnly: true
25+
command: ["/usr/local/bin/octo", "-config", "/etc/octo/config.yaml"]
26+
resources:
27+
{{ toYaml .Values.resources | nindent 10 }}
28+
volumes:
29+
- name: octo-config
30+
configMap:
31+
name: {{ .Release.Name }}

Diff for: charts/octo/templates/service.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Release.Name }}
5+
spec:
6+
type: ClusterIP
7+
selector:
8+
app: {{ .Release.Name }}
9+
ports:
10+
{{- range .Values.ports }}
11+
- port: {{ .port }}
12+
targetPort: {{ .targetPort }}
13+
protocol: {{ .protocol }}
14+
name: {{ .name }}
15+
{{- end }}

Diff for: charts/octo/values.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
image:
2+
repository: octo
3+
tag: 1.1.0
4+
pullPolicy: IfNotPresent
5+
6+
ports:
7+
- name: http
8+
port: 80
9+
targetPort: 8080
10+
11+
replicas: 1
12+
13+
resources:
14+
requests:
15+
memory: "64Mi"
16+
cpu: "250m"
17+
limits:
18+
memory: "128Mi"
19+
cpu: "500m"
20+
21+
config: |
22+
servers:
23+
- name: web-proxy
24+
listener:
25+
host: 127.0.0.1
26+
port: 8080
27+
targets:
28+
- host: 127.0.0.1
29+
port: 80

0 commit comments

Comments
 (0)