From 5b47269278d34ead3070b10e16b900dc0c61a50a Mon Sep 17 00:00:00 2001 From: Nicholas Wilde Date: Thu, 26 Nov 2020 14:32:51 -0800 Subject: [PATCH] Updated ingress to released and updated values.yaml --- charts/installer/Chart.yaml | 2 +- charts/installer/README.md | 4 +- charts/installer/README.md.gotmpl | 8 ++- charts/installer/templates/NOTES.txt | 2 +- .../{ingress.yaml => ingress-beta.yaml} | 6 ++- .../installer/templates/ingress-released.yaml | 43 ++++++++++++++++ charts/installer/templates/secret.yaml | 4 +- charts/installer/values.yaml | 51 ++++++++++--------- 8 files changed, 87 insertions(+), 33 deletions(-) rename charts/installer/templates/{ingress.yaml => ingress-beta.yaml} (84%) create mode 100644 charts/installer/templates/ingress-released.yaml diff --git a/charts/installer/Chart.yaml b/charts/installer/Chart.yaml index 60cf35c6..b0550152 100644 --- a/charts/installer/Chart.yaml +++ b/charts/installer/Chart.yaml @@ -1,7 +1,7 @@ --- apiVersion: v2 appVersion: 0.2.9 -version: 0.1.7 +version: 0.1.8 name: installer description: Quickly install pre-compiled binaries from Github releases. home: "https://github.com/nicholaswilde/helm-charts/tree/main/charts/installer" diff --git a/charts/installer/README.md b/charts/installer/README.md index cf5ffccf..51d001ad 100644 --- a/charts/installer/README.md +++ b/charts/installer/README.md @@ -1,8 +1,8 @@ # installer -Quickly install pre-compiled binaries from Github releases. +![Version: 0.1.8](https://img.shields.io/badge/Version-0.1.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.9](https://img.shields.io/badge/AppVersion-0.2.9-informational?style=flat-square) -![Version: 0.1.6](https://img.shields.io/badge/Version-0.1.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.9](https://img.shields.io/badge/AppVersion-0.2.9-informational?style=flat-square) +Quickly install pre-compiled binaries from Github releases. ## TL;DR ```console diff --git a/charts/installer/README.md.gotmpl b/charts/installer/README.md.gotmpl index 92503e6a..cb75f5ae 100644 --- a/charts/installer/README.md.gotmpl +++ b/charts/installer/README.md.gotmpl @@ -66,16 +66,22 @@ helm install {{ template "chart.name" . }} {{ template "helm.path" . }} -f value ``` {{- end -}} +{{- define "todo" -}} +## Todo +- [ ] Incorporate Docker secret. +{{- end -}} + {{- define "author" -}} ## Author This project was started in 2020 by Nicholas Wilde. {{- end -}} {{ template "chart.header" . }} -{{ template "chart.description" . }} {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} +{{ template "chart.description" . }} + {{ template "chart.requirementsSection" . }} {{ template "chart.kubeVersionLine" . }} diff --git a/charts/installer/templates/NOTES.txt b/charts/installer/templates/NOTES.txt index fd6511f2..904ef205 100644 --- a/charts/installer/templates/NOTES.txt +++ b/charts/installer/templates/NOTES.txt @@ -2,7 +2,7 @@ {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} diff --git a/charts/installer/templates/ingress.yaml b/charts/installer/templates/ingress-beta.yaml similarity index 84% rename from charts/installer/templates/ingress.yaml rename to charts/installer/templates/ingress-beta.yaml index adea76e2..924a1c10 100644 --- a/charts/installer/templates/ingress.yaml +++ b/charts/installer/templates/ingress-beta.yaml @@ -1,7 +1,8 @@ {{- if .Values.ingress.enabled -}} +{{- if not (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} {{- $fullName := include "installer.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}} apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 @@ -32,10 +33,11 @@ spec: http: paths: {{- range .paths }} - - path: {{ . }} + - path: {{ .path }} backend: serviceName: {{ $fullName }} servicePort: {{ $svcPort }} {{- end }} {{- end }} {{- end }} +{{- end }} diff --git a/charts/installer/templates/ingress-released.yaml b/charts/installer/templates/ingress-released.yaml new file mode 100644 index 00000000..cb13c1f7 --- /dev/null +++ b/charts/installer/templates/ingress-released.yaml @@ -0,0 +1,43 @@ +{{- if .Values.ingress.enabled -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }} +{{- $fullName := include "installer.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "installer.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- 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 }} + pathType: {{ .pathType }} + backend: + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/installer/templates/secret.yaml b/charts/installer/templates/secret.yaml index 5d27c669..d34a5e06 100644 --- a/charts/installer/templates/secret.yaml +++ b/charts/installer/templates/secret.yaml @@ -1,4 +1,4 @@ -{{- if .Values.secret.enabled -}} +{{- if .Values.secret -}} --- apiVersion: v1 kind: Secret @@ -10,4 +10,4 @@ type: Opaque data: USER: {{ .Values.secret.user | b64enc | quote }} GH_TOKEN: {{ .Values.secret.gh_token | b64enc | quote }} - {{- end }} +{{- end }} diff --git a/charts/installer/values.yaml b/charts/installer/values.yaml index ee0aa810..b69e8565 100644 --- a/charts/installer/values.yaml +++ b/charts/installer/values.yaml @@ -1,3 +1,4 @@ +--- # Default values for installer. # This is a YAML-formatted file. # Declare variables to be passed into your templates. @@ -6,11 +7,8 @@ replicaCount: 1 image: repository: nicholaswilde/installer - pullPolicy: Always - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" + pullPolicy: IfNotPresent + tag: "0.2.9" serviceAccount: # Specifies whether a service account should be created @@ -21,17 +19,16 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "" -secret: - enabled: false - user: "" - gh_token: "" +secret: {} + # user: "" + # gh_token: "" podAnnotations: # https://crazymax.dev/diun/providers/kubernetes/#kubernetes-annotations # Set to true to enable image analysis of this pod - diun.enable: "true" + diun.enable: "false" # Watch all tags of this pod image - diun.watch_repo: "true" + diun.watch_repo: "false" ## Registry options name to use # regopt: "" ## Maximum number of tags to watch if diun.watch_repo enabled. 0 means all of them @@ -43,17 +40,6 @@ podAnnotations: ## useful if you enable diun.watch_repo # exclude_tags: "" -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - service: type: ClusterIP port: 3000 @@ -64,8 +50,10 @@ ingress: annotations: nginx.ingress.kubernetes.io/whitelist-source-range: 192.168.1.0/24 hosts: - - host: installer.192.168.1.193.nip.io - paths: [/] + - host: "installer.192.168.1.193.nip.io" + paths: + - path: "/" + pathType: Prefix # tls: [] # - secretName: chart-example-tls # hosts: @@ -90,6 +78,21 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + nodeSelector: {} tolerations: []