Skip to content

Feature/node agent as config #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions deploy/crds/csi_v1_config_cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: csi.ibm.com/v1
kind: Config
metadata:
name: example-config
spec:
defineHost: true
nodeAgent:
repository: stg-artifactory.haifa.ibm.com:5030/ibm-node-agent
tag: "0.0.1"
port: "10086"

72 changes: 72 additions & 0 deletions deploy/crds/csi_v1_config_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: configs.csi.ibm.com
spec:
group: csi.ibm.com
names:
kind: Config
listKind: ConfigList
plural: configs
singular: config
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
defineHost:
type: boolean
nodeAgent:
properties:
port:
description: The port of the node agent server
type: string
repository:
description: The repository of the node agent image
type: string
tag:
description: The tag of the node agent image
type: string
required:
- repository
- tag
- port
type: object
required:
- defineHost
- nodeAgent
type: object
status:
properties:
nodeAgent:
description: Phase is the driver running phase
properties:
phase:
description: Phase is the NodeAgent running phase
type: string
required:
- phase
type: object
required:
- nodeAgent
type: object
version: v1
versions:
- name: v1
served: true
storage: true
14 changes: 8 additions & 6 deletions deploy/crds/csi_v1_ibmblockcsi_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,17 @@ spec:
type: boolean
nodeReady:
type: boolean
ready:
description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
of cluster Important: Run "operator-sdk generate k8s" to regenerate
code after modifying this file Add custom validation using kubebuilder
tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html'
type: boolean
phase:
description: Phase is the driver running phase
type: string
version:
description: Version is the current driver version
type: string
required:
- phase
- controllerReady
- nodeReady
- version
type: object
version: v1
versions:
Expand Down
7 changes: 3 additions & 4 deletions deploy/crds/csi_v1_nodeinfo_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,21 @@ spec:
type: object
status:
properties:
iqns:
definedOnStorages:
items:
type: string
type: array
wwpns:
iqns:
items:
type: string
type: array
definedOnStorages:
wwpns:
items:
type: string
type: array
required:
- iqns
- wwpns
# - definedOnStorages
type: object
version: v1
versions:
Expand Down
147 changes: 73 additions & 74 deletions deploy/ibm-block-csi-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,66 @@

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: configs.csi.ibm.com
spec:
group: csi.ibm.com
names:
kind: Config
listKind: ConfigList
plural: configs
singular: config
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
defineHost:
type: boolean
nodeAgent:
properties:
port:
description: The port of the node agent server
type: string
repository:
description: The repository of the node agent image
type: string
tag:
description: The tag of the node agent image
type: string
required:
- repository
- tag
- port
type: object
required:
- defineHost
- nodeAgent
type: object
status:
type: object
version: v1
versions:
- name: v1
served: true
storage: true

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -70,15 +132,17 @@ spec:
type: boolean
nodeReady:
type: boolean
ready:
description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
of cluster Important: Run "operator-sdk generate k8s" to regenerate
code after modifying this file Add custom validation using kubebuilder
tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html'
type: boolean
phase:
description: Phase is the driver running phase
type: string
version:
description: Version is the current driver version
type: string
required:
- phase
- controllerReady
- nodeReady
- version
type: object
version: v1
versions:
Expand Down Expand Up @@ -120,91 +184,28 @@ spec:
type: object
status:
properties:
iqns:
definedOnStorages:
items:
type: string
type: array
wwpns:
iqns:
items:
type: string
type: array
definedOnStorages:
wwpns:
items:
type: string
type: array
required:
- iqns
- wwpns
# - definedOnStorages
type: object
version: v1
versions:
- name: v1
served: true
storage: true

---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: ibm-node-agent
namespace: kube-system
spec:
selector:
matchLabels:
app.kubernetes.io/name: ibm-node-agent
template:
metadata:
labels:
app.kubernetes.io/name: ibm-node-agent
spec:
hostNetwork: true
containers:
- name: node-agent
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: stg-artifactory.haifa.ibm.com:5030/ibm-node-agent:0.0.1
imagePullPolicy: IfNotPresent
env:
- name: ADDRESS
value: :10086
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
ports:
- name: grpc
containerPort: 10086
volumeMounts:
- mountPath: /lib/modules
name: lib-modules
- mountPath: /sys
name: sysfs
- mountPath: /dev
name: dev
- name: iscsi
mountPath: /etc/iscsi
volumes:
- name: lib-modules
hostPath:
path: /lib/modules
type: Directory
- name: sysfs
hostPath:
path: /sys
type: Directory
- name: dev
hostPath:
path: /dev
type: Directory
- name: iscsi
hostPath:
path: /etc/iscsi
type: DirectoryOrCreate

---
apiVersion: apps/v1
kind: Deployment
Expand All @@ -231,8 +232,6 @@ spec:
env:
- name: WATCH_NAMESPACE
value: ""
- name: ENABLE_HOST_DEFINE
value: ""
- name: POD_NAME
valueFrom:
fieldRef:
Expand Down
60 changes: 0 additions & 60 deletions deploy/node_agent.yaml

This file was deleted.

Loading