Skip to content
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
72 changes: 72 additions & 0 deletions deploy/releases/0.8.2/kubectl/readme.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@

== Installation

The Runtime Component Operator can be installed to:

* watch own namespace
* watch another namespace
* watch all namespaces in the cluster

Appropriate roles and bindings are required to watch another namespace or watch all namespaces.

---

. Install Custom Resource Definitions (CRDs) for `RuntimeComponent` and `RuntimeOperation` for day-2 operation. This needs to be done only ONCE per cluster:
+
[source,sh]
----
kubectl apply -f https://raw.githubusercontent.com/application-stacks/runtime-component-operator/main/deploy/releases/0.8.2/kubectl/runtime-component-crd.yaml
----

. Install the Runtime Component Operator:

.. Set operator namespace and the namespace to watch:
+
NOTE: Ensure that you replace `<SPECIFY_OPERATOR_NAMESPACE_HERE>` and `<SPECIFY_WATCH_NAMESPACE_HERE>` with proper values. The namespaces must already exist. The commands below will not create the namespaces.
+
* To watch all namespaces in the cluster, set `WATCH_NAMESPACE='""'`
+

[source,sh]
----
OPERATOR_NAMESPACE=<SPECIFY_OPERATOR_NAMESPACE_HERE>
WATCH_NAMESPACE=<SPECIFY_WATCH_NAMESPACE_HERE>
----

.. _Optional_: Install roles and bindings to watch another namespace or all namespaces. This step can be skipped if the operator is only watching own namespace.

... To watch all namespaces, install cluster-level role-based access:
+
[source,sh]
----
curl -L https://raw.githubusercontent.com/application-stacks/runtime-component-operator/main/deploy/releases/0.8.2/kubectl/runtime-component-rbac-watch-all.yaml \
| sed -e "s/RUNTIME_COMPONENT_OPERATOR_NAMESPACE/${OPERATOR_NAMESPACE}/" \
| kubectl apply -f -
----

... To watch another namespace, install role with access to another namespace:
+
[source,sh]
----
curl -L https://raw.githubusercontent.com/application-stacks/runtime-component-operator/main/deploy/releases/0.8.2/kubectl/runtime-component-rbac-watch-another.yaml \
| sed -e "s/RUNTIME_COMPONENT_OPERATOR_NAMESPACE/${OPERATOR_NAMESPACE}/" \
| sed -e "s/RUNTIME_COMPONENT_WATCH_NAMESPACE/${WATCH_NAMESPACE}/" \
| kubectl apply -f -
----

.. Install the operator:
+
[source,sh]
----
curl -L https://raw.githubusercontent.com/application-stacks/runtime-component-operator/main/deploy/releases/0.8.2/kubectl/runtime-component-operator.yaml \
| sed -e "s/RUNTIME_COMPONENT_WATCH_NAMESPACE/${WATCH_NAMESPACE}/" \
| kubectl apply -n ${OPERATOR_NAMESPACE} -f -
----

== Uninstallation

To uninstall the operator, run commands from Step 2c first and then Step 2b (if applicable), but after replacing `kubectl apply` with `kubectl delete`.

To delete the CRD, run command from Step 1, but after replacing `kubectl apply` with `kubectl delete`.

_Deleting the CRD will also delete all instances of `RuntimeComponent` and `RuntimeOperation` in the cluster_
5,911 changes: 5,911 additions & 0 deletions deploy/releases/0.8.2/kubectl/runtime-component-crd.yaml

Large diffs are not rendered by default.

237 changes: 237 additions & 0 deletions deploy/releases/0.8.2/kubectl/runtime-component-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/managed-by: olm
app.kubernetes.io/name: runtime-component-operator
name: rco-controller-manager
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/managed-by: olm
app.kubernetes.io/name: runtime-component-operator
name: rco-leader-election-role
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/managed-by: olm
app.kubernetes.io/name: runtime-component-operator
name: rco-manager-role
rules:
- apiGroups:
- apps
resources:
- deployments
- statefulsets
verbs:
- '*'
- apiGroups:
- apps
resources:
- deployments/finalizers
- statefulsets
verbs:
- update
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- '*'
- apiGroups:
- ""
resources:
- configmaps
- secrets
- serviceaccounts
- services
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods
- pods/exec
verbs:
- '*'
- apiGroups:
- image.openshift.io
resources:
- imagestreams
- imagestreamtags
verbs:
- get
- list
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- '*'
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- '*'
- apiGroups:
- rc.app.stacks
resources:
- runtimecomponents
- runtimecomponents/finalizers
- runtimecomponents/status
verbs:
- '*'
- apiGroups:
- rc.app.stacks
resources:
- runtimeoperations
- runtimeoperations/finalizers
- runtimeoperations/status
verbs:
- '*'
- apiGroups:
- route.openshift.io
resources:
- routes
- routes/custom-host
verbs:
- '*'
- apiGroups:
- serving.knative.dev
resources:
- services
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/managed-by: olm
app.kubernetes.io/name: runtime-component-operator
name: rco-leader-election-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: rco-leader-election-role
subjects:
- kind: ServiceAccount
name: rco-controller-manager
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/managed-by: olm
app.kubernetes.io/name: runtime-component-operator
name: rco-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: rco-manager-role
subjects:
- kind: ServiceAccount
name: rco-controller-manager
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/managed-by: olm
app.kubernetes.io/name: runtime-component-operator
control-plane: controller-manager
name: rco-controller-manager
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/managed-by: olm
app.kubernetes.io/name: runtime-component-operator
control-plane: controller-manager
template:
metadata:
labels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/managed-by: olm
app.kubernetes.io/name: runtime-component-operator
control-plane: controller-manager
spec:
containers:
- args:
- --enable-leader-election
command:
- /manager
env:
- name: OPERATOR_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: WATCH_NAMESPACE
value: RUNTIME_COMPONENT_WATCH_NAMESPACE
image: applicationstacks/operator:0.8.2
imagePullPolicy: Always
name: manager
resources:
limits:
cpu: 200m
memory: 512Mi
requests:
cpu: 100m
memory: 64Mi
serviceAccountName: rco-controller-manager
terminationGracePeriodSeconds: 10
Loading