Skip to content

Commit

Permalink
feat: feature discovery updates for inventory chart
Browse files Browse the repository at this point in the history
  • Loading branch information
chainzero authored and chainzero committed Jan 24, 2024
1 parent 4ef9e95 commit a0dd57a
Show file tree
Hide file tree
Showing 8 changed files with 217 additions and 36 deletions.
40 changes: 39 additions & 1 deletion charts/akash-inventory-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
64 changes: 61 additions & 3 deletions charts/akash-inventory-operator/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
8 changes: 8 additions & 0 deletions charts/akash-inventory-operator/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
version: v1
cluster_storage:
- default
- beta2
exclude:
nodes: []
node_storage: []
54 changes: 54 additions & 0 deletions charts/akash-inventory-operator/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 23 additions & 7 deletions charts/akash-inventory-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: akash-inventory-operator
name: operator-inventory
namespace: akash-services
labels:
akash.network: "true"
Expand All @@ -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
Expand All @@ -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
14 changes: 14 additions & 0 deletions charts/akash-inventory-operator/templates/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 5 additions & 24 deletions charts/akash-inventory-operator/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
14 changes: 13 additions & 1 deletion charts/akash-inventory-operator/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: akash-inventory-operator
name: operator-inventory
namespace: akash-services
labels:
akash.network: "true"
app.kubernetes.io/name: akash
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

0 comments on commit a0dd57a

Please sign in to comment.