Skip to content

Commit

Permalink
feat: feature discovery updates for inventory chart (#245)
Browse files Browse the repository at this point in the history
* feat: feature discovery updates for inventory chart

* feat: update of chart labels

* Update config.yaml

* Update config.yaml

* Update values.yaml

* Update config.yaml

* Update config.yaml

* Update config.yaml

* feat: adding port 8444 to inventory operator service

* Update daemonset.yaml

* feat: update of inventory operator values.yaml with storage classes

* feat: remove daemon-set from inventory operator chart

* refactor(operator/inventory): deploy hw discovery from operator

* feat: update inventory operator chart to accept image tag

* feat: update ip and hostname operators with new labels, selectors, and command sets

* Update values.yaml

* feat: remove liveness and readiness probes from inventory operator

* feat: update hostname operator configmap to operator-hostname

* feat: update hostname operator configmap namespace

* feat: reconfigure configmap for hostname operator

* feat: add targetport to ip and hostname operator services

* feat: add configmap for ip-operator

* feat: add provider-address to ip operator configmap

* feat: updating inventory operator targetportname to rest

* feat: updating feature-discovery branch with main updates

* feat: update readme to state inventory operator is required

* feat: update inventory operator with simplied role bindings

* feat: update provider and operator versions to 0.5.3-rc1

* feat: update inventory operator as a required component

---------

Co-authored-by: chainzero <[email protected]>
  • Loading branch information
chainzero and chainzero authored Feb 28, 2024
1 parent 6463f35 commit ab9354d
Show file tree
Hide file tree
Showing 28 changed files with 523 additions and 377 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Please refer to the https://docs.akash.network for Helm-Chart based installation
| akash-node | Installs an Akash RPC node (required) |
| akash-provider | Installs an Akash provider (required) |
| akash-hostname-operator | An operator to map Ingress objects to Akash deployments (required) |
| akash-inventory-operator | An operator required for persistent storage (optional) |
| akash-inventory-operator | An operator for inventory discovery, labeling, and reporting (required)|
| akash-ip-operator | An operator required for ip marketplace (optional) |

---
Expand Down
4 changes: 2 additions & 2 deletions charts/akash-hostname-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ type: application
# Versions are expected to follow Semantic Versioning (https://semver.org/)

# Major version bit highlights the mainnet release (e.g. mainnet4 = 4.x.x, mainnet5 = 5.x.x, ...)
version: 8.0.0
version: 9.0.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.
#
# Refs https://github.com/akash-network/provider/releases
appVersion: 0.4.8
appVersion: 0.5.3-rc1
70 changes: 40 additions & 30 deletions charts/akash-hostname-operator/templates/cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: manage-ingress
rules:
- apiGroups: ["networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "list", "create", "update", "delete", "deletecollection", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: watch-providerhosts
rules:
- apiGroups: ["akash.network"]
resources: ["providerhosts"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: watch-manifests
rules:
- apiGroups: ["akash.network"]
resources: ["providerhosts", "manifests"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: get-namespaces
name: akash-operator-hostname
labels:
app.kubernetes.io/name: hostname
app.kubernetes.io/instance: hostname-service
app.kubernetes.io/component: operator
app.kubernetes.io/part-of: provider
rules:
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get"]
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- get
- list
- create
- update
- delete
- deletecollection
- watch
- apiGroups:
- ""
resources:
- namespaces
- services
verbs:
- get
- apiGroups:
- akash.network
resources:
- providerhosts
- manifests
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
9 changes: 0 additions & 9 deletions charts/akash-hostname-operator/templates/config-map.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions charts/akash-hostname-operator/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: operator-hostname
namespace: akash-services
data:
k8s-manifest-ns: "lease"
prune-interval: "600s"
ignore-list-entry-limit: "131072"
web-refresh-interval: "5s"
retry-delay: "3s"
ignore-list-age-limit: "2613600s"
event-failure-limit: "3"
112 changes: 64 additions & 48 deletions charts/akash-hostname-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,80 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "akash-hostname-operator.fullname" . }}
name: operator-hostname
labels:
{{- include "akash-hostname-operator.labels" . | nindent 4 }}
app.kubernetes.io/name: hostname
app.kubernetes.io/instance: hostname-service
app.kubernetes.io/component: operator
app.kubernetes.io/part-of: provider
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "akash-hostname-operator.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: hostname
app.kubernetes.io/instance: hostname-service
app.kubernetes.io/component: operator
app.kubernetes.io/part-of: provider
replicas: 1
revisionHistoryLimit: 1
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "akash-hostname-operator.selectorLabels" . | nindent 8 }}
app.kubernetes.io/name: hostname
app.kubernetes.io/instance: hostname-service
app.kubernetes.io/component: operator
app.kubernetes.io/part-of: provider
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "akash-hostname-operator.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
serviceAccountName: operator-hostname
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
- name: operator-hostname
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh", "/boot/run.sh"]
args: ["provider-services", "operator", "hostname"]
ports:
- name: status
containerPort: 8085
- name: rest
containerPort: 8080
env:
- name: AKASH_K8S_MANIFEST_NS
value: lease
volumeMounts:
- name: boot
mountPath: /boot
readOnly: true
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: boot
configMap:
name: akash-{{ include "akash-hostname-operator.fullname" . }}-boot
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
- name: AP_K8S_MANIFEST_NS
valueFrom:
configMapKeyRef:
name: operator-hostname
key: k8s-manifest-ns
- name: AP_PRUNE_INTERVAL
valueFrom:
configMapKeyRef:
name: operator-hostname
key: prune-interval
- name: AP_IGNORE_LIST_ENTRY_LIMIT
valueFrom:
configMapKeyRef:
name: operator-hostname
key: ignore-list-entry-limit
- name: AP_WEB_REFRESH_INTERVAL
valueFrom:
configMapKeyRef:
name: operator-hostname
key: web-refresh-interval
- name: AP_RETRY_DELAY
valueFrom:
configMapKeyRef:
name: operator-hostname
key: retry-delay
- name: AP_IGNORE_LIST_AGE_LIMIT
valueFrom:
configMapKeyRef:
name: operator-hostname
key: ignore-list-age-limit
- name: AP_EVENT_FAILURE_LIMIT
valueFrom:
configMapKeyRef:
name: operator-hostname
key: event-failure-limit
- name: AP_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: AP_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
61 changes: 11 additions & 50 deletions charts/akash-hostname-operator/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,22 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "hostname-operator.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") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
---
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "akash-hostname-operator.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
name: akash-hostname-operator
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
nginx.ingress.kubernetes.io/proxy-send-timeout: "60"
nginx.ingress.kubernetes.io/proxy-read-timeout: "60"

spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
ingressClassName: "akash-ingress-class"
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
- host: akash-hostname-operator.localhost
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
- path: /
pathType: Prefix
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
name: akash-hostname-operator
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
name: status
53 changes: 10 additions & 43 deletions charts/akash-hostname-operator/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,18 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: akash-operator-manage-hostnames
subjects:
- kind: ServiceAccount
name: {{ include "akash-hostname-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: manage-ingress
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: akash-operator-watch-providerhosts
subjects:
- kind: ServiceAccount
name: {{ include "akash-hostname-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: watch-providerhosts
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: akash-operator-watch-manifests
subjects:
- kind: ServiceAccount
name: {{ include "akash-hostname-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: watch-manifests
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: akash-operator-get-namespaces
name: akash-operator-hostname
labels:
app.kubernetes.io/name: hostname
app.kubernetes.io/instance: hostname-service
app.kubernetes.io/component: operator
app.kubernetes.io/part-of: provider
subjects:
- kind: ServiceAccount
name: {{ include "akash-hostname-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
name: operator-hostname
namespace: akash-services
roleRef:
kind: ClusterRole
name: get-namespaces
apiGroup: rbac.authorization.k8s.io
name: akash-operator-hostname
apiGroup: rbac.authorization.k8s.io
Loading

0 comments on commit ab9354d

Please sign in to comment.