-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: Create cosmos operator chart (#134)
* FEAT: Create cosmos operator chart * FEAT: Create cosmos operator chart
- Loading branch information
1 parent
90c48bf
commit 4f764ee
Showing
13 changed files
with
14,256 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v2 | ||
name: cosmos-operator | ||
description: Cosmos Operator Chart | ||
type: application | ||
version: v0.21.8 | ||
appVersion: "v0.21.8" | ||
maintainers: | ||
- name: pokt-foundation | ||
- name: GustavoBelfort |
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 "cosmos-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 "cosmos-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 "cosmos-operator.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "cosmos-operator.labels" -}} | ||
helm.sh/chart: {{ include "cosmos-operator.chart" . }} | ||
{{ include "cosmos-operator.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "cosmos-operator.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "cosmos-operator.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "cosmos-operator.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "cosmos-operator.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
6,075 changes: 6,075 additions & 0 deletions
6,075
charts/cosmos-operator/templates/cosmosfullnode-crd.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
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,91 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "cosmos-operator.fullname" . }}-controller-manager | ||
labels: | ||
{{- include "cosmos-operator.labels" . | nindent 4 }} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "cosmos-operator.fullname" . }}-controller-manager | ||
labels: | ||
control-plane: controller-manager | ||
{{- include "cosmos-operator.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.controllerManager.replicas }} | ||
selector: | ||
matchLabels: | ||
control-plane: controller-manager | ||
{{- include "cosmos-operator.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
control-plane: controller-manager | ||
{{- include "cosmos-operator.selectorLabels" . | nindent 8 }} | ||
annotations: | ||
kubectl.kubernetes.io/default-container: manager | ||
spec: | ||
containers: | ||
- args: | ||
- --secure-listen-address=0.0.0.0:8443 | ||
- --upstream=http://127.0.0.1:8080/ | ||
- --logtostderr=true | ||
- --v=0 | ||
env: | ||
- name: KUBERNETES_CLUSTER_DOMAIN | ||
value: {{ .Values.kubernetesClusterDomain }} | ||
image: {{ .Values.controllerManager.kubeRbacProxy.image.repository }}:{{ .Values.controllerManager.kubeRbacProxy.image.tag }} | ||
name: kube-rbac-proxy | ||
ports: | ||
- containerPort: 8443 | ||
name: https | ||
protocol: TCP | ||
resources: {{- toYaml .Values.controllerManager.kubeRbacProxy.resources | nindent | ||
10 }} | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
- args: | ||
- --health-probe-bind-address=:8081 | ||
- --metrics-bind-address=127.0.0.1:8080 | ||
- --leader-elect | ||
command: | ||
- /manager | ||
env: | ||
- name: KUBERNETES_CLUSTER_DOMAIN | ||
value: {{ .Values.kubernetesClusterDomain }} | ||
image: {{ .Values.controllerManager.manager.image.repository }}:{{ .Values.controllerManager.manager.image.tag }} | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8081 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
name: manager | ||
ports: | ||
- containerPort: 6060 | ||
name: pprof | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
resources: {{- toYaml .Values.controllerManager.manager.resources | nindent 10 | ||
}} | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
securityContext: | ||
runAsNonRoot: true | ||
seccompProfile: | ||
type: RuntimeDefault | ||
serviceAccountName: {{ include "cosmos-operator.fullname" . }}-controller-manager | ||
terminationGracePeriodSeconds: 10 |
53 changes: 53 additions & 0 deletions
53
charts/cosmos-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,53 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ include "cosmos-operator.fullname" . }}-leader-election-role | ||
labels: | ||
{{- include "cosmos-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 "cosmos-operator.fullname" . }}-leader-election-rolebinding | ||
labels: | ||
{{- include "cosmos-operator.labels" . | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: '{{ include "cosmos-operator.fullname" . }}-leader-election-role' | ||
subjects: | ||
- kind: ServiceAccount | ||
name: '{{ include "cosmos-operator.fullname" . }}-controller-manager' | ||
namespace: '{{ .Release.Namespace }}' |
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 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "cosmos-operator.fullname" . }}-manager-config | ||
labels: | ||
{{- include "cosmos-operator.labels" . | nindent 4 }} | ||
data: | ||
controller_manager_config.yaml: | | ||
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 | ||
health: | ||
healthProbeBindAddress: {{ .Values.managerConfig.controllerManagerConfigYaml.health.healthProbeBindAddress | ||
| quote }} | ||
kind: ControllerManagerConfig | ||
leaderElection: | ||
leaderElect: {{ .Values.managerConfig.controllerManagerConfigYaml.leaderElection.leaderElect | ||
}} | ||
resourceName: {{ .Values.managerConfig.controllerManagerConfigYaml.leaderElection.resourceName | ||
| quote }} | ||
metrics: | ||
bindAddress: {{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindAddress | ||
| quote }} | ||
webhook: | ||
port: {{ .Values.managerConfig.controllerManagerConfigYaml.webhook.port }} |
Oops, something went wrong.