Skip to content

Commit

Permalink
fix: support dynamic nodePort (#87)
Browse files Browse the repository at this point in the history
closes #30
  • Loading branch information
DrPsychick authored Sep 26, 2024
1 parent d66ea6f commit 4d788c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions charts/athens-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This will deploy a single Athens instance in the `athens` namespace with `disk`
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | see https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling |
| annotations | object | `{}` | Add extra annotations to be added to the athens pods |
| annotations | object | `{}` | Add extra annotations to the athens pods |
| autoscaling.apiVersionOverride | string | `""` | Overwrite the API version used for HPA, uses 'autoscaling/v2' by default. see https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/horizontal-pod-autoscaler-v2/ |
| autoscaling.behavior | object | `{}` | Define scaling behavior for HPA |
| autoscaling.enabled | bool | `false` | Enable Horizontal Pod Autoscaling |
Expand All @@ -53,7 +53,7 @@ This will deploy a single Athens instance in the `athens` namespace with `disk`
| basicAuth.secretName | string | `"athens-proxy-basic-auth"` | Secret name, containing the 'passwordSecretKey' and 'usernameSecretKey' |
| basicAuth.usernameSecretKey | string | `"username"` | |
| configEnvVars | list | `[]` | Set environment variables to be passed to athens pods |
| extraLabels | object | `{}` | Add extra labels to be added to all resources |
| extraLabels | object | `{}` | Add extra labels to all resources |
| gitconfig.enabled | bool | `false` | If enabled, it expects to find git configuration in the named secret provided below. By default, gitconfig is disabled |
| gitconfig.secretKey | string | `"gitconfig"` | Key in the kubernetes secret that contains git config data |
| gitconfig.secretName | string | `"athens-proxy-gitconfig"` | Name of the kubernetes secret (in the same namespace as athens-proxy) that contains git config |
Expand Down Expand Up @@ -90,7 +90,6 @@ This will deploy a single Athens instance in the `athens` namespace with `disk`
| resources | object | `{}` | Define resources for athens pods. see https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#resources |
| securityContext | object | `{}` | Container security context configuration. see API reference: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#securitycontext-v1-core. This will override the `image.runAsNonRoot` settings in the specified container if `runAsUser` or `runAsGroup` are set |
| service.annotations | object | `{}` | Add annotations to the service |
| service.nodePort.port | int | `30080` | Available port in allowable range (e.g. 30000 - 32767 on minikube) |
| service.servicePort | int | `80` | Port as exposed by the service |
| service.type | string | `"ClusterIP"` | 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 or use an "Ingress". |
| serviceAccount.annotations | object | `{}` | |
Expand Down
2 changes: 2 additions & 0 deletions charts/athens-proxy/ci/basic-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ jaeger:
enabled: true
annotations:
test.annotation: "jaeger"
service:
type: "NodePort"
2 changes: 1 addition & 1 deletion charts/athens-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
port: {{ .Values.service.servicePort }}
targetPort: 3000
protocol: TCP
{{- if eq .Values.service.type "NodePort" }}
{{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort .Values.service.nodePort.port }}
nodePort: {{ .Values.service.nodePort.port }}
{{- end }}
selector:
Expand Down
8 changes: 4 additions & 4 deletions charts/athens-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ service:
# "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 or use an "Ingress".
type: ClusterIP
# Further configuration if service is of type "NodePort"
nodePort:
# -- Available port in allowable range (e.g. 30000 - 32767 on minikube)
port: 30080
# Optional configuration if service is of type "NodePort"
# nodePort:
# -- Specify the nodePort in allowable range (e.g. 30000 - 32767 on minikube)
# port: 30080

ingress:
# -- Create an Ingress resource for athens
Expand Down

0 comments on commit 4d788c2

Please sign in to comment.