From ac35a44e5a9419069ae09a7b32cca0eb17f032f2 Mon Sep 17 00:00:00 2001 From: DrPsychick Date: Tue, 14 Mar 2023 06:08:18 +0100 Subject: [PATCH] feat: new home for athens chart (#1845) --- .circleci/config.yml | 33 --- DEVELOPMENT.md | 18 +- Makefile | 8 - charts/athens-proxy/Chart.yaml | 18 -- charts/athens-proxy/OWNERS | 7 - charts/athens-proxy/README.md | 85 +----- charts/athens-proxy/templates/NOTES.txt | 27 -- charts/athens-proxy/templates/_helpers.tpl | 19 -- .../templates/config-ssh-git-servers.yaml | 26 -- .../templates/config-upstream.yaml | 15 -- charts/athens-proxy/templates/deployment.yaml | 250 ------------------ charts/athens-proxy/templates/ingress.yaml | 64 ----- .../athens-proxy/templates/jaeger-deploy.yaml | 45 ---- charts/athens-proxy/templates/jaeger-svc.yaml | 41 --- .../templates/secret-ssh-git-servers.yaml | 11 - .../templates/service-account.yaml | 15 -- charts/athens-proxy/templates/service.yaml | 26 -- .../athens-proxy/templates/storage-pvc.yaml | 24 -- charts/athens-proxy/values.yaml | 170 ------------ docs/content/install/install-on-kubernetes.md | 2 +- .../install/install-on-kubernetes.zh.md | 2 +- scripts/push-helm-charts.sh | 50 ---- 22 files changed, 5 insertions(+), 951 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 charts/athens-proxy/Chart.yaml delete mode 100644 charts/athens-proxy/OWNERS delete mode 100644 charts/athens-proxy/templates/NOTES.txt delete mode 100644 charts/athens-proxy/templates/_helpers.tpl delete mode 100644 charts/athens-proxy/templates/config-ssh-git-servers.yaml delete mode 100644 charts/athens-proxy/templates/config-upstream.yaml delete mode 100644 charts/athens-proxy/templates/deployment.yaml delete mode 100644 charts/athens-proxy/templates/ingress.yaml delete mode 100644 charts/athens-proxy/templates/jaeger-deploy.yaml delete mode 100644 charts/athens-proxy/templates/jaeger-svc.yaml delete mode 100644 charts/athens-proxy/templates/secret-ssh-git-servers.yaml delete mode 100644 charts/athens-proxy/templates/service-account.yaml delete mode 100644 charts/athens-proxy/templates/service.yaml delete mode 100644 charts/athens-proxy/templates/storage-pvc.yaml delete mode 100644 charts/athens-proxy/values.yaml delete mode 100755 scripts/push-helm-charts.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index e4e15076..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: 2.1 -jobs: - lint-scripts: - docker: - - image: koalaman/shellcheck-alpine - steps: - - checkout - - run: - command: | - shellcheck -x test/e2e-kind.sh - - lint-install-charts: - machine: - image: ubuntu-2004:202201-02 - environment: - CHART_TESTING_IMAGE: quay.io/helmpack/chart-testing - CHART_TESTING_TAG: v2.3.3 - K8S_VERSION: v1.14.2 - KIND_VERSION: v0.3.0 - steps: - - checkout - - run: - command: test/e2e-kind.sh - no_output_timeout: 3600 - -workflows: - version: 2 - lint_and_install: - jobs: - - lint-scripts - - lint-install-charts: - requires: - - lint-scripts diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index b8f4b1a1..d6430905 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -287,12 +287,7 @@ $ git cherry-pick ``` ### Updating the helm chart - -Regardless of which branch you created, you'll need to update the helm chart number. After you've cut the branch, make sure to change the versions in the [`Chart.yaml`](./charts/athens-proxy/Chart.yaml) file: - -- If this is a new release of Athens, make sure to update the Docker image version [value](./charts/athens-proxy/values.yaml#L5) -- Increment the patch number in the [`version` field](./charts/athens-proxy/Chart.yaml#L2) -- Set the [`appVersion` field](./charts/athens-proxy/Chart.yaml#L2) to the semver of the new branch. Do not include the `v` prefix +see https://github.com/gomods/athens-charts ## Creating the new release in GitHub @@ -311,17 +306,8 @@ Make sure the Github Actions CI/CD job finished, and check in Docker Hub to make The Github Actions job will do everything except: - Tweet out about the new release -- Update the helm chart in the `main` branch +- Update the helm chart If you are a core maintainer and don't have access to the `@gomods` account, ask one of the maintainers to give you access. [Here](https://twitter.com/gomodsio/status/1240016379962691585) is an example showing the general format of these tweets. Obviously you should use your creativity here though! -Finally, you'll need to update the helm version number in the `main` branch. Create a new branch called `update-helm-$CURRENT_TAG` and update the following files: - -- [charts/athens-proxy/values.yaml](./charts/athens-proxy/values.yaml) - update the `image.tag` field to the latest version number you created, including the `v`. This field should be near the top of the file -- [charts/athens-proxy/Chart.yaml](./charts/athens-proxy/Chart.yaml) - update the `version` field and the `appVersion` field - - Increment the patch number in the `version` field - - Change the `appVersion` field to the tag name of the GitHub version you created, including the `v` - -[Here](https://github.com/gomods/athens/pull/1574) is an example of how to do this. - Finally, create a pull request from your new branch into the `main` branch. It will be reviewed and merged as soon as possible. diff --git a/Makefile b/Makefile index 72948e9e..44626633 100644 --- a/Makefile +++ b/Makefile @@ -89,14 +89,6 @@ proxy-docker: docker-push: ./scripts/push-docker-images.sh -.PHONY: charts-push -charts-push: build-image - docker run --rm -it \ - -v `pwd`:/go/src/github.com/gomods/athens \ - -e AZURE_STORAGE_CONNECTION_STRING \ - -e CHARTS_REPO \ - athens-build ./scripts/push-helm-charts.sh - bench: ./scripts/benchmark.sh diff --git a/charts/athens-proxy/Chart.yaml b/charts/athens-proxy/Chart.yaml deleted file mode 100644 index c2b54b67..00000000 --- a/charts/athens-proxy/Chart.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -name: athens-proxy -version: 0.5.2 -appVersion: 0.11.1 -description: The proxy server for Go modules -icon: https://raw.githubusercontent.com/gomods/athens/main/docs/static/banner.png -keywords: -- Golang -- Package Management -- Goproxy -home: https://github.com/gomods/athens -sources: -maintainers: -- name: rimusz - email: rmocius@gmail.com -- name: arschles - email: aaron@ecomaz.net -engine: gotpl diff --git a/charts/athens-proxy/OWNERS b/charts/athens-proxy/OWNERS deleted file mode 100644 index a7fa6387..00000000 --- a/charts/athens-proxy/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -approvers: -- rimusz -- arschles -reviewers: -- rimusz -- arschles - diff --git a/charts/athens-proxy/README.md b/charts/athens-proxy/README.md index 4063b34a..97fbf0a7 100644 --- a/charts/athens-proxy/README.md +++ b/charts/athens-proxy/README.md @@ -1,85 +1,2 @@ # 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: - -Hint: To make the chart available again, the chart is temporarily hosted at sickhub.github.io until we've found a new solution. - -```console -$ helm repo add athens https://sickhub.github.io/athens-proxy -$ helm repo update -``` - -Next, install the chart with default values to `athens` namespace: - -``` -$ helm install athens/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) -- [gitconfig support](https://docs.gomods.io/install/install-on-kubernetes/#gitconfig-support) - -### Pass extra configuration environment variables - -You can pass any extra environment variables supported in [config.dev.toml](../../../config.dev.toml). -The example below shows how to set username/password for basic auth: - -```yaml -configEnvVars: - - name: BASIC_AUTH_USER - value: "some_user" - - name: BASIC_AUTH_PASS - value: "some_password" -``` - -### Private git servers over ssh support - -One or more of git servers can added to `sshGitServers`, and the corresponding config files (git config and ssh config) and ssh keys will be created. Athens then will use these configs and keys to download the source from the git servers. - -```yaml -sshGitServers: - ## Private git servers over ssh - ## to enable uncomment lines with single hash below - ## hostname of the git server - - host: git.example.com - ## ssh username - user: git - ## ssh private key for the user - privateKey: | - -----BEGIN RSA PRIVATE KEY----- - ... - -----END RSA PRIVATE KEY----- - ## ssh port - port: 22 -``` +The chart has a new home at https://github.com/gomods/athens-charts \ No newline at end of file diff --git a/charts/athens-proxy/templates/NOTES.txt b/charts/athens-proxy/templates/NOTES.txt deleted file mode 100644 index 9f7c0d84..00000000 --- a/charts/athens-proxy/templates/NOTES.txt +++ /dev/null @@ -1,27 +0,0 @@ -{{- if .Values.ingress.enabled }} -The Athens can be accessed via URL: -{{- else }} -Get the Athens URL by running these commands: -{{- end }} -{{- if (and .Values.ingress.enabled .Values.ingress.tls) }} -{{- range .Values.ingress.hosts }} - https://{{ . }} -{{- end }} -{{- else if .Values.ingress.enabled }} -{{- range .Values.ingress.hosts }} - http://{{ . }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "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 the status of by running 'kubectl get svc -w {{ template "fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.externalPort }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:3000 -{{- end }} diff --git a/charts/athens-proxy/templates/_helpers.tpl b/charts/athens-proxy/templates/_helpers.tpl deleted file mode 100644 index dd892ad8..00000000 --- a/charts/athens-proxy/templates/_helpers.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} -{{- define "readinessPath" -}} -{{- if contains "v0.2.0" .Values.image.tag -}}/{{- else -}}/readyz{{- end -}} -{{- end -}} diff --git a/charts/athens-proxy/templates/config-ssh-git-servers.yaml b/charts/athens-proxy/templates/config-ssh-git-servers.yaml deleted file mode 100644 index e5cceba3..00000000 --- a/charts/athens-proxy/templates/config-ssh-git-servers.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{{- if .Values.sshGitServers -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "fullname" . }}-ssh-git-servers - labels: - app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -data: - ssh_config: | - {{- range $server := .Values.sshGitServers }} - Host {{ $server.host }} - Hostname {{ $server.host }} - User {{ $server.user }} - Port {{ $server.port }} - StrictHostKeyChecking no - IdentityFile /ssh-keys/id_rsa-{{ $server.host }} - {{- end }} - git_config: | - {{- range $server := .Values.sshGitServers }} - [url "ssh://{{ $server.user }}@{{ $server.host }}:{{ $server.port}}"] - insteadOf = https://{{ $server.host }} - {{- end }} -{{- end -}} diff --git a/charts/athens-proxy/templates/config-upstream.yaml b/charts/athens-proxy/templates/config-upstream.yaml deleted file mode 100644 index ccce0684..00000000 --- a/charts/athens-proxy/templates/config-upstream.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- 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 -}} diff --git a/charts/athens-proxy/templates/deployment.yaml b/charts/athens-proxy/templates/deployment.yaml deleted file mode 100644 index 48516fab..00000000 --- a/charts/athens-proxy/templates/deployment.yaml +++ /dev/null @@ -1,250 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "fullname" . }} - labels: - app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - replicas: {{ .Values.replicaCount }} -{{- if .Values.strategy }} - strategy: -{{ toYaml .Values.strategy | indent 4 }} - {{- if eq .Values.strategy.type "Recreate" }} - rollingUpdate: null - {{- end }} -{{- end }} - selector: - matchLabels: - app: {{ template "fullname" . }} - release: "{{ .Release.Name }}" - template: - metadata: - labels: - app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - annotations: - checksum/upstream: {{ include (print $.Template.BasePath "/config-upstream.yaml") . | sha256sum }} - checksum/ssh-config: {{ include (print $.Template.BasePath "/config-ssh-git-servers.yaml") . | sha256sum }} - checksum/ssh-secret: {{ include (print $.Template.BasePath "/secret-ssh-git-servers.yaml") . | sha256sum }} - {{- if .Values.annotations }} -{{ toYaml .Values.annotations | indent 8 }} - {{- end }} - spec: - serviceAccount: {{ template "fullname" . }} - {{- if .Values.sshGitServers }} - initContainers: - - name: copy-key-files - image: alpine:3.9 - command: - - sh - - -c - args: ["cp /root/.ssh/id_rsa* /ssh-keys && chmod 400 /ssh-keys/*"] - volumeMounts: - - name: ssh-keys - mountPath: /ssh-keys - {{- range $server := .Values.sshGitServers }} - - name: ssh-git-servers-secret - mountPath: /root/.ssh/id_rsa-{{ $server.host }} - subPath: id_rsa-{{ $server.host }} - {{- end }} - {{- end }} - containers: - - name: {{ template "fullname" . }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy | quote }} - livenessProbe: - failureThreshold: {{ .Values.livenessProbe.failureThreshold }} - httpGet: - path: "/healthz" - port: 3000 - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - readinessProbe: - httpGet: - path: "{{ template "readinessPath" . }}" - port: 3000 - env: - - name: ATHENS_GOGET_WORKERS - {{- if .Values.goGetWorkers }} - value: {{ .Values.goGetWorkers | quote }} - {{- else }} - value: "3" - {{- end }} - {{- if .Values.configEnvVars }} -{{ toYaml .Values.configEnvVars | indent 8 }} - {{- end }} - - name: ATHENS_STORAGE_TYPE - value: {{ .Values.storage.type | quote }} - {{- if eq .Values.storage.type "disk"}} - - name: ATHENS_DISK_STORAGE_ROOT - value: {{ .Values.storage.disk.storageRoot | quote }} - {{- else if eq .Values.storage.type "mongo"}} - - name: ATHENS_MONGO_STORAGE_URL - value: {{ .Values.storage.mongo.url | quote }} - {{- else if eq .Values.storage.type "s3" }} - - name: AWS_REGION - value: {{ .Values.storage.s3.region | quote }} - - name: ATHENS_S3_BUCKET_NAME - value: {{ .Values.storage.s3.bucket | quote }} - - name: AWS_USE_DEFAULT_CONFIGURATION - value: {{ .Values.storage.s3.useDefaultConfiguration | quote }} - - name: AWS_FORCE_PATH_STYLE - value: {{ .Values.storage.s3.ForcePathStyle | quote }} - {{- if .Values.storage.s3.access_key_id }} - - name: AWS_ACCESS_KEY_ID - value: {{ .Values.storage.s3.access_key_id | quote }} - {{- end }} - {{- if .Values.storage.s3.secret_access_key }} - - name: AWS_SECRET_ACCESS_KEY - value: {{ .Values.storage.s3.secret_access_key | quote }} - {{- end }} - {{- if .Values.storage.s3.session_token }} - - name: AWS_SESSION_TOKEN - value: {{ .Values.storage.s3.session_token | quote }} - {{- end }} - {{- else if eq .Values.storage.type "gcp"}} - - name: GOOGLE_CLOUD_PROJECT - value: {{ .Values.storage.gcp.projectID | quote }} - - name: ATHENS_STORAGE_GCP_BUCKET - value: {{ .Values.storage.gcp.bucket | quote }} - {{- if .Values.storage.gcp.serviceAccount }} - - name: ATHENS_STORAGE_GCP_JSON_KEY - value: {{ .Values.storage.gcp.serviceAccount | b64enc | quote }} - {{- end }} - {{- else if eq .Values.storage.type "minio" }} - {{- if .Values.storage.minio.endpoint }} - - name: ATHENS_MINIO_ENDPOINT - value: {{ .Values.storage.minio.endpoint | quote }} - {{- end }} - {{- if .Values.storage.minio.accessKey }} - - name: ATHENS_MINIO_ACCESS_KEY_ID - value: {{ .Values.storage.minio.accessKey | quote }} - {{- end }} - {{- if .Values.storage.minio.secretKey }} - - name: ATHENS_MINIO_SECRET_ACCESS_KEY - value: {{ .Values.storage.minio.secretKey | quote }} - {{- end }} - {{- if .Values.storage.minio.bucket }} - - name: ATHENS_MINIO_BUCKET_NAME - value: {{ .Values.storage.minio.bucket | quote }} - {{- end }} - {{- end }} - {{- if .Values.netrc.enabled }} - - 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 }} - - name: ATHENS_TRACE_EXPORTER - value: "jaeger" - {{- end }} - {{- if .Values.basicAuth.enabled }} - - name: BASIC_AUTH_USER - valueFrom: - secretKeyRef: - name: {{ default "athens-proxy-basic-auth" .Values.basicAuth.secretName | quote }} - key: {{ default "username" .Values.basicAuth.usernameSecretKey | quote }} - - name: BASIC_AUTH_PASS - valueFrom: - secretKeyRef: - name: {{ default "athens-proxy-basic-auth" .Values.basicAuth.secretName | quote }} - key: {{ default "password" .Values.basicAuth.passwordSecretKey | quote }} - {{- end }} - ports: - - containerPort: 3000 - {{- if or (eq .Values.storage.type "disk") .Values.upstreamProxy.enabled .Values.netrc.enabled .Values.sshGitServers .Values.gitconfig.enabled}} - volumeMounts: - {{- end }} - {{- if eq .Values.storage.type "disk" }} - - 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" - readOnly: true - {{- end }} - {{- if .Values.sshGitServers }} - - name: ssh-git-servers-config - mountPath: /root/.ssh/config - subPath: ssh_config - - name: ssh-git-servers-config - mountPath: /root/.gitconfig - subPath: git_config - - name: ssh-keys - mountPath: /ssh-keys - {{- end }} - {{- if .Values.gitconfig.enabled }} - - name: gitconfig - mountPath: "/etc/gitconfig" - subPath: "gitconfig" - {{- end }} - {{- with .Values.resources }} - resources: -{{ toYaml . | indent 10 }} - {{- end }} - volumes: - - name: storage-volume - {{- if .Values.storage.disk.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ template "fullname" . }}-storage - {{- else }} - emptyDir: {} - {{- end }} - {{- if .Values.upstreamProxy.enabled }} - - name: upstream-config - configMap: - name: {{ template "fullname" . }}-upstream - {{- end }} - {{- if .Values.netrc.enabled }} - - name: netrc - secret: - secretName: {{ .Values.netrc.existingSecret }} - {{- end }} - {{- if .Values.sshGitServers }} - - name: ssh-keys - emptyDir: {} - - name: ssh-git-servers-config - configMap: - name: {{ template "fullname" . }}-ssh-git-servers - - name: ssh-git-servers-secret - secret: - secretName: {{ template "fullname" . }}-ssh-git-servers - {{- end }} - {{- if .Values.gitconfig.enabled }} - - name: gitconfig - secret: - secretName: {{ .Values.gitconfig.secretName }} - items: - - key: {{ .Values.gitconfig.secretKey }} - path: "gitconfig" - {{- 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 }} diff --git a/charts/athens-proxy/templates/ingress.yaml b/charts/athens-proxy/templates/ingress.yaml deleted file mode 100644 index eda575a8..00000000 --- a/charts/athens-proxy/templates/ingress.yaml +++ /dev/null @@ -1,64 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "fullname" . -}} -{{- $svcPort := .Values.service.servicePort -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}} -apiVersion: networking.k8s.io/v1 -{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - app: {{ template "fullname" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/charts/athens-proxy/templates/jaeger-deploy.yaml b/charts/athens-proxy/templates/jaeger-deploy.yaml deleted file mode 100644 index 75083cc3..00000000 --- a/charts/athens-proxy/templates/jaeger-deploy.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- if .Values.jaeger.enabled -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "fullname" . }}-jaeger - labels: - app: {{ template "fullname" . }}-jaeger - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - replicas: 1 - selector: - matchLabels: - app: {{ template "fullname" . }}-jaeger - release: "{{ .Release.Name }}" - template: - metadata: - labels: - app: {{ template "fullname" . }}-jaeger - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - spec: - containers: - - env: - - name: COLLECTOR_ZIPKIN_HTTP_PORT - value: "9441" - image: "{{ .Values.jaeger.image.repository }}:{{ .Values.jaeger.image.tag }}" - name: {{ template "fullname" . }}-jaeger - ports: - - containerPort: 14268 - protocol: TCP - - containerPort: 5775 - protocol: UDP - - containerPort: 6831 - protocol: UDP - - containerPort: 6832 - protocol: UDP - - containerPort: 5778 - protocol: TCP - - containerPort: 16686 - protocol: TCP - - containerPort: 9411 - protocol: TCP -{{- end -}} diff --git a/charts/athens-proxy/templates/jaeger-svc.yaml b/charts/athens-proxy/templates/jaeger-svc.yaml deleted file mode 100644 index 7c5a9d02..00000000 --- a/charts/athens-proxy/templates/jaeger-svc.yaml +++ /dev/null @@ -1,41 +0,0 @@ -{{- if .Values.jaeger.enabled -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "fullname" . }}-jaeger - labels: - app: {{ template "fullname" . }}-jaeger - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - type: {{ .Values.jaeger.type }} - ports: - - name: jaeger-collector-http - port: 14268 - protocol: TCP - targetPort: 14268 - - name: jaeger-zipkin-thrift - port: 5775 - protocol: UDP - targetPort: 5775 - - name: jaeger-compact - port: 6831 - protocol: UDP - targetPort: 6831 - - name: jaeger-binary - port: 6832 - protocol: UDP - targetPort: 6832 - - name: jaeger-configs - port: 5778 - protocol: TCP - targetPort: 5778 - - name: jaeger-query-http - port: 16686 - protocol: TCP - targetPort: 16686 - selector: - app: {{ template "fullname" . }}-jaeger - release: "{{ .Release.Name }}" -{{- end -}} diff --git a/charts/athens-proxy/templates/secret-ssh-git-servers.yaml b/charts/athens-proxy/templates/secret-ssh-git-servers.yaml deleted file mode 100644 index 228a590d..00000000 --- a/charts/athens-proxy/templates/secret-ssh-git-servers.yaml +++ /dev/null @@ -1,11 +0,0 @@ -{{- if .Values.sshGitServers -}} -kind: Secret -apiVersion: v1 -metadata: - name: {{ template "fullname" . }}-ssh-git-servers -type: Opaque -data: -{{- range $server := .Values.sshGitServers }} - id_rsa-{{ $server.host }}: {{ $server.privateKey | b64enc | quote }} -{{- end }} -{{- end -}} diff --git a/charts/athens-proxy/templates/service-account.yaml b/charts/athens-proxy/templates/service-account.yaml deleted file mode 100644 index f616d7c6..00000000 --- a/charts/athens-proxy/templates/service-account.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if .Values.serviceAccount.create }} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "fullname" . }} - labels: - app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" - {{- with .Values.serviceAccount.annotations }} - annotations: -{{ toYaml . | indent 4 }} - {{- end }} -{{- end }} diff --git a/charts/athens-proxy/templates/service.yaml b/charts/athens-proxy/templates/service.yaml deleted file mode 100644 index 9f650df0..00000000 --- a/charts/athens-proxy/templates/service.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "fullname" . }} -{{- if .Values.service.annotations }} - annotations: -{{ toYaml .Values.service.annotations | indent 4 }} -{{- end }} - labels: - app: {{ template "fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - type: {{ .Values.service.type }} - ports: - - name: http - port: {{ .Values.service.servicePort }} - targetPort: 3000 - protocol: TCP - {{- if eq .Values.service.type "NodePort" }} - nodePort: {{ .Values.service.nodePort.port }} - {{- end }} - selector: - app: {{ template "fullname" . }} - release: "{{ .Release.Name }}" diff --git a/charts/athens-proxy/templates/storage-pvc.yaml b/charts/athens-proxy/templates/storage-pvc.yaml deleted file mode 100644 index 03cc8e07..00000000 --- a/charts/athens-proxy/templates/storage-pvc.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{- if and (eq .Values.storage.type "disk") .Values.storage.disk.persistence.enabled }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "fullname" . }}-storage - labels: - app: {{ template "fullname" . }}-storage - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - accessModes: - - {{ .Values.storage.disk.persistence.accessMode | quote }} - resources: - requests: - storage: {{ .Values.storage.disk.persistence.size | quote }} -{{- if .Values.storage.disk.persistence.storageClass }} -{{- if (eq "-" .Values.storage.disk.persistence.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.storage.disk.persistence.storageClass }}" -{{- end }} -{{- end }} -{{- end }} diff --git a/charts/athens-proxy/values.yaml b/charts/athens-proxy/values.yaml deleted file mode 100644 index b60f213d..00000000 --- a/charts/athens-proxy/values.yaml +++ /dev/null @@ -1,170 +0,0 @@ -replicaCount: 1 -image: - registry: docker.io - repository: gomods/athens - tag: v0.11.0 - - ## 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: IfNotPresent - - -livenessProbe: - failureThreshold: 3 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 - -## Server Deployment Strategy type -# strategy: -# type: Recreate - -service: - ## Additional annotations to apply to the service - annotations: {} - ## Port as exposed by the service - servicePort: 80 - ## Type of service; valid values are "ClusterIP", "LoadBalancer", and - ## "NodePort". "ClusterIP" is sufficient in the case when the Proxy will be used - ## from within the cluster. To expose externally, consider a "NodePort" or "LoadBalancer" service. - type: ClusterIP - ## Further configuration if service is of type "NodePort" - nodePort: - ## Available port in allowable range (e.g. 30000 - 32767 on minikube) - port: 30080 - -ingress: - enabled: false - # Provide key/value annotations - annotations: - className: "" - # Provide an array of values for the ingress host mapping - hosts: - # - host: athens-proxy.local - # paths: - # - path: / - # pathType: ImplementationSpecific - # Provide a base64 encoded cert for TLS use - tls: - -storage: - type: disk - disk: - storageRoot: "/var/lib/athens" - persistence: - ## Note if you use disk.persistence.enabled, replicaCount should be set to 1 unless your access mode is ReadWriteMany - ## and strategy type must be Recreate - enabled: false - accessMode: ReadWriteOnce - size: 4Gi - mongo: - # you must set this on the command line when you run 'helm install' - # for example, you need to run 'helm install --set storage.mongo.url=myurl ...' - url: "SET THIS ON THE COMMAND LINE" - s3: - # you must set s3 bucket and region when running 'helm install' - region: "" - bucket: "" - useDefaultConfiguration: true - minio: - # All these variables needs to be set when configuring athens to run with minio backend - endpoint: "" - accessKey: "" - secretKey: "" - bucket: "" - gcp: - # For more information, see: - # https://docs.gomods.io/install/install-on-kubernetes/#google-cloud-storage - # you must set gcp projectID and bucket when running 'helm install' - projectID: "" - bucket: "" - # set serviceAccount to a key which has read/write access to the GCS bucket. - # If you are running Athens inside GCP, you will most likely not need this - # as GCP figures out internal authentication between products for you. - serviceAccount: "" - -# Extra environment variables to be passed -# You can add any new ones at the bottom -configEnvVars: {} - -# Extra annotations to be added to the athens pods -annotations: {} - -# HTTP basic auth -basicAuth: - enabled: false - secretName: athens-proxy-basic-auth - passwordSecretKey: password - usernameSecretKey: username - -netrc: - # if enabled, it expects to find the content of a valid .netrc file imported as a secret named netrcsecret - enabled: false - existingSecret: netrcsecret - -# gitconfig section provides a way to inject git config file to make athens able to fetch modules from private git repos. -gitconfig: - # By default, gitconfig is disabled. - enabled: false - # Name of the kubernetes secret (in the same namespace as athens-proxy) that contains git config. - secretName: athens-proxy-gitconfig - # Key in the kubernetes secret that contains git config data. - secretKey: gitconfig - -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. - # Here's a non-exhaustive list of options you can set here: - # - # - https://gocenter.io - # - https://proxy.golang.org - # - another Athens server - enabled: false - url: "https://gocenter.io" - -jaeger: - ## Type of service; valid values are "ClusterIP", "LoadBalancer", and "NodePort". - type: ClusterIP - image: - repository: jaegertracing/all-in-one - tag: latest - enabled: true - # 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" - -sshGitServers: {} - ## Private git servers over ssh - ## to enable uncomment lines with single hash below - ## hostname of the git server - # - host: git.example.com - ## ssh username - # user: git - ## ssh private key for the user - # privateKey: | - # -----BEGIN RSA PRIVATE KEY----- - # -----END RSA PRIVATE KEY----- - ## ssh port - # port: 22 - -goGetWorkers: 3 - -serviceAccount: - create: true - annotations: {} - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -resources: {} -# limits: -# cpu: 100m -# memory: 64Mi -# requests: -# cpu: 100m -# memory: 64Mi diff --git a/docs/content/install/install-on-kubernetes.md b/docs/content/install/install-on-kubernetes.md index 5f22e83c..992265af 100644 --- a/docs/content/install/install-on-kubernetes.md +++ b/docs/content/install/install-on-kubernetes.md @@ -82,7 +82,7 @@ tiller-deploy-5456568744-76c6s 1/1 Running 0 5s 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 add gomods https://gomods.github.io/athens-charts $ helm repo update ``` diff --git a/docs/content/install/install-on-kubernetes.zh.md b/docs/content/install/install-on-kubernetes.zh.md index 58a4d32d..c552f08b 100755 --- a/docs/content/install/install-on-kubernetes.zh.md +++ b/docs/content/install/install-on-kubernetes.zh.md @@ -82,7 +82,7 @@ tiller-deploy-5456568744-76c6s 1/1 Running 0 5s 使用Helm安装Athens的最快方法是从我们的公共Helm Chart库中进行部署。 首先,使用以下命令添加库 ```console -$ helm repo add gomods https://athens.blob.core.windows.net/charts +$ helm repo add gomods https://gomods.github.io/athens-charts $ helm repo update ``` 接下来,将含有默认值的chart安装到`athens`命名空间: diff --git a/scripts/push-helm-charts.sh b/scripts/push-helm-charts.sh deleted file mode 100755 index 66856875..00000000 --- a/scripts/push-helm-charts.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -set -xeuo pipefail - -helm init --client-only - -##### -# set up the repo dir, and package up all charts -##### -CHARTS_REPO=${CHARTS_REPO:-"https://athens.blob.core.windows.net"} -CHARTS_BUCKET=charts -REPO_DIR=bin/charts # This is where we do the charge merge and dirty things up, not the source chart directory -mkdir -p $REPO_DIR -echo "entering $REPO_DIR" -cd $REPO_DIR -if curl --output /dev/null --silent --head --fail ${CHARTS_REPO}/${CHARTS_BUCKET}/index.yaml; then - echo "downloading existing index.yaml" - curl -sLO ${CHARTS_REPO}/${CHARTS_BUCKET}/index.yaml -fi - -##### -# package the charts -##### -for dir in `ls ../../charts`;do - if [ ! -f ../../charts/$dir/Chart.yaml ];then - echo "skipping $dir because it lacks a Chart.yaml file" - else - echo "packaging $dir" - helm dep build ../../charts/$dir - helm package ../../charts/$dir - fi -done - -if [ -f $REPO_DIR/index.yaml ]; then - echo "merging with existing index.yaml" - helm repo index --url "$CHARTS_REPO/$CHARTS_BUCKET" --merge index.yaml . -else - echo "generating new index.yaml" - helm repo index . -fi - -##### -# upload to Azure blob storage -##### -if [ ! -v AZURE_STORAGE_CONNECTION_STRING ]; then - echo "AZURE_STORAGE_CONNECTION_STRING env var required to publish" - exit 1 -fi -echo "uploading from $PWD" -az storage blob upload-batch --destination $CHARTS_BUCKET --source .