-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Abbas-gheydi/main
add helm chart
- Loading branch information
Showing
20 changed files
with
496 additions
and
3 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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
tags: [ v* ] | ||
|
||
jobs: | ||
release: | ||
|
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 |
---|---|---|
|
@@ -258,3 +258,13 @@ catalog-build: opm ## Build a catalog image. | |
.PHONY: catalog-push | ||
catalog-push: ## Push a catalog image. | ||
$(MAKE) docker-push IMG=$(CATALOG_IMG) | ||
######################### Helmify | ||
HELMIFY ?= $(LOCALBIN)/helmify | ||
|
||
.PHONY: helmify | ||
helmify: $(HELMIFY) ## Download helmify locally if necessary. | ||
$(HELMIFY): $(LOCALBIN) | ||
test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/[email protected] | ||
|
||
helm: manifests kustomize helmify | ||
$(KUSTOMIZE) build config/default | $(HELMIFY) deploy/charts/rls-operator |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
resources: | ||
- manager.yaml | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
images: | ||
- name: controller | ||
newName: controller | ||
newTag: latest |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
control-plane: controller-manager | ||
app.kubernetes.io/name: service | ||
app.kubernetes.io/created-by: contour-global-ratelimit-operator | ||
app.kubernetes.io/part-of: contour-global-ratelimit-operator | ||
app.kubernetes.io/managed-by: kustomize | ||
name: controller-manager | ||
namespace: system | ||
spec: | ||
ports: | ||
- name: xds | ||
port: 18000 | ||
protocol: TCP | ||
targetPort: xds | ||
selector: | ||
control-plane: controller-manager |
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,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/ |
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,21 @@ | ||
apiVersion: v2 | ||
name: rls-operator | ||
description: A Helm chart for Kubernetes | ||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "0.1.0" |
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,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "rls-operator.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 "rls-operator.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 "rls-operator.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "rls-operator.labels" -}} | ||
helm.sh/chart: {{ include "rls-operator.chart" . }} | ||
{{ include "rls-operator.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "rls-operator.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "rls-operator.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "rls-operator.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "rls-operator.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
16 changes: 16 additions & 0 deletions
16
deploy/charts/rls-operator/templates/controller-manager.yaml
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,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "rls-operator.fullname" . }}-controller-manager | ||
labels: | ||
app.kubernetes.io/created-by: contour-global-ratelimit-operator | ||
app.kubernetes.io/part-of: contour-global-ratelimit-operator | ||
control-plane: controller-manager | ||
{{- include "rls-operator.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.controllerManager.type }} | ||
selector: | ||
control-plane: controller-manager | ||
{{- include "rls-operator.selectorLabels" . | nindent 4 }} | ||
ports: | ||
{{- .Values.controllerManager.ports | toYaml | nindent 2 -}} |
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,89 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "rls-operator.fullname" . }}-controller-manager | ||
labels: | ||
app.kubernetes.io/component: manager | ||
app.kubernetes.io/created-by: contour-global-ratelimit-operator | ||
app.kubernetes.io/part-of: contour-global-ratelimit-operator | ||
control-plane: controller-manager | ||
{{- include "rls-operator.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.controllerManager.replicas }} | ||
selector: | ||
matchLabels: | ||
control-plane: controller-manager | ||
{{- include "rls-operator.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
control-plane: controller-manager | ||
{{- include "rls-operator.selectorLabels" . | nindent 8 }} | ||
annotations: | ||
kubectl.kubernetes.io/default-container: manager | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: kubernetes.io/arch | ||
operator: In | ||
values: | ||
- amd64 | ||
- arm64 | ||
- ppc64le | ||
- s390x | ||
- key: kubernetes.io/os | ||
operator: In | ||
values: | ||
- linux | ||
containers: | ||
- args: {{- toYaml .Values.controllerManager.kubeRbacProxy.args | nindent 8 }} | ||
env: | ||
- name: KUBERNETES_CLUSTER_DOMAIN | ||
value: {{ quote .Values.kubernetesClusterDomain }} | ||
image: {{ .Values.controllerManager.kubeRbacProxy.image.repository }}:{{ .Values.controllerManager.kubeRbacProxy.image.tag | ||
| default .Chart.AppVersion }} | ||
name: kube-rbac-proxy | ||
ports: | ||
- containerPort: 8443 | ||
name: https | ||
protocol: TCP | ||
resources: {{- toYaml .Values.controllerManager.kubeRbacProxy.resources | nindent | ||
10 }} | ||
securityContext: {{- toYaml .Values.controllerManager.kubeRbacProxy.containerSecurityContext | ||
| nindent 10 }} | ||
- args: {{- toYaml .Values.controllerManager.manager.args | nindent 8 }} | ||
command: | ||
- /manager | ||
env: | ||
- name: KUBERNETES_CLUSTER_DOMAIN | ||
value: {{ quote .Values.kubernetesClusterDomain }} | ||
image: {{ .Values.controllerManager.manager.image.repository }}:{{ .Values.controllerManager.manager.image.tag | ||
| default .Chart.AppVersion }} | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8081 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
name: manager | ||
ports: | ||
- containerPort: 18000 | ||
name: xds | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
resources: {{- toYaml .Values.controllerManager.manager.resources | nindent 10 | ||
}} | ||
securityContext: {{- toYaml .Values.controllerManager.manager.containerSecurityContext | ||
| nindent 10 }} | ||
securityContext: | ||
runAsNonRoot: true | ||
serviceAccountName: {{ include "rls-operator.fullname" . }}-controller-manager | ||
terminationGracePeriodSeconds: 10 |
59 changes: 59 additions & 0 deletions
59
deploy/charts/rls-operator/templates/leader-election-rbac.yaml
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,59 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ include "rls-operator.fullname" . }}-leader-election-role | ||
labels: | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/created-by: contour-global-ratelimit-operator | ||
app.kubernetes.io/part-of: contour-global-ratelimit-operator | ||
{{- include "rls-operator.labels" . | nindent 4 }} | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch | ||
- delete | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch | ||
- delete | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ include "rls-operator.fullname" . }}-leader-election-rolebinding | ||
labels: | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/created-by: contour-global-ratelimit-operator | ||
app.kubernetes.io/part-of: contour-global-ratelimit-operator | ||
{{- include "rls-operator.labels" . | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: '{{ include "rls-operator.fullname" . }}-leader-election-role' | ||
subjects: | ||
- kind: ServiceAccount | ||
name: '{{ include "rls-operator.fullname" . }}-controller-manager' | ||
namespace: '{{ .Release.Namespace }}' |
Oops, something went wrong.