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

Replace default namespace to runtime-component for kustomize artifacts #532

Merged
merged 1 commit into from
May 3, 2023
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ endif
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:crdVersions=v1,generateEmbeddedObjectMeta=true"

# Produce files under internal/deploy/kustomize/daily with default namespace
KUSTOMIZE_NAMESPACE = default
# Produce files under internal/deploy/kustomize/daily with runtime-component namespace
KUSTOMIZE_NAMESPACE = runtime-component
KUSTOMIZE_IMG = icr.io/appcafe/runtime-component-operator:daily

# Use docker if available. Otherwise default to podman.
Expand Down
2 changes: 1 addition & 1 deletion config/kustomize/operator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resources:
- ../../manager

# Adds namespace to all resources.
namespace: default
namespace: runtime-component
namePrefix: rco-

# Labels to add to all resources and selectors.
Expand Down
2 changes: 1 addition & 1 deletion config/kustomize/roles/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resources:
- ../../rbac

# Adds namespace to all resources.
namespace: default
namespace: runtime-component
namePrefix: rco-

# Labels to add to all resources and selectors.
Expand Down
57 changes: 28 additions & 29 deletions internal/deploy/kustomize/1.2.0/README.adoc
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
= Installing the Runtime Component Operator using kustomize

This directory contains kustomize files that can be used to install the operator
in your cluster in various different configurations, and also some example overlays
which show how the installation can be customized.
This directory contains configuration files that helps installing the Runtime Component operator
using `kustomize` with the Kubernetes command-line interface (CLI) (`kubectl`). These configurations
are useful when the cluster is not a Red Hat® OpenShift® Container Platform cluster or when
Operator Lifecycle Manager is not being used.

== Install and watch own namespace
== Installing and watching own namespace

=== base
The simplest configuration will install the operator into the 'default' namespace, and the operator
will watch for Runtime Component custom resource instances only in its own namespace. To install, run:
`kubectl create -k base`
and to uninstall, run:
`kubectl delete -k base`
The base configuration installs the operator into the 'runtime-component' namespace,
and the operator watches for Runtime Component custom resource instances only in its own namespace.
Create a namespace called 'runtime-component' for the operator.
To install, run: `kubectl create -k base` and to uninstall, run: `kubectl delete -k base`

=== examples/watch-own-namespace
This example overlay demonstrates how to modify the base configuration to install/watch a
namespace other than 'default'. The example installs the operator to a namespace called
'rco-ns' which should already exist. To install, run `kubectl create -k examples/watch-own-namespace`
This example overlay demonstrates how to modify the base configuration to install the operator and have it
watch a namespace other than 'runtime-component'. Create a namespace called 'rco-ns' for the operator.
To install the operator into the 'rco-ns' namespace, run: `kubectl create -k examples/watch-own-namespace`

== Install and watch another namespace
== Installing and watching another namespace

=== overlays/watch-another-namespace
This overlay installs the operator into the namespace 'rco-ns', but configures it to
watch for Runtime Component custom resource instances in a different namespace called 'rco-watched-ns'. As
this overlay install resources into two different namespaces, the namespace must not be specified
in the kustomize.yaml file. To install, run `kubectl create -k overlays/watch-another-namespace`
watch for Runtime Component custom resource instances in a different namespace called 'rco-watched-ns'.
Because this overlay installs resources into two different namespaces, the namespace must not be specified
in the kustomize.yaml file. To install, run: `kubectl create -k overlays/watch-another-namespace`

=== examples/watch-another-namespace
This example overlay builds on the previous one, but demonstrates how to change the
install and watched namespaces. In this case, the operator is installed into 'rco-ns2'
and it will watch for resources in 'rco-watched-ns2'. To install run `kubectl create -k
This example overlay builds on the previous example, but demonstrates how to change
the install and watched namespaces. In this case, the operator is installed into 'rco-ns2'
and watches for resources in 'rco-watched-ns2'. To install run: `kubectl create -k
examples/watch-another-namespace`

== Install and watch all namespaces
== Installing and watching all namespaces

=== overlays/watch-all-namespaces
This overlay installs the operator into the default namespace, but configures it
to watch for Runtime Component custom resource instances in any namespace. Compared to the base,
this requires additional ClusterRoles and ClusterRoleBindings. To install run:
`kubectl create -k overlays/watch-all-namespaces`
This overlay installs the operator into the 'runtime-component' namespace,
but configures it to watch for Runtime Component custom resource instances in any namespaces.
Compared to the base configuration, this overlay requires additional ClusterRoles and ClusterRoleBindings.
To install, run: `kubectl create -k overlays/watch-all-namespaces`

=== examples/watch-all-namespaces
This example overlay builds on the previous one, and demonstrates how to change
which namespace the operator is installed into. In this example, the operator
is installed into a namespace called 'rco-ns', and will still watch for
Runtime Component custom resource instances in any namespace. To install, run:
`kubectl create -k examples/watch-all-namespaces`
This example overlay builds on the previous example and demonstrates how to change
the namespace that the operator installs into. In this example, the operator installs
into a namespace that is called 'rco-ns' and watches for Runtime Component custom resource
instances in any namespaces. To install, run: `kubectl create -k examples/watch-all-namespaces`
2 changes: 1 addition & 1 deletion internal/deploy/kustomize/1.2.0/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: default
namespace: runtime-component

resources:
- runtime-component-crd.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
app.kubernetes.io/name: runtime-component-operator
control-plane: controller-manager
name: rco-controller-manager
namespace: default
namespace: runtime-component
spec:
replicas: 1
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/name: runtime-component-operator
name: rco-controller-manager
namespace: default
namespace: runtime-component
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand All @@ -14,7 +14,7 @@ metadata:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/name: runtime-component-operator
name: rco-leader-election-role
namespace: default
namespace: runtime-component
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -64,7 +64,7 @@ metadata:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/name: runtime-component-operator
name: rco-manager-role
namespace: default
namespace: runtime-component
rules:
- apiGroups:
- apps
Expand Down Expand Up @@ -234,15 +234,15 @@ metadata:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/name: runtime-component-operator
name: rco-leader-election-rolebinding
namespace: default
namespace: runtime-component
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: rco-leader-election-role
subjects:
- kind: ServiceAccount
name: rco-controller-manager
namespace: default
namespace: runtime-component
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand All @@ -251,12 +251,12 @@ metadata:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/name: runtime-component-operator
name: rco-manager-rolebinding
namespace: default
namespace: runtime-component
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: rco-manager-role
subjects:
- kind: ServiceAccount
name: rco-controller-manager
namespace: default
namespace: runtime-component
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: rco-controller-manager
namespace: default
namespace: runtime-component
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -254,5 +254,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: rco-controller-manager
namespace: default
namespace: runtime-component
---
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: default
namespace: runtime-component

bases:
- ../../base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: rco-controller-manager
namespace: runtime-component
spec:
template:
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: rco-controller-manager
namespace: default
namespace: runtime-component
spec:
template:
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: rco-leader-election-role
namespace: default
namespace: runtime-component
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: rco-manager-role
namespace: default
namespace: runtime-component
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: rco-leader-election-rolebinding
namespace: default
namespace: runtime-component
subjects:
- kind: ServiceAccount
name: rco-controller-manager
namespace: default
namespace: runtime-component
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: rco-manager-rolebinding
namespace: default
namespace: runtime-component
subjects:
- kind: ServiceAccount
name: rco-controller-manager
namespace: default
namespace: runtime-component
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: rco-controller-manager
namespace: default
namespace: runtime-component
57 changes: 28 additions & 29 deletions internal/deploy/kustomize/daily/README.adoc
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
= Installing the Runtime Component Operator using kustomize

This directory contains kustomize files that can be used to install the operator
in your cluster in various different configurations, and also some example overlays
which show how the installation can be customized.
This directory contains configuration files that helps installing the Runtime Component operator
using `kustomize` with the Kubernetes command-line interface (CLI) (`kubectl`). These configurations
are useful when the cluster is not a Red Hat® OpenShift® Container Platform cluster or when
Operator Lifecycle Manager is not being used.

== Install and watch own namespace
== Installing and watching own namespace

=== base
The simplest configuration will install the operator into the 'default' namespace, and the operator
will watch for Runtime Component custom resource instances only in its own namespace. To install, run:
`kubectl create -k base`
and to uninstall, run:
`kubectl delete -k base`
The base configuration installs the operator into the 'runtime-component' namespace,
and the operator watches for Runtime Component custom resource instances only in its own namespace.
Create a namespace called 'runtime-component' for the operator.
To install, run: `kubectl create -k base` and to uninstall, run: `kubectl delete -k base`

=== examples/watch-own-namespace
This example overlay demonstrates how to modify the base configuration to install/watch a
namespace other than 'default'. The example installs the operator to a namespace called
'rco-ns' which should already exist. To install, run `kubectl create -k examples/watch-own-namespace`
This example overlay demonstrates how to modify the base configuration to install the operator and have it
watch a namespace other than 'runtime-component'. Create a namespace called 'rco-ns' for the operator.
To install the operator into the 'rco-ns' namespace, run: `kubectl create -k examples/watch-own-namespace`

== Install and watch another namespace
== Installing and watching another namespace

=== overlays/watch-another-namespace
This overlay installs the operator into the namespace 'rco-ns', but configures it to
watch for Runtime Component custom resource instances in a different namespace called 'rco-watched-ns'. As
this overlay install resources into two different namespaces, the namespace must not be specified
in the kustomize.yaml file. To install, run `kubectl create -k overlays/watch-another-namespace`
watch for Runtime Component custom resource instances in a different namespace called 'rco-watched-ns'.
Because this overlay installs resources into two different namespaces, the namespace must not be specified
in the kustomize.yaml file. To install, run: `kubectl create -k overlays/watch-another-namespace`

=== examples/watch-another-namespace
This example overlay builds on the previous one, but demonstrates how to change the
install and watched namespaces. In this case, the operator is installed into 'rco-ns2'
and it will watch for resources in 'rco-watched-ns2'. To install run `kubectl create -k
This example overlay builds on the previous example, but demonstrates how to change
the install and watched namespaces. In this case, the operator is installed into 'rco-ns2'
and watches for resources in 'rco-watched-ns2'. To install run: `kubectl create -k
examples/watch-another-namespace`

== Install and watch all namespaces
== Installing and watching all namespaces

=== overlays/watch-all-namespaces
This overlay installs the operator into the default namespace, but configures it
to watch for Runtime Component custom resource instances in any namespace. Compared to the base,
this requires additional ClusterRoles and ClusterRoleBindings. To install run:
`kubectl create -k overlays/watch-all-namespaces`
This overlay installs the operator into the 'runtime-component' namespace,
but configures it to watch for Runtime Component custom resource instances in any namespaces.
Compared to the base configuration, this overlay requires additional ClusterRoles and ClusterRoleBindings.
To install, run: `kubectl create -k overlays/watch-all-namespaces`

=== examples/watch-all-namespaces
This example overlay builds on the previous one, and demonstrates how to change
which namespace the operator is installed into. In this example, the operator
is installed into a namespace called 'rco-ns', and will still watch for
Runtime Component custom resource instances in any namespace. To install, run:
`kubectl create -k examples/watch-all-namespaces`
This example overlay builds on the previous example and demonstrates how to change
the namespace that the operator installs into. In this example, the operator installs
into a namespace that is called 'rco-ns' and watches for Runtime Component custom resource
instances in any namespaces. To install, run: `kubectl create -k examples/watch-all-namespaces`
2 changes: 1 addition & 1 deletion internal/deploy/kustomize/daily/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: default
namespace: runtime-component

resources:
- runtime-component-crd.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
app.kubernetes.io/name: runtime-component-operator
control-plane: controller-manager
name: rco-controller-manager
namespace: default
namespace: runtime-component
spec:
replicas: 1
selector:
Expand Down
Loading