-
Notifications
You must be signed in to change notification settings - Fork 3
Added Kustomize for controller, sidecar & CRDs #9
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
images: | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Controller | ||
- name: objectstorage-controller | ||
newName: quay.io/containerobjectstorage/objectstorage-controller | ||
newTag: latest | ||
# Sidecar | ||
- name: sample-driver | ||
newName: quay.io/containerobjectstorage/sample-driver | ||
newTag: latest | ||
- name: object-storage-sidecar | ||
newName: quay.io/containerobjectstorage/object-storage-sidecar | ||
newTag: latest | ||
|
||
resources: | ||
# CRDs | ||
- https://raw.githubusercontent.com/kubernetes-sigs/container-object-storage-interface-api/master/crds/objectstorage.k8s.io_bucketaccessclasses.yaml | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- https://raw.githubusercontent.com/kubernetes-sigs/container-object-storage-interface-api/master/crds/objectstorage.k8s.io_bucketaccesses.yaml | ||
- https://raw.githubusercontent.com/kubernetes-sigs/container-object-storage-interface-api/master/crds/objectstorage.k8s.io_bucketaccessrequests.yaml | ||
- https://raw.githubusercontent.com/kubernetes-sigs/container-object-storage-interface-api/master/crds/objectstorage.k8s.io_bucketclasses.yaml | ||
- https://raw.githubusercontent.com/kubernetes-sigs/container-object-storage-interface-api/master/crds/objectstorage.k8s.io_bucketrequests.yaml | ||
- https://raw.githubusercontent.com/kubernetes-sigs/container-object-storage-interface-api/master/crds/objectstorage.k8s.io_buckets.yaml | ||
# Controller | ||
- manifests/ns.yaml | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- manifests/sa.yaml | ||
- manifests/rbac.yaml | ||
- manifests/deployment.yaml | ||
# Sidecar | ||
- https://raw.githubusercontent.com/container-object-storage-interface/cosi-provisioner-sidecar/master/examples/object-storage-sidecar.yaml | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
||
patches: | ||
# CRDs | ||
- target: | ||
kind: CustomResourceDefinition | ||
patch: |- | ||
- op: add | ||
path: /metadata/annotations | ||
value: | ||
controller-gen.kubebuilder.io/version: (devel) | ||
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/container-object-storage-interface-api/pull/2 | ||
# Controller | ||
- target: | ||
kind: Deployment | ||
name: objectstorage-controller | ||
patch: |- | ||
- op: replace | ||
path: /spec/template/spec/containers/0/imagePullPolicy | ||
value: IfNotPresent | ||
# Sidecar | ||
- target: | ||
kind: Deployment | ||
name: object-storage-provisioner | ||
patch: |- | ||
- op: replace | ||
path: /spec/template/spec/containers/0/imagePullPolicy | ||
value: IfNotPresent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On one hand, the image overrides specify the |
||
- op: replace | ||
path: /spec/template/spec/containers/1/imagePullPolicy | ||
value: IfNotPresent | ||
- op: replace | ||
path: /metadata | ||
value: | ||
name: object-storage-provisioner | ||
labels: | ||
app: object-storage-provisioner | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be coded in the manifest directly, no reason to do it as a patch. Also, consider adopting https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ instead. |
||
namespace: objectstorage-provisioner-ns | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not handle namespaces like this but rely on |
||
- target: | ||
kind: Secret | ||
name: object-storage-provisioner | ||
patch: |- | ||
- op: replace | ||
path: /metadata | ||
value: | ||
name: object-storage-provisioner | ||
labels: | ||
app: object-storage-provisioner | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. |
||
namespace: objectstorage-provisioner-ns | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
kind: Deployment | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: objectstorage-controller | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Objects can get prefixed through a |
||
namespace: objectstorage-system | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See earlier comments. |
||
spec: | ||
replicas: 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the controller have some kind of leader election? If not, I think it's easier to simply deploy this as a |
||
strategy: | ||
rollingUpdate: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless leader election is implemented, this could cause trouble 😃 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have leader election |
||
maxUnavailable: 0 | ||
maxSurge: 1 | ||
selector: | ||
matchLabels: | ||
app: objectstorage-controller | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's be a bit more specific, e.g.:
Then, have a Again, see https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels. |
||
template: | ||
metadata: | ||
labels: | ||
app: objectstorage-controller | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. Here, have a |
||
spec: | ||
serviceAccountName: objectstorage-controller-sa | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See earlier comment about prefix handling. |
||
containers: | ||
- name: objectstorage-controller | ||
image: quay.io/containerobjectstorage/objectstorage-controller:latest | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need, see above. |
||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: objectstorage-system |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: objectstorage-controller-role | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rules: | ||
- apiGroups: ["objectstorage.k8s.io"] | ||
resources: ["bucketrequests", "bucketaccessrequests"] | ||
verbs: ["get", "list", "watch"] | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- apiGroups: ["objectstorage.k8s.io"] | ||
resources: ["buckets", "bucketaccess"] | ||
verbs: ["get", "list", "watch", "update", "create", "delete"] | ||
- apiGroups: ["objectstorage.k8s.io"] | ||
resources: ["bucketclass","bucketaccessclass"] | ||
verbs: ["get", "list"] | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["list", "watch", "create", "update", "patch"] | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: objectstorage-controller:system | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
subjects: | ||
- kind: ServiceAccount | ||
name: objectstorage-controller-sa | ||
namespace: objectstorage-system | ||
roleRef: | ||
kind: ClusterRole | ||
name: objectstorage-controller-role | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: objectstorage-controller | ||
namespace: objectstorage-system | ||
tparikh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rules: | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
verbs: ["get", "watch", "list", "delete", "update", "create"] | ||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: objectstorage-controller | ||
namespace: objectstorage-system | ||
subjects: | ||
- kind: ServiceAccount | ||
name: objectstorage-controller-sa | ||
namespace: objectstorage-system | ||
roleRef: | ||
kind: Role | ||
name: objectstorage-controller | ||
apiGroup: rbac.authorization.k8s.io |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: objectstorage-controller-sa | ||
namespace: objectstorage-system |
Uh oh!
There was an error while loading. Please reload this page.