generated from nginxinc/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into better-test-coverage
- Loading branch information
Showing
67 changed files
with
3,359 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text eol=lf | ||
|
||
*.png binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,6 @@ Thumbs.db | |
*.log | ||
/misc-dev/ | ||
|
||
cover.html | ||
cover.out | ||
tmp/ | ||
|
||
cover.out | ||
cover.html | ||
cover* | ||
tmp/ | ||
docs/tls/DESIGN.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
golang 1.19.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
data: | ||
tls.crt: LS0tLS1CRUd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WURXbFdrY3dmSmxEbW1WV0htbEtRTkRhcFphLzNUOTdRcEtCTTdYU2xob21sRmJ3CmY3Nk52SWx4RXQzTHhseGxadlkzdjhmdXpFRUdqd3l0Zkk2c2krVzd4eGNYVmRmY1pIWHp0RXR5TXo2WnoxMHgKcTZjaEQ2OWMwQXlPYzdOV1g2dDNnQk5vVkZFOTBiT1cyZWpDY1M0TFNYaEVwRTNITzdpKytOa1BBb0dBZW9CYgo1Sk9TbXVvOG9GZTNVMlNpaHArOUhVZy9iRE9IamZWSE1zSTUreUIwN3h5YUpCcHJNVzdTYXV6OUJ5OWxqSjhjCm05M3FWUy94OFZFNVUzNTNsV2hWeGovQ3NOQ1JTek9oaXZvNktvV0g2N3FSTjJKcVorNjE0MUtITkxpZGY0R0MKZXVONURiV1dqNzVjL2tIWUtyTW1xVVRvTGE3T3FFeHpiRmFCUnMwQ2dZQUN6UlBiQTBqK0JyOWpxenFKYU56VQpPZzJ4aUFhZlNuTzBxTkREZWZNdXhZSnFMZ0llMG9HRUExb1JlcDhvTDNDeWZYd2h3U2xqMlRjeGZZTFR5MENKCmZBejF4QjY3SUF3cGlvZnI0K1ZXekF4SC9BbnlhVGNZVGdtakdKdlhtZ3l1RGU3ZGJsa3lJU1M5ZTBLc1JzeTYKQ2hPdVZoQy96bjErbm9BMkNsdzFJdz09Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K | ||
kind: Secret | ||
metadata: | ||
creationTimestamp: null | ||
name: nlk-tls-ca-secret | ||
namespace: nlk | ||
type: kubernetes.io/tls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Patterns to ignore when building packages. | ||
.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
apiVersion: v2 | ||
appVersion: 0.1.0 | ||
description: NGINX LoadBalancer for Kubernetes | ||
name: nginx-loadbalancer-kubernetes | ||
home: https://github.com/nginxinc/nginx-loadbalancer-kubernetes | ||
icon: https://raw.githubusercontent.com/nginxinc/nginx-loadbalancer-kubernetes/main/nlk-logo.svg | ||
keywords: | ||
- nginx | ||
- loadbalancer | ||
- ingress | ||
kubeVersion: '>= 1.22.0-0' | ||
maintainers: | ||
- name: "@ciroque" | ||
- name: "@chrisakker" | ||
- name: "@abdennour" | ||
|
||
type: application | ||
version: 0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "nlk.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
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). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "nlk.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 }} | ||
|
||
{{/* | ||
Create a default fully qualified nlk name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "nlk.nlk.fullname" -}} | ||
{{- printf "%s-%s" (include "nlk.fullname" .) .Values.nlk.name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified nlk service name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "nlk.nlk.service.name" -}} | ||
{{- default (include "nlk.nlk.fullname" .) .Values.serviceNameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "nlk.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "nlk.labels" -}} | ||
helm.sh/chart: {{ include "nlk.chart" . }} | ||
{{ include "nlk.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "nlk.selectorLabels" -}} | ||
{{- if .Values.nlk.selectorLabels -}} | ||
{{ toYaml .Values.nlk.selectorLabels }} | ||
{{- else -}} | ||
app.kubernetes.io/name: {{ include "nlk.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Expand the name of the configmap. | ||
*/}} | ||
{{- define "nlk.configName" -}} | ||
{{- if .Values.nlk.customConfigMap -}} | ||
{{ .Values.nlk.customConfigMap }} | ||
{{- else -}} | ||
{{- default (include "nlk.fullname" .) .Values.nlk.config.name -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Expand service account name. | ||
*/}} | ||
{{- define "nlk.serviceAccountName" -}} | ||
{{- default (include "nlk.fullname" .) .Values.nlk.serviceAccount.name -}} | ||
{{- end -}} | ||
|
||
{{- define "nlk.tag" -}} | ||
{{- default .Chart.AppVersion .Values.nlk.image.tag -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Expand image name. | ||
*/}} | ||
{{- define "nlk.image" -}} | ||
{{- if .Values.nlk.image.digest -}} | ||
{{- printf "%s/%s@%s" .Values.nlk.image.registry .Values.nlk.image.repository .Values.nlk.image.digest -}} | ||
{{- else -}} | ||
{{- printf "%s/%s:%s" .Values.nlk.image.registry .Values.nlk.image.repository (include "nlk.tag" .) -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- define "nlk.prometheus.serviceName" -}} | ||
{{- printf "%s-%s" (include "nlk.fullname" .) "prometheus-service" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{- if .Values.rbac.create }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ .Release.Namespace }}-{{ include "nlk.fullname" . }} | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- nodes | ||
- secrets | ||
- services | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{- if .Values.rbac.create }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ .Release.Namespace }}-{{ include "nlk.fullname" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "nlk.fullname" . }} | ||
namespace: nlk | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ .Release.Namespace }}-{{ include "nlk.fullname" . }} | ||
apiGroup: rbac.authorization.k8s.io | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nlk-config | ||
namespace: nlk | ||
data: | ||
{{- if .Values.nlk.config.entries.hosts }} | ||
nginx-hosts: "{{ .Values.nlk.config.entries.hosts }}" | ||
{{- end }} | ||
tls-mode: "{{ index .Values.nlk.defaultTLS "tls-mode" }}" | ||
ca-certificate: "{{ index .Values.nlk.defaultTLS "ca-certificate" }}" | ||
client-certificate: "{{ index .Values.nlk.defaultTLS "client-certificate" }}" | ||
log-level: "{{ .Values.nlk.logLevel }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "nlk.fullname" . }} | ||
namespace: nlk | ||
labels: | ||
app: nlk | ||
spec: | ||
replicas: {{ .Values.nlk.replicaCount }} | ||
selector: | ||
matchLabels: | ||
app: nlk | ||
template: | ||
metadata: | ||
labels: | ||
app: nlk | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: {{ include "nlk.image" .}} | ||
imagePullPolicy: {{ .Values.nlk.image.pullPolicy }} | ||
ports: | ||
{{- range $key, $value := .Values.nlk.containerPort }} | ||
- name: {{ $key }} | ||
containerPort: {{ $value }} | ||
protocol: TCP | ||
{{- end }} | ||
{{- if .Values.nlk.liveStatus.enable }} | ||
livenessProbe: | ||
httpGet: | ||
path: /livez | ||
port: {{ .Values.nlk.liveStatus.port }} | ||
initialDelaySeconds: {{ .Values.nlk.liveStatus.initialDelaySeconds }} | ||
periodSeconds: {{ .Values.nlk.readyStatus.periodSeconds }} | ||
{{- end }} | ||
{{- if .Values.nlk.readyStatus.enable }} | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: {{ .Values.nlk.readyStatus.port }} | ||
initialDelaySeconds: {{ .Values.nlk.readyStatus.initialDelaySeconds }} | ||
periodSeconds: {{ .Values.nlk.readyStatus.periodSeconds }} | ||
{{- end }} | ||
serviceAccountName: {{ include "nlk.fullname" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "nlk.fullname" . }} | ||
namespace: nlk | ||
annotations: | ||
kubernetes.io/service-account.name: {{ include "nlk.fullname" . }} | ||
type: kubernetes.io/service-account-token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{- if .Values.rbac.create }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "nlk.fullname" . }} | ||
namespace: nlk | ||
{{- end }} |
Oops, something went wrong.