Skip to content

Commit

Permalink
chart docs -> kubefirst-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
johndietz committed Aug 26, 2024
1 parent eea3275 commit 9283855
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 47 deletions.
15 changes: 0 additions & 15 deletions charts/docs/templates/tests/test-connection.yaml

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: 31a0cb9
description: Kubefirst documentation Helm chart
name: docs
name: kubefirst-docs
type: application
version: 1.142.0
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "docs.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "kubefirst-docs.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 --namespace {{ .Release.Namespace }} svc -w {{ include "docs.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "docs.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "kubefirst-docs.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "kubefirst-docs.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
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 "docs.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "kubefirst-docs.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 --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "docs.name" -}}
{{- define "kubefirst-docs.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

Expand All @@ -11,7 +11,7 @@ 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 "docs.fullname" -}}
{{- define "kubefirst-docs.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
Expand All @@ -27,16 +27,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "docs.chart" -}}
{{- define "kubefirst-docs.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "docs.labels" -}}
helm.sh/chart: {{ include "docs.chart" . }}
{{ include "docs.selectorLabels" . }}
{{- define "kubefirst-docs.labels" -}}
helm.sh/chart: {{ include "kubefirst-docs.chart" . }}
{{ include "kubefirst-docs.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -46,17 +46,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "docs.selectorLabels" -}}
app.kubernetes.io/name: {{ include "docs.name" . }}
{{- define "kubefirst-docs.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubefirst-docs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "docs.serviceAccountName" -}}
{{- define "kubefirst-docs.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "docs.fullname" .) .Values.serviceAccount.name }}
{{ default (include "kubefirst-docs.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "docs.fullname" . }}
name: {{ template "kubefirst-docs.fullname" . }}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
data:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "docs.fullname" . }}
name: {{ include "kubefirst-docs.fullname" . }}
labels:
{{- include "docs.labels" . | nindent 4 }}
{{- include "kubefirst-docs.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "docs.selectorLabels" . | nindent 6 }}
{{- include "kubefirst-docs.selectorLabels" . | nindent 6 }}
revisionHistoryLimit: 1
template:
metadata:
labels:
{{- include "docs.selectorLabels" . | nindent 8 }}
{{- include "kubefirst-docs.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "docs.serviceAccountName" . }}
serviceAccountName: {{ include "kubefirst-docs.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "docs.fullname" . -}}
{{- $fullName := include "kubefirst-docs.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
Expand All @@ -17,7 +17,7 @@ kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "docs.labels" . | nindent 4 }}
{{- include "kubefirst-docs.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "docs.fullname" . }}
name: {{ include "kubefirst-docs.fullname" . }}
labels:
{{- include "docs.labels" . | nindent 4 }}
{{- include "kubefirst-docs.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "docs.selectorLabels" . | nindent 4 }}
{{- include "kubefirst-docs.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "docs.serviceAccountName" . }}
name: {{ include "kubefirst-docs.serviceAccountName" . }}
labels:
{{ include "docs.labels" . | nindent 4 }}
{{ include "kubefirst-docs.labels" . | nindent 4 }}
automountServiceAccountToken: true
{{- end -}}
15 changes: 15 additions & 0 deletions charts/kubefirst-docs/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "kubefirst-docs.fullname" . }}-test-connection"
labels:
{{ include "kubefirst-docs.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "kubefirst-docs.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
8 changes: 4 additions & 4 deletions charts/docs/values.yaml → charts/kubefirst-docs/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Default values for docs.
# Default values for kubefirst-docs.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

Expand All @@ -17,7 +17,7 @@ serviceAccount:
create: true
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: docs-sa
name: kubefirst-docs-sa

podSecurityContext: {}
# fsGroup: 2000
Expand Down Expand Up @@ -45,9 +45,9 @@ ingress:
paths:
- /
tls:
- secretName: docs-tls
- secretName: kubefirst-docs-tls
hosts:
- docs.example.com
- kubefirst-docs.example.com

# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down

0 comments on commit 9283855

Please sign in to comment.