Skip to content
Merged
Show file tree
Hide file tree
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: 11 additions & 4 deletions nginx/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
apiVersion: v2
name: nginx
version: 0.1.3
description: Nginx reverse proxy
type: application
version: 1.0.0
dependencies:
- name: cos-common
version: 1.0.0
repository: https://centerforopenscience.github.io/helm-charts/
# - name: cos-common
# version: 1.0.0
# repository: file://../cos-common
41 changes: 41 additions & 0 deletions nginx/files/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
user nginx;
worker_processes 1;

pid /var/run/nginx.pid;

error_log /var/log/nginx/error.log warn;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $upstream_cache_status $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for" '
'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
access_log /var/log/nginx/access.log main;

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 620s;
keepalive_requests 10000;
types_hash_max_size 2048;
server_tokens off;

include /etc/nginx/conf.d/*.conf;

server {
listen 80;
server_name _;

location = /healthz {
access_log off;
return 200;
}
}
}
39 changes: 21 additions & 18 deletions nginx/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range $.Values.ingress.paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }}
Component fullname: {{ include "cos-common.fullname" (dict "root" . "name" "" "values" .Values.main) }}

{{- if and .Values.main.ingress.enabled (.Values.main.ingress.hosts) }}
Ingress hosts:
{{- $hosts := list }}
{{- if and (kindIs "map" .Values.main.ingress.hosts) (or (hasKey .Values.main.ingress.hosts "primary") (hasKey .Values.main.ingress.hosts "additional")) }}
{{- range $h := (default (list) .Values.main.ingress.hosts.primary) }}
{{- $hosts = append $hosts $h }}
{{- end }}
{{- range $h := (default (list) .Values.main.ingress.hosts.additional) }}
{{- $hosts = append $hosts $h }}
{{- end }}
{{- else }}
{{- range $h := .Values.main.ingress.hosts }}
{{- $hosts = append $hosts $h.host }}
{{- end }}
{{- end }}
{{- range $hosts }}
- {{ . }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "nginx.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 {{ include "nginx.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "nginx.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "nginx.name" . }},app.kubernetes.io/instance={{ .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:80
{{- else }}
Port-forward example:
kubectl -n {{ .Release.Namespace }} port-forward svc/{{ include "cos-common.fullname" (dict "root" . "name" "" "values" .Values.main) }} 8080:{{ ( .Values.main.http.containers.nginx.internalPort ) }}
{{- end }}
41 changes: 0 additions & 41 deletions nginx/templates/_helpers.tpl

This file was deleted.

69 changes: 0 additions & 69 deletions nginx/templates/certificate.yaml

This file was deleted.

58 changes: 0 additions & 58 deletions nginx/templates/configmap.yaml

This file was deleted.

69 changes: 0 additions & 69 deletions nginx/templates/deployment.yaml

This file was deleted.

55 changes: 0 additions & 55 deletions nginx/templates/ingress.yaml

This file was deleted.

Loading