diff options
Diffstat (limited to 'grumpy/cgit')
| -rw-r--r-- | grumpy/cgit/.helmignore | 22 | ||||
| -rw-r--r-- | grumpy/cgit/Kube-descriptor.yaml (renamed from grumpy/cgit/Chart.yaml) | 0 | ||||
| -rw-r--r-- | grumpy/cgit/cgit-deploy.yaml | 40 | ||||
| -rw-r--r-- | grumpy/cgit/cgit-ing.yaml | 24 | ||||
| -rw-r--r-- | grumpy/cgit/cgit-sa.yaml | 4 | ||||
| -rw-r--r-- | grumpy/cgit/cgit-svc.yaml | 14 | ||||
| -rw-r--r-- | grumpy/cgit/cgit-test-connection-pod.yaml | 13 | ||||
| -rw-r--r-- | grumpy/cgit/kustomization.yaml | 27 | ||||
| -rw-r--r-- | grumpy/cgit/templates/NOTES.txt | 21 | ||||
| -rw-r--r-- | grumpy/cgit/templates/_helpers.tpl | 56 | ||||
| -rw-r--r-- | grumpy/cgit/templates/deployment.yaml | 66 | ||||
| -rw-r--r-- | grumpy/cgit/templates/ingress.yaml | 37 | ||||
| -rw-r--r-- | grumpy/cgit/templates/service.yaml | 16 | ||||
| -rw-r--r-- | grumpy/cgit/templates/serviceaccount.yaml | 8 | ||||
| -rw-r--r-- | grumpy/cgit/templates/tests/test-connection.yaml | 15 | ||||
| -rw-r--r-- | grumpy/cgit/values.yaml | 51 |
16 files changed, 122 insertions, 292 deletions
diff --git a/grumpy/cgit/.helmignore b/grumpy/cgit/.helmignore deleted file mode 100644 index 50af031..0000000 --- a/grumpy/cgit/.helmignore +++ /dev/null @@ -1,22 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/grumpy/cgit/Chart.yaml b/grumpy/cgit/Kube-descriptor.yaml index b3b91d6..b3b91d6 100644 --- a/grumpy/cgit/Chart.yaml +++ b/grumpy/cgit/Kube-descriptor.yaml diff --git a/grumpy/cgit/cgit-deploy.yaml b/grumpy/cgit/cgit-deploy.yaml new file mode 100644 index 0000000..3b12394 --- /dev/null +++ b/grumpy/cgit/cgit-deploy.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cgit +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/instance: cgit + app.kubernetes.io/name: cgit + template: + metadata: + labels: + app.kubernetes.io/instance: cgit + app.kubernetes.io/name: cgit + spec: + containers: + - env: + - name: CGIT_HOSTNAME + value: git.ofmax.li + - name: CGIT_PORT + value: "8080" + image: registry.gitlab.com/grumps/grumpy-containers/cgit:v0.0.5 + imagePullPolicy: Always + name: cgit + ports: + - containerPort: 8080 + name: http + protocol: TCP + volumeMounts: + - mountPath: /var/lib/git + name: gitolite-storage + readOnly: false + imagePullSecrets: + - name: regcred + serviceAccountName: cgit + volumes: + - name: gitolite-storage + persistentVolumeClaim: + claimName: gitolite-storage diff --git a/grumpy/cgit/cgit-ing.yaml b/grumpy/cgit/cgit-ing.yaml new file mode 100644 index 0000000..4e72c1b --- /dev/null +++ b/grumpy/cgit/cgit-ing.yaml @@ -0,0 +1,24 @@ +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + annotations: + certmanager.k8s.io/cluseterissuer: letsencrypt-prod + ingress.kubernetes.io/ssl-redirect: "true" + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/frontend-entry-points: http,https + traefik.ingress.kubernetes.io/redirect-entry-point: https + traefik.ingress.kubernetes.io/redirect-permanent: "true" + name: cgit +spec: + rules: + - host: git.ofmax.li + http: + paths: + - backend: + serviceName: cgit + servicePort: 8080 + path: / + tls: + - hosts: + - git.ofmax.li + secretName: git-ofmax-li-sec diff --git a/grumpy/cgit/cgit-sa.yaml b/grumpy/cgit/cgit-sa.yaml new file mode 100644 index 0000000..43f5e65 --- /dev/null +++ b/grumpy/cgit/cgit-sa.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: cgit diff --git a/grumpy/cgit/cgit-svc.yaml b/grumpy/cgit/cgit-svc.yaml new file mode 100644 index 0000000..9165c59 --- /dev/null +++ b/grumpy/cgit/cgit-svc.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: cgit +spec: + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: http + selector: + app.kubernetes.io/instance: cgit + app.kubernetes.io/name: cgit + type: ClusterIP diff --git a/grumpy/cgit/cgit-test-connection-pod.yaml b/grumpy/cgit/cgit-test-connection-pod.yaml new file mode 100644 index 0000000..6649e61 --- /dev/null +++ b/grumpy/cgit/cgit-test-connection-pod.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + name: cgit-test-connection +spec: + containers: + - args: + - cgit:8080 + command: + - wget + image: busybox + name: wget + restartPolicy: Never diff --git a/grumpy/cgit/kustomization.yaml b/grumpy/cgit/kustomization.yaml new file mode 100644 index 0000000..affede7 --- /dev/null +++ b/grumpy/cgit/kustomization.yaml @@ -0,0 +1,27 @@ +# Labels to add to all resources and selectors. +commonLabels: + app.kubernetes.io/instance: cgit + app.kubernetes.io/managed-by: Tiller + app.kubernetes.io/name: cgit + app.kubernetes.io/version: "1.0" + helm.sh/chart: cgit-0.1.0 + +# Images modify the tags for images without +# creating patches. +images: +- name: busybox +- name: registry.gitlab.com/grumps/grumpy-containers/cgit + newTag: v0.0.5 + +# Value of this field is prepended to the +# names of all resources +namePrefix: cgit + +# List of resource files that kustomize reads, modifies +# and emits as a YAML string +resources: +- cgit-deploy.yaml +- cgit-ing.yaml +- cgit-sa.yaml +- cgit-svc.yaml +- cgit-test-connection-pod.yaml
\ No newline at end of file diff --git a/grumpy/cgit/templates/NOTES.txt b/grumpy/cgit/templates/NOTES.txt deleted file mode 100644 index 569c2b8..0000000 --- a/grumpy/cgit/templates/NOTES.txt +++ /dev/null @@ -1,21 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} - {{- 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 "cgit.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 "cgit.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "cgit.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 "cgit.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 -{{- end }} diff --git a/grumpy/cgit/templates/_helpers.tpl b/grumpy/cgit/templates/_helpers.tpl deleted file mode 100644 index 52128b4..0000000 --- a/grumpy/cgit/templates/_helpers.tpl +++ /dev/null @@ -1,56 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "cgit.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 "cgit.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 chart name and version as used by the chart label. -*/}} -{{- define "cgit.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "cgit.labels" -}} -app.kubernetes.io/name: {{ include "cgit.name" . }} -helm.sh/chart: {{ include "cgit.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "cgit.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (include "cgit.fullname" .) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} diff --git a/grumpy/cgit/templates/deployment.yaml b/grumpy/cgit/templates/deployment.yaml deleted file mode 100644 index 7da67ab..0000000 --- a/grumpy/cgit/templates/deployment.yaml +++ /dev/null @@ -1,66 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "cgit.fullname" . }} - labels: -{{ include "cgit.labels" . | indent 4 }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app.kubernetes.io/name: {{ include "cgit.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - template: - metadata: - labels: - app.kubernetes.io/name: {{ include "cgit.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ template "cgit.serviceAccountName" . }} - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: CGIT_HOSTNAME - value: "{{ (index .Values.ingress.hosts 0).host }}" - - name: CGIT_PORT - value: "8080" - volumeMounts: - - mountPath: /var/lib/git - name: gitolite-storage - readOnly: false - ports: - - name: http - containerPort: 8080 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: http - #readinessProbe: - # httpGet: - # path: / - # port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumes: - - name: gitolite-storage - persistentVolumeClaim: - claimName: gitolite-storage - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/grumpy/cgit/templates/ingress.yaml b/grumpy/cgit/templates/ingress.yaml deleted file mode 100644 index 73aa44b..0000000 --- a/grumpy/cgit/templates/ingress.yaml +++ /dev/null @@ -1,37 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "cgit.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: -{{ include "cgit.labels" . | indent 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: {{ . }} - backend: - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} -{{- end }} diff --git a/grumpy/cgit/templates/service.yaml b/grumpy/cgit/templates/service.yaml deleted file mode 100644 index cb9361b..0000000 --- a/grumpy/cgit/templates/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "cgit.fullname" . }} - labels: -{{ include "cgit.labels" . | indent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - app.kubernetes.io/name: {{ include "cgit.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/grumpy/cgit/templates/serviceaccount.yaml b/grumpy/cgit/templates/serviceaccount.yaml deleted file mode 100644 index 9b6aa29..0000000 --- a/grumpy/cgit/templates/serviceaccount.yaml +++ /dev/null @@ -1,8 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "cgit.serviceAccountName" . }} - labels: -{{ include "cgit.labels" . | indent 4 }} -{{- end -}} diff --git a/grumpy/cgit/templates/tests/test-connection.yaml b/grumpy/cgit/templates/tests/test-connection.yaml deleted file mode 100644 index a1a9905..0000000 --- a/grumpy/cgit/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "cgit.fullname" . }}-test-connection" - labels: -{{ include "cgit.labels" . | indent 4 }} - annotations: - "helm.sh/hook": test-success -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "cgit.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/grumpy/cgit/values.yaml b/grumpy/cgit/values.yaml deleted file mode 100644 index 2516c57..0000000 --- a/grumpy/cgit/values.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# Default values for static-files. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -imagePullSecrets: - - name: regcred -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: - -service: - type: ClusterIP - port: 8080 - -ingress: - enabled: true - annotations: - kubernetes.io/ingress.class: traefik - certmanager.k8s.io/cluseterissuer: "letsencrypt-prod" - ingress.kubernetes.io/ssl-redirect: "true" - traefik.ingress.kubernetes.io/frontend-entry-points: http,https - traefik.ingress.kubernetes.io/redirect-entry-point: https - traefik.ingress.kubernetes.io/redirect-permanent: "true" - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - -resources: {} - # 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 - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -nodeSelector: {} - -tolerations: [] - -affinity: {} |