diff --git a/charts/akash-inventory-operator/templates/clusterrole.yaml b/charts/akash-inventory-operator/templates/clusterrole.yaml index d6c34ba9..97554796 100644 --- a/charts/akash-inventory-operator/templates/clusterrole.yaml +++ b/charts/akash-inventory-operator/templates/clusterrole.yaml @@ -1,7 +1,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: akash-inventory-operator + name: operator-inventory labels: akash.network: "true" app.kubernetes.io/name: akash @@ -15,18 +15,29 @@ rules: - nodes - pods - events + - services - persistentvolumes - persistentvolumeclaims verbs: - get - list - watch + - apiGroups: + - '' + resources: + - nodes + verbs: + - patch - apiGroups: - '' resources: - pods/exec verbs: - create + - delete + - get + - list + - watch - apiGroups: - storage.k8s.io resources: @@ -62,3 +73,30 @@ rules: - get - list - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: operator-inventory-node + labels: + akash.network: "true" + app.kubernetes.io/name: operator-inventory-node + app.kubernetes.io/component: inventory + app.kubernetes.io/part-of: operator +rules: + - apiGroups: + - '' + resources: + - nodes + verbs: + - get + - list + - watch + - apiGroups: + - '' + resources: + - pods + verbs: + - get + - list + - watch diff --git a/charts/akash-inventory-operator/templates/clusterrolebinding.yaml b/charts/akash-inventory-operator/templates/clusterrolebinding.yaml index eb930407..ea664425 100644 --- a/charts/akash-inventory-operator/templates/clusterrolebinding.yaml +++ b/charts/akash-inventory-operator/templates/clusterrolebinding.yaml @@ -1,7 +1,8 @@ +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: akash-inventory-operator + name: operator-inventory labels: akash.network: "true" app.kubernetes.io/name: akash @@ -10,8 +11,65 @@ metadata: roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: akash-inventory-operator + name: operator-inventory subjects: - kind: ServiceAccount - name: akash-inventory-operator + name: operator-inventory namespace: akash-services +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: operator-inventory-node + labels: + akash.network: "true" + app.kubernetes.io/name: operator-inventory-node + app.kubernetes.io/component: inventory + app.kubernetes.io/part-of: operator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: operator-inventory-node +subjects: + - kind: ServiceAccount + name: operator-inventory-node + namespace: akash-services +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: akash-ip-operator-manage-service +subjects: + - kind: ServiceAccount + name: akash-ip-operator + namespace: akash-services +roleRef: + kind: ClusterRole + name: akash-ip-op-manage-service + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: akash-ip-operator-watch-providerleasedip +subjects: + - kind: ServiceAccount + name: akash-ip-operator + namespace: akash-services +roleRef: + kind: ClusterRole + name: akash-ip-op-watch-providerleasedip + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: akash-ip-operator-watch-configmaps +subjects: + - kind: ServiceAccount + name: akash-ip-operator + namespace: akash-services +roleRef: + kind: ClusterRole + name: akash-ip-op-watch-configmaps + apiGroup: rbac.authorization.k8s.io diff --git a/charts/akash-inventory-operator/templates/config.yaml b/charts/akash-inventory-operator/templates/config.yaml new file mode 100644 index 00000000..8e9476e0 --- /dev/null +++ b/charts/akash-inventory-operator/templates/config.yaml @@ -0,0 +1,8 @@ +--- +version: v1 +cluster_storage: + - default + - beta2 +exclude: + nodes: [] + node_storage: [] diff --git a/charts/akash-inventory-operator/templates/daemonset.yaml b/charts/akash-inventory-operator/templates/daemonset.yaml new file mode 100644 index 00000000..8f3f8a8e --- /dev/null +++ b/charts/akash-inventory-operator/templates/daemonset.yaml @@ -0,0 +1,54 @@ +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: operator-inventory-node + namespace: akash-services + labels: + akash.network: "true" + app.kubernetes.io/name: operator-inventory-node + app.kubernetes.io/component: inventory + app.kubernetes.io/part-of: operator +spec: + selector: + matchLabels: + app.kubernetes.io/name: operator-inventory-node + app.kubernetes.io/component: inventory + app.kubernetes.io/part-of: operator + template: + metadata: + labels: + akash.network: "true" + app.kubernetes.io/name: operator-inventory-node + app.kubernetes.io/component: inventory + app.kubernetes.io/part-of: operator + spec: + serviceAccountName: operator-inventory-node + containers: + - name: inventory-node + image: ghcr.io/akash-network/provider + args: + - "provider-services" + - "operator" + - "inventory" + - "node" + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8081 + name: grpc + resources: + requests: + memory: "64Mi" + cpu: "250m" + limits: + memory: "128Mi" + cpu: "500m" + env: + - name: AP_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: AP_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName diff --git a/charts/akash-inventory-operator/templates/deployment.yaml b/charts/akash-inventory-operator/templates/deployment.yaml index 609bfd25..dcb08651 100644 --- a/charts/akash-inventory-operator/templates/deployment.yaml +++ b/charts/akash-inventory-operator/templates/deployment.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: akash-inventory-operator + name: operator-inventory namespace: akash-services labels: akash.network: "true" @@ -19,17 +19,23 @@ spec: template: metadata: labels: - app: akash-inventory-operator + app: operator-inventory app.kubernetes.io/name: akash app.kubernetes.io/instance: inventory app.kubernetes.io/component: operator spec: - serviceAccountName: akash-inventory-operator + serviceAccountName: operator-inventory containers: - - name: akash-inventory-operator - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - command: ["provider-services", "operator", "inventory"] - imagePullPolicy: {{ .Values.image.pullPolicy }} + - name: operator-inventory + image: ghcr.io/akash-network/provider + args: + - "provider-services" + - "operator" + - "inventory" + imagePullPolicy: IfNotPresent + env: + - name: AP_CONFIG + value: /akash/config.yaml resources: limits: cpu: 500m @@ -41,3 +47,13 @@ spec: - containerPort: 8080 name: api protocol: TCP + - containerPort: 8081 + name: grpc + protocol: TCP + volumeMounts: + - name: config + mountPath: /akash + volumes: + - name: config + configMap: + name: operator-inventory diff --git a/charts/akash-inventory-operator/templates/kustomization.yaml b/charts/akash-inventory-operator/templates/kustomization.yaml new file mode 100644 index 00000000..73238b1e --- /dev/null +++ b/charts/akash-inventory-operator/templates/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: akash-services +resources: + - service-accounts.yaml + - cluster-roles.yaml + - role-bindings.yaml + - service.yaml + - daemonset.yaml + - deployment.yaml +configMapGenerator: + - name: operator-inventory + files: + - config.yaml diff --git a/charts/akash-inventory-operator/templates/service.yaml b/charts/akash-inventory-operator/templates/service.yaml index 4ced3cf4..c3bea5bf 100644 --- a/charts/akash-inventory-operator/templates/service.yaml +++ b/charts/akash-inventory-operator/templates/service.yaml @@ -6,30 +6,7 @@ metadata: app.kubernetes.io/name: akash app.kubernetes.io/instance: inventory app.kubernetes.io/component: operator - name: akash-inventory-operator - namespace: akash-services -spec: - type: ClusterIP - ports: - - name: api - port: 8080 - targetPort: api - appProtocol: http - selector: - app.kubernetes.io/name: akash - app.kubernetes.io/instance: inventory - app.kubernetes.io/component: operator ---- -## Backwards compatability fix. Remove once 0.16.5 is released. -apiVersion: v1 -kind: Service -metadata: - labels: - akash.network: "true" - app.kubernetes.io/name: akash - app.kubernetes.io/instance: inventory - app.kubernetes.io/component: operator - name: inventory-operator + name: operator-inventory namespace: akash-services spec: type: ClusterIP @@ -38,6 +15,10 @@ spec: port: 8080 targetPort: api appProtocol: http + - name: grpc + port: 8081 + targetPort: grpc + appProtocol: tcp selector: app.kubernetes.io/name: akash app.kubernetes.io/instance: inventory diff --git a/charts/akash-inventory-operator/templates/serviceaccount.yaml b/charts/akash-inventory-operator/templates/serviceaccount.yaml index f550ef89..936019d2 100644 --- a/charts/akash-inventory-operator/templates/serviceaccount.yaml +++ b/charts/akash-inventory-operator/templates/serviceaccount.yaml @@ -1,7 +1,8 @@ +--- apiVersion: v1 kind: ServiceAccount metadata: - name: akash-inventory-operator + name: operator-inventory namespace: akash-services labels: akash.network: "true" @@ -9,3 +10,14 @@ metadata: app.kubernetes.io/instance: inventory app.kubernetes.io/component: operator automountServiceAccountToken: true +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: operator-inventory-node + namespace: akash-services + labels: + akash.network: "true" + app.kubernetes.io/name: operator-inventory-node + app.kubernetes.io/component: inventory + app.kubernetes.io/part-of: operator