Skip to content

Commit

Permalink
add a operator.yaml with no webhooks
Browse files Browse the repository at this point in the history
Signed-off-by: Spolti <[email protected]>
  • Loading branch information
spolti committed Sep 1, 2023
1 parent 9950427 commit 2a90da0
Show file tree
Hide file tree
Showing 11 changed files with 6,808 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ undeploy: uninstall-cert-manager ## Undeploy controller from the K8s cluster spe
generate-deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default > operator.yaml
$(KUSTOMIZE) build config/default-no-webhooks > operator-no-webhooks.yaml

##@ Build Dependencies

Expand Down
358 changes: 358 additions & 0 deletions config/crd-no-webhooks/bases/sonataflow.org_sonataflowbuilds.yaml

Large diffs are not rendered by default.

480 changes: 480 additions & 0 deletions config/crd-no-webhooks/bases/sonataflow.org_sonataflowplatforms.yaml

Large diffs are not rendered by default.

2,215 changes: 2,215 additions & 0 deletions config/crd-no-webhooks/bases/sonataflow.org_sonataflows.yaml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions config/crd-no-webhooks/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This kustomization.yaml is not intended to be run by itself,
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/sonataflow.org_sonataflows.yaml
- bases/sonataflow.org_sonataflowbuilds.yaml
- bases/sonataflow.org_sonataflowplatforms.yaml
#+kubebuilder:scaffold:crdkustomizeresource


# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml
19 changes: 19 additions & 0 deletions config/crd-no-webhooks/kustomizeconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is for teaching kustomize how to substitute name and namespace reference in CRD
nameReference:
- kind: Service
version: v1
fieldSpecs:
- kind: CustomResourceDefinition
version: v1
group: apiextensions.k8s.io
path: spec/conversion/webhook/clientConfig/service/name

namespace:
- kind: CustomResourceDefinition
version: v1
group: apiextensions.k8s.io
path: spec/conversion/webhook/clientConfig/service/namespace
create: false

varReference:
- path: metadata/annotations
30 changes: 30 additions & 0 deletions config/default-no-webhooks/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Adds namespace to all resources.
namespace: sonataflow-operator-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: sonataflow-operator-

# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue

bases:
- ../crd-no-webhooks
- ../rbac
- ../manager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml

# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
#- manager_config_patch.yaml
42 changes: 42 additions & 0 deletions config/default-no-webhooks/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This patch inject a sidecar container which is a HTTP proxy for the
# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: kube-rbac-proxy
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
- "--logtostderr=true"
- "--v=0"
ports:
- containerPort: 8443
protocol: TCP
name: https
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
- name: manager
args:
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
- "--v=0"
20 changes: 20 additions & 0 deletions config/default-no-webhooks/manager_config_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
args:
- "--config=controller_manager_config.yaml"
volumeMounts:
- name: manager-config
mountPath: /controller_manager_config.yaml
subPath: controller_manager_config.yaml
volumes:
- name: manager-config
configMap:
name: manager-config
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ patchesJson6902:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: ENABLE_WEBHOOKS
value: "true"
# - name: ENABLE_WEBHOOKS
# value: "true"
target:
group: apps
kind: Deployment
Expand Down
Loading

0 comments on commit 2a90da0

Please sign in to comment.