Add ability to override namespace when running make deploy

This commit is contained in:
Shane McDonald
2021-09-29 15:31:19 -04:00
parent aa969e2a93
commit d9fbda5e15
4 changed files with 32 additions and 35 deletions

View File

@@ -37,6 +37,7 @@ BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
# Image URL to use all building/pushing image targets # Image URL to use all building/pushing image targets
IMG ?= $(IMAGE_TAG_BASE):$(VERSION) IMG ?= $(IMAGE_TAG_BASE):$(VERSION)
NAMESPACE ?= awx
all: docker-build all: docker-build
@@ -77,6 +78,7 @@ uninstall: kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube
deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
cd config/default && $(KUSTOMIZE) edit set namespace ${NAMESPACE}
$(KUSTOMIZE) build config/default | kubectl apply -f - $(KUSTOMIZE) build config/default | kubectl apply -f -
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.

View File

@@ -1,6 +1,5 @@
---
# Adds namespace to all resources. # Adds namespace to all resources.
namespace: awx-operator-system namespace: awx
# Value of this field is prepended to the # Value of this field is prepended to the
# names of all resources, e.g. a deployment named # names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress". # "wordpress" becomes "alices-wordpress".
@@ -10,18 +9,16 @@ namePrefix: awx-operator-
# Labels to add to all resources and selectors. # Labels to add to all resources and selectors.
# commonLabels: # commonLabels:
# someName: someValue # someName: someValue
bases:
- ../crd
- ../rbac
- ../manager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
# - ../prometheus # - ../prometheus
patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth. # Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics # If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line. # endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml patchesStrategicMerge:
- manager_auth_proxy_patch.yaml
# Mount the controller config file for loading manager configurations apiVersion: kustomize.config.k8s.io/v1beta1
# through a ComponentConfig type kind: Kustomization
# - manager_config_patch.yaml resources:
- ../crd
- ../rbac
- ../manager

View File

@@ -1,15 +1,14 @@
---
resources: resources:
- manager.yaml - manager.yaml
generatorOptions: generatorOptions:
disableNameSuffixHash: true disableNameSuffixHash: true
configMapGenerator: configMapGenerator:
- files: - files:
- controller_manager_config.yaml - controller_manager_config.yaml
name: manager-config name: manager-config
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
images: images:
- name: controller - name: controller
newName: quay.io/shanemcd/awx-operator newName: quay.io/ansible/awx-operator
newTag: 0.0.1 newTag: 0.14.0

View File

@@ -1,4 +1,3 @@
---
apiVersion: operators.coreos.com/v1beta1 apiVersion: operators.coreos.com/v1beta1
kind: ClusterServiceVersion kind: ClusterServiceVersion
metadata: metadata:
@@ -13,27 +12,27 @@ spec:
description: An operator for the AWX Project description: An operator for the AWX Project
displayName: AWX displayName: AWX
icon: icon:
- base64data: "" - base64data: ""
mediatype: "" mediatype: ""
install: install:
spec: spec:
deployments: null deployments: null
strategy: "" strategy: ""
installModes: installModes:
- supported: false - supported: true
type: OwnNamespace type: OwnNamespace
- supported: false - supported: true
type: SingleNamespace type: SingleNamespace
- supported: false - supported: true
type: MultiNamespace type: MultiNamespace
- supported: true - supported: false
type: AllNamespaces type: AllNamespaces
keywords: keywords:
- automation - automation
- ansible - ansible
links: links:
- name: Awx Operator - name: Awx Operator
url: https://awx-operator.domain url: https://awx-operator.domain
maturity: alpha maturity: alpha
provider: provider:
name: Ansible name: Ansible