Skip to content
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

Operator deployment #3

Merged
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
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ FROM registry.svc.ci.openshift.org/openshift/release:golang-1.15 AS builder
WORKDIR /go/src/github.com/openshift/cluster-cloud-controller-manager-operator
COPY . .
RUN make build

FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base
COPY --from=builder /go/src/github.com/openshift/cluster-cloud-controller-manager-operator/bin/cluster-controller-manager-operator .
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ generate: controller-gen

# Build the docker image
.PHONY: image
image: test
image:
docker build -t ${IMG} .

# Push the docker image
Expand Down
49 changes: 49 additions & 0 deletions manifests/0000_26_cloud-controller-manager-operator_02_rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,38 @@ rules:
verbs:
- update

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: cluster-cloud-controller-manager
namespace: openshift-cloud-controller-manager-operator
annotations:
include.release.openshift.io/self-managed-high-availability: "true"
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete

- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- create
- update

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -51,3 +83,20 @@ subjects:
- kind: ServiceAccount
namespace: openshift-cloud-controller-manager-operator
name: cluster-cloud-controller-manager

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: cluster-cloud-controller-manager
namespace: openshift-cloud-controller-manager-operator
annotations:
include.release.openshift.io/self-managed-high-availability: "true"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cluster-cloud-controller-manager
subjects:
- kind: ServiceAccount
namespace: openshift-cloud-controller-manager-operator
name: cluster-cloud-controller-manager
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cluster-cloud-controller-manager
namespace: openshift-cloud-controller-manager-operator
labels:
k8s-app: cloud-manager-operator
spec:
selector:
matchLabels:
k8s-app: cloud-manager-operator
replicas: 1
template:
metadata:
labels:
k8s-app: cloud-manager-operator
spec:
priorityClassName: system-node-critical
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the options here? Does this mean this component is critical if we want nodes to work correctly?

Copy link
Contributor Author

@Danil-Grigorev Danil-Grigorev Jan 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to doc there are a couple. I'm following the practices of both MAO and KCM here as we fall under master-controller category.

serviceAccountName: cluster-cloud-controller-manager
containers:
- name: cluster-cloud-controller-manager
image: registry.svc.ci.openshift.org/openshift:cluster-cloud-controller-manager
command:
- "/cluster-controller-manager-operator"
args:
- --leader-elect
env:
- name: RELEASE_VERSION
value: "0.0.1-snapshot"
resources:
requests:
cpu: 10m
memory: 50Mi
nodeSelector:
node-role.kubernetes.io/master: ""
restartPolicy: Always
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
- key: "node.kubernetes.io/unreachable"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 120
- key: "node.kubernetes.io/not-ready"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 120
8 changes: 8 additions & 0 deletions manifests/image-references
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: ImageStream
apiVersion: image.openshift.io/v1
spec:
tags:
- name: cluster-cloud-controller-manager-operator
from:
kind: DockerImage
name: registry.svc.ci.openshift.org/openshift:cluster-cloud-controller-manager