Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(scribe): add scribe #18

Merged
merged 6 commits into from
Sep 29, 2024
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
7 changes: 0 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ title: "[BUG]: <title>"
labels:
- kind/bug
body:
- type: dropdown
id: chart
attributes:
label: What chart are you seeing the problem on?
multiple: true
options:
- lubelogger
- type: textarea
id: what-happened
attributes:
Expand Down
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Feature Request
description: You want to submit a feature request? Open this one.
title: "[FEATURE]: <title>"
labels:
- kind/feature
body:
- type: textarea
id: description
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like.
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: additional_info
attributes:
label: Additional Information
description: Any other relevant information about the feature request.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Question
description: Have a generic question? Open this one.
title: "[QUESTION]: <title>"
labels:
- kind/support
body:
- type: textarea
id: question
attributes:
label: Ask a question!
validations:
required: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ backfill-app-version: yq

.PHONY: _backfill-app-version
_backfill-app-version:
yq '.appVersion = load("${CHART}/values.yaml").image.tag' ${CHART}/Chart.yaml -i
cd ${CHART}; ./.backfill.sh $(YQ)

.PHONY: generate-docs
generate-docs: helm-docs ## Run kube-linter on Kubernetes manifests.
Expand Down
7 changes: 7 additions & 0 deletions anza-labs/lubelogger/.backfill.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -eu

YQ="${1}"

"${YQ}" '.appVersion = load("./values.yaml").lubelogger.tag' './Chart.yaml' -i
2 changes: 1 addition & 1 deletion anza-labs/lubelogger/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: lubelogger
description: LubeLogger is a web-based vehicle maintenance and fuel mileage tracker
type: application
version: 0.4.3
version: 0.4.4
appVersion: "v1.3.8"
maintainers:
- name: Mateusz Urbanek
Expand Down
2 changes: 1 addition & 1 deletion anza-labs/lubelogger/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# lubelogger

![Version: 0.4.3](https://img.shields.io/badge/Version-0.4.3-informational?style=flat) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat) ![AppVersion: v1.3.8](https://img.shields.io/badge/AppVersion-v1.3.8-informational?style=flat)
![Version: 0.4.4](https://img.shields.io/badge/Version-0.4.4-informational?style=flat) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat) ![AppVersion: v1.3.8](https://img.shields.io/badge/AppVersion-v1.3.8-informational?style=flat)

LubeLogger is a web-based vehicle maintenance and fuel mileage tracker

Expand Down
2 changes: 1 addition & 1 deletion anza-labs/lubelogger/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default "latest" }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
Expand Down
7 changes: 7 additions & 0 deletions anza-labs/scribe/.backfill.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -eu

YQ="${1}"

"${YQ}" '.appVersion = load("./values.yaml").image.tag' './Chart.yaml' -i
23 changes: 23 additions & 0 deletions anza-labs/scribe/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
12 changes: 12 additions & 0 deletions anza-labs/scribe/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: scribe
description: |
Scribe is a tool that automates the propagation of annotations across Kubernetes resources based
on the annotations in a Namespace.
type: application
version: 0.1.0
appVersion: "v0.1.0"
maintainers:
- name: Mateusz Urbanek
email: [email protected]
url: http://linkedin.com/in/urbanekmateusz
38 changes: 38 additions & 0 deletions anza-labs/scribe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# scribe

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat)

Scribe is a tool that automates the propagation of annotations across Kubernetes resources based
on the annotations in a Namespace.

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| Mateusz Urbanek | <[email protected]> | <http://linkedin.com/in/urbanekmateusz> |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity settings for the pods. |
| config[0].apiVersion | string | `"apps/v1"` | |
| config[0].resources[0].kind | string | `"DaemonSet"` | |
| config[0].resources[1].kind | string | `"Deployment"` | |
| config[0].resources[2].kind | string | `"StatefulSet"` | |
| config[0].resources[2].plural | string | `"statefulsets"` | |
| fullnameOverride | string | `""` | Override for the full name. |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. |
| image.repository | string | `"ghcr.io/anza-labs/scribe"` | Registry and repository for the scribe image. |
| image.tag | string | `"v0.1.0"` | Tag for the image. |
| imagePullSecrets | list | `[]` | Secrets for pulling images. |
| nameOverride | string | `""` | Override for the name. |
| nodeSelector | object | `{}` | Node selector for the pods. |
| podAnnotations | object | `{}` | Annotations to be added to the pods. |
| podLabels | object | `{}` | Labels to be added to the pods. |
| podSecurityContext | object | `{}` | |
| replicaCount | int | `1` | Number of replicas for the deployment. |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
| tolerations | list | `[]` | Tolerations for the pods. |

Empty file.
58 changes: 58 additions & 0 deletions anza-labs/scribe/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "scribe.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 "scribe.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 "scribe.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "scribe.labels" -}}
helm.sh/chart: {{ include "scribe.chart" . }}
{{ include "scribe.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "scribe.selectorLabels" -}}
app.kubernetes.io/name: {{ include "scribe.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create secret name used for configuring the tool.
*/}}
{{- define "scribe.config" -}}
{{- printf "%s-config" (include "scribe.fullname" .) }}
{{- end }}
18 changes: 18 additions & 0 deletions anza-labs/scribe/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "scribe.config" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "scribe.labels" . | nindent 4 }}
data:
config.yaml: |
---
types:
{{- range .Values.config }}
{{- $apiVersion := .apiVersion }}
{{- range .resources }}
- apiVersion: {{ $apiVersion }}
kind: {{ .kind }}
{{- end }}
{{- end }}
82 changes: 82 additions & 0 deletions anza-labs/scribe/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "scribe.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "scribe.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "scribe.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "scribe.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "scribe.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: manager
args:
- --leader-elect
- --health-probe-bind-address=:8081
- --metrics-bind-address=:8443
- --config-path=/etc/scribe/config.yaml
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: probes
containerPort: 8081
protocol: TCP
- name: https
containerPort: 8443
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: config-volume
mountPath: /etc/scribe
volumes:
- name: config-volume
configMap:
name: {{ include "scribe.config" . }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading
Loading