mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-27 05:43:11 +00:00
Move to a per-namespace deployment approach
* This increases security, the awx-operator SA has less cluster-wide
access
* This means one operator can only deploy to a single namespace
* If AWX deployments are needed in multiple namespaces, multiple
awx-operators can be deployed to accomplish this.
Signed-off-by: Christian M. Adams <chadams@redhat.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
- name: Deploy Operator
|
- name: Deploy Operator
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
vars:
|
vars:
|
||||||
k8s_namespace: "default"
|
k8s_namespace: "{{ namespace | default('default') }}"
|
||||||
obliterate: no
|
obliterate: no
|
||||||
|
|
||||||
collections:
|
collections:
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ spec:
|
|||||||
- mountPath: /tmp/ansible-operator/runner
|
- mountPath: /tmp/ansible-operator/runner
|
||||||
name: runner
|
name: runner
|
||||||
env:
|
env:
|
||||||
# Watch all namespaces (cluster-scoped).
|
# Watch one namespace (namespace-scoped).
|
||||||
- name: WATCH_NAMESPACE
|
- name: WATCH_NAMESPACE
|
||||||
value: ""
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.namespace
|
||||||
- name: POD_NAME
|
- name: POD_NAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRole
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
@@ -95,7 +95,6 @@ rules:
|
|||||||
- replicasets
|
- replicasets
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
verbs:
|
|
||||||
- create
|
- create
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- awx.ansible.com
|
- awx.ansible.com
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
---
|
---
|
||||||
kind: ClusterRoleBinding
|
kind: RoleBinding
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
namespace: default
|
|
||||||
roleRef:
|
roleRef:
|
||||||
kind: ClusterRole
|
kind: Role
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
|||||||
@@ -3,4 +3,3 @@ apiVersion: v1
|
|||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
namespace: default
|
|
||||||
|
|||||||
@@ -610,7 +610,7 @@ spec:
|
|||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRole
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
@@ -705,7 +705,6 @@ rules:
|
|||||||
- replicasets
|
- replicasets
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
verbs:
|
|
||||||
- create
|
- create
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- awx.ansible.com
|
- awx.ansible.com
|
||||||
@@ -717,16 +716,15 @@ rules:
|
|||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: ClusterRoleBinding
|
kind: RoleBinding
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
namespace: default
|
|
||||||
roleRef:
|
roleRef:
|
||||||
kind: ClusterRole
|
kind: Role
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
|
||||||
@@ -735,7 +733,6 @@ apiVersion: v1
|
|||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
name: awx-operator
|
name: awx-operator
|
||||||
namespace: default
|
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -761,9 +758,11 @@ spec:
|
|||||||
- mountPath: /tmp/ansible-operator/runner
|
- mountPath: /tmp/ansible-operator/runner
|
||||||
name: runner
|
name: runner
|
||||||
env:
|
env:
|
||||||
# Watch all namespaces (cluster-scoped).
|
# Watch one namespace (namespace-scoped).
|
||||||
- name: WATCH_NAMESPACE
|
- name: WATCH_NAMESPACE
|
||||||
value: ""
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.namespace
|
||||||
- name: POD_NAME
|
- name: POD_NAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
|
|||||||
@@ -755,11 +755,11 @@ spec:
|
|||||||
installModes:
|
installModes:
|
||||||
- supported: true
|
- supported: true
|
||||||
type: OwnNamespace
|
type: OwnNamespace
|
||||||
- supported: true
|
- supported: false
|
||||||
type: SingleNamespace
|
type: SingleNamespace
|
||||||
- supported: false
|
- supported: false
|
||||||
type: MultiNamespace
|
type: MultiNamespace
|
||||||
- supported: true
|
- supported: false
|
||||||
type: AllNamespaces
|
type: AllNamespaces
|
||||||
keywords:
|
keywords:
|
||||||
- awx
|
- awx
|
||||||
|
|||||||
@@ -26,4 +26,4 @@ provisioner:
|
|||||||
inventory:
|
inventory:
|
||||||
group_vars:
|
group_vars:
|
||||||
all:
|
all:
|
||||||
operator_namespace: ${TEST_NAMESPACE:-default}
|
operator_namespace: ${TEST_NAMESPACE:-example-awx}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ provisioner:
|
|||||||
inventory:
|
inventory:
|
||||||
group_vars:
|
group_vars:
|
||||||
all:
|
all:
|
||||||
operator_namespace: ${TEST_NAMESPACE:-default}
|
operator_namespace: ${TEST_NAMESPACE:-example-awx}
|
||||||
env:
|
env:
|
||||||
ANSIBLE_ROLES_PATH: ${MOLECULE_PROJECT_DIRECTORY}/roles
|
ANSIBLE_ROLES_PATH: ${MOLECULE_PROJECT_DIRECTORY}/roles
|
||||||
scenario:
|
scenario:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
### Don't run this deployment in production
|
### Don't run this deployment in production
|
||||||
### The current configuration will run the
|
### The current configuration will run the
|
||||||
### OKD console without any autentication!!!!
|
### OKD console without any authentication!!!!
|
||||||
###
|
###
|
||||||
### A prerequisite is to install the OLM
|
### A prerequisite is to install the OLM
|
||||||
### as instructed at https://olm.operatorframework.io/docs/getting-started/#install-released-olm
|
### as instructed at https://olm.operatorframework.io/docs/getting-started/#install-released-olm
|
||||||
|
|||||||
Reference in New Issue
Block a user