mirror of
https://github.com/gomods/athens
synced 2026-02-03 12:10:32 +00:00
[chart] add upstream proxy support, bump athens version (#1161)
* [chart] add upstream proxy support, bump athens version * update chart readme and kubernetes install docs
This commit is contained in:
committed by
Aaron Schlesinger
parent
4a4641b66b
commit
f14707e5e5
@@ -1,6 +1,6 @@
|
||||
name: athens-proxy
|
||||
version: 0.2.0
|
||||
appVersion: 0.2.0
|
||||
version: 0.2.1
|
||||
appVersion: 0.3.1
|
||||
description: The proxy server for Go modules
|
||||
icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png
|
||||
keywords:
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Athens Proxy Helm Chart
|
||||
|
||||
## What is Athens?
|
||||
|
||||
[Athens](https://docs.gomods.io) is a repository for packages used by your go packages.
|
||||
|
||||
Athens provides a repository for [Go Modules](https://github.com/golang/go/wiki/Modules) that you can run. It serves public code and your private code for you, so you don't have to pull directly from a version control system (VCS) like GitHub or GitLab.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* Kubernetes 1.10+
|
||||
|
||||
## Requirements
|
||||
|
||||
- A running Kubernetes cluster
|
||||
- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) installed and setup to use the cluster
|
||||
- [Helm](https://helm.sh/) [installed](https://github.com/helm/helm#install) and setup to use the cluster (helm init) or [Tillerless Helm](https://github.com/rimusz/helm-tiller)
|
||||
|
||||
## Deploy Athens
|
||||
|
||||
The fastest way to install Athens using Helm is to deploy it from our public Helm chart repository. First, add the repository with this command:
|
||||
|
||||
```console
|
||||
$ helm repo add gomods https://athens.blob.core.windows.net/charts
|
||||
$ helm repo update
|
||||
```
|
||||
|
||||
Next, install the chart with default values to `athens` namespace:
|
||||
|
||||
```
|
||||
$ helm install gomods/athens-proxy -n athens --namespace athens
|
||||
```
|
||||
|
||||
This will deploy a single Athens instance in the `athens` namespace with `disk` storage enabled. Additionally, a `ClusterIP` service will be created.
|
||||
|
||||
|
||||
## Advanced Configuration
|
||||
|
||||
For more advanced configuration options please check Athens [docs](https://docs.gomods.io/install/install-on-kubernetes/#advanced-configuration).
|
||||
|
||||
Available options:
|
||||
- [Replicas](https://docs.gomods.io/install/install-on-kubernetes/#replicas)
|
||||
- [Access to private repositories via Github](https://docs.gomods.io/install/install-on-kubernetes/#give-athens-access-to-private-repositories-via-github-token-optional)
|
||||
- [Storage Providers](https://docs.gomods.io/install/install-on-kubernetes/#storage-providers)
|
||||
- [Kubernetes Service](https://docs.gomods.io/install/install-on-kubernetes/#kubernetes-service)
|
||||
- [Ingress Resource](https://docs.gomods.io/install/install-on-kubernetes/#ingress-resource)
|
||||
- [Upstream module repository](https://docs.gomods.io/install/install-on-kubernetes/#upstream-module-repository)
|
||||
- [.netrc file support](https://docs.gomods.io/install/install-on-kubernetes/#netrc-file-support)
|
||||
@@ -2,9 +2,6 @@
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- define "livenessPath" -}}
|
||||
{{- if eq .Values.image.tag "v0.3.0" -}}/{{- else -}}/healthz{{- end -}}
|
||||
{{- end -}}
|
||||
{{- define "readinessPath" -}}
|
||||
{{- if eq .Values.image.tag "v0.3.0" -}}/{{- else -}}/readyz{{- end -}}
|
||||
{{- if contains "v0.2.0" .Values.image.tag -}}/{{- else -}}/readyz{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{{- if .Values.upstreamProxy.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "fullname" . }}-upstream
|
||||
labels:
|
||||
app: {{ template "fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
data:
|
||||
FilterForUpstreamProxy: |-
|
||||
# FilterFile for fetching modules directly from upstream proxy
|
||||
D
|
||||
{{- end -}}
|
||||
@@ -8,14 +8,20 @@ metadata:
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
spec:
|
||||
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/config-upstream.yaml") . | sha256sum }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ template "fullname" . }}
|
||||
@@ -23,7 +29,7 @@ spec:
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: "{{ template "livenessPath" . }}"
|
||||
path: "/healthz"
|
||||
port: 3000
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
@@ -43,6 +49,12 @@ spec:
|
||||
- name: ATHENS_NETRC_PATH
|
||||
value: "/etc/netrc/netrc"
|
||||
{{- end }}
|
||||
{{- if .Values.upstreamProxy.enabled }}
|
||||
- name: ATHENS_FILTER_FILE
|
||||
value: "/usr/local/lib/FilterForUpstreamProxy"
|
||||
- name: ATHENS_GLOBAL_ENDPOINT
|
||||
value: {{ .Values.upstreamProxy.url | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.jaeger.enabled }}
|
||||
- name: ATHENS_TRACE_EXPORTER_URL
|
||||
value: {{ .Values.jaeger.url | quote }}
|
||||
@@ -56,6 +68,11 @@ spec:
|
||||
- name: storage-volume
|
||||
mountPath: {{ .Values.storage.disk.storageRoot | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.upstreamProxy.enabled}}
|
||||
- name: upstream-config
|
||||
mountPath: "/usr/local/lib"
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.netrc.enabled}}
|
||||
- name: netrc
|
||||
mountPath: "/etc/netrc"
|
||||
@@ -69,8 +86,25 @@ spec:
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.upstreamProxy.enabled }}
|
||||
- name: upstream-config
|
||||
configMap:
|
||||
name: {{ template "fullname" . }}-upstream
|
||||
{{- end }}
|
||||
{{- if .Values.netrc.enabled }}
|
||||
- name: netrc
|
||||
secret:
|
||||
secretName: netrcsecret
|
||||
secretName: {{ .Values.netrc.existingSecret }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -10,6 +10,11 @@ metadata:
|
||||
heritage: "{{ .Release.Service }}"
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "fullname" . }}-jaeger
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
|
||||
@@ -10,8 +10,6 @@ metadata:
|
||||
heritage: "{{ .Release.Service }}"
|
||||
spec:
|
||||
type: {{ .Values.jaeger.type }}
|
||||
selector:
|
||||
app: {{ template "fullname" . }}-jaeger
|
||||
ports:
|
||||
- name: jaeger-collector-http
|
||||
port: 14268
|
||||
@@ -37,4 +35,8 @@ spec:
|
||||
port: 16686
|
||||
protocol: TCP
|
||||
targetPort: 16686
|
||||
selector:
|
||||
app: {{ template "fullname" . }}-jaeger
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
{{- end -}}
|
||||
|
||||
@@ -9,8 +9,6 @@ metadata:
|
||||
heritage: "{{ .Release.Service }}"
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
selector:
|
||||
app: {{ template "fullname" . }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.service.servicePort }}
|
||||
@@ -19,3 +17,7 @@ spec:
|
||||
{{- if eq .Values.service.type "NodePort" }}
|
||||
nodePort: {{ .Values.service.nodePort.port }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
|
||||
@@ -2,12 +2,13 @@ replicaCount: 1
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: gomods/athens
|
||||
tag: v0.3.0
|
||||
tag: v0.3.1
|
||||
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: Always
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
## Port as exposed by the service
|
||||
@@ -47,6 +48,14 @@ storage:
|
||||
netrc:
|
||||
# if enabled, it expects to find the content of a valid .netrc file imported as a secret named netrcsecret
|
||||
enabled: false
|
||||
existingSecret: netrcsecret
|
||||
|
||||
upstreamProxy:
|
||||
# This is where you can set the URL for the upstream module repository.
|
||||
# If 'enabled' is set to true, Athens will try to download modules from the upstream when it doesn't find them in its own storage.
|
||||
# You can use 'https://gocenter.io' to use JFrog's GoCenter as an upstream here, or you can also use another Athens server as well.
|
||||
enabled: false
|
||||
url: "https://upstreamproxy_url"
|
||||
|
||||
jaeger:
|
||||
## Type of service; valid values are "ClusterIP", "LoadBalancer", and "NodePort".
|
||||
@@ -58,3 +67,9 @@ jaeger:
|
||||
# you must set this on the command line when you run 'helm install'
|
||||
# for example, you need to run 'helm install --set jaeger.url=myurl ...'
|
||||
url: "SET THIS ON THE COMMAND LINE"
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
Reference in New Issue
Block a user