Skip to content

Commit

Permalink
provided manifest installation without webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk committed Nov 14, 2024
1 parent 593d523 commit 90a2369
Show file tree
Hide file tree
Showing 15 changed files with 212 additions and 154 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
echo ${{secrets.REPO_KEY}} | docker login --username ${{secrets.REPO_USER}} --password-stdin
make publish
TAG=${TAG} make olm
gh release upload ${{github.event.release.tag_name}} ./dist/install.yaml#install.yaml --clobber || echo "fix me NOT enough security permissions"
gh release upload ${{github.event.release.tag_name}} ./dist/install-no-webhook.yaml#install-no-webhook.yaml --clobber || echo "fix me NOT enough security permissions"
gh release upload ${{github.event.release.tag_name}} ./dist/install-with-webhook.yaml#install-with-webhook.yaml --clobber || echo "fix me NOT enough security permissions"
gh release upload ${{github.event.release.tag_name}} ./config/crd/overlay/crd.yaml#crd.yaml --clobber || echo "fix me NOT enough security permissions"
- name: Prapare binary cache
uses: actions/cache@v4
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ publish:
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
mkdir -p dist
cd config/manager && $(KUSTOMIZE) edit set image manager=$(REGISTRY)/$(ORG)/$(REPO):$(TAG)
$(KUSTOMIZE) build config/base > dist/install.yaml
$(KUSTOMIZE) build config/default > dist/install-no-webhook.yaml
$(KUSTOMIZE) build config/base-with-webhook > dist/install-with-webhook.yaml

olm: operator-sdk opm yq docs
rm -rf bundle*
Expand Down Expand Up @@ -289,7 +290,7 @@ kustomize-set-annotation:
cd $(OVERLAY) && \
$(KUSTOMIZE) edit set annotation $(ANNOTATION)

deploy-kind: OVERLAY=config/base
deploy-kind: OVERLAY=config/base-with-webhook
deploy-kind: REGISTRY=localhost:$(LOCAL_REGISTRY_PORT)
deploy-kind: load-kind docker-push deploy

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace: vm
namePrefix: vm-
resources:
- ../default
- ../default-with-webhook
patches:
- path: manager_webhook_patch.yaml
target:
Expand Down
File renamed without changes.
108 changes: 108 additions & 0 deletions config/default-with-webhook/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
namespace: vm
namePrefix: vm-
resources:
- ../default
- ../webhook
- ../certmanager
patches:
- path: manager_webhook_patch.yaml
target:
kind: Deployment
- path: webhookcainjection_patch.yaml

# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
# - select:
# kind: MutatingWebhookConfiguration
# fieldPaths:
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
# options:
# delimiter: '/'
# index: 0
# create: true
# - select:
# kind: MutatingWebhookConfiguration
# fieldPaths:
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
# options:
# delimiter: '/'
# index: 1
# create: true
replacements:
- source:
fieldPath: .metadata.namespace
group: cert-manager.io
kind: Certificate
name: vm-serving-cert
version: v1
targets:
- fieldPaths:
- .metadata.annotations.[cert-manager.io/inject-ca-from]
options:
create: true
delimiter: /
select:
kind: ValidatingWebhookConfiguration
- fieldPaths:
- .metadata.annotations.[cert-manager.io/inject-ca-from]
options:
create: true
delimiter: /
select:
kind: CustomResourceDefinition
- source:
fieldPath: .metadata.name
group: cert-manager.io
kind: Certificate
name: vm-serving-cert
version: v1
targets:
- fieldPaths:
- .metadata.annotations.[cert-manager.io/inject-ca-from]
options:
create: true
delimiter: /
index: 1
select:
kind: ValidatingWebhookConfiguration
- fieldPaths:
- .metadata.annotations.[cert-manager.io/inject-ca-from]
options:
create: true
delimiter: /
index: 1
select:
kind: CustomResourceDefinition
- source:
fieldPath: .metadata.name
kind: Service
name: webhook-service
version: v1
targets:
- fieldPaths:
- .spec.dnsNames.0
- .spec.dnsNames.1
options:
create: true
delimiter: .
select:
group: cert-manager.io
kind: Certificate
version: v1
- source:
fieldPath: .metadata.namespace
kind: Service
name: webhook-service
version: v1
targets:
- fieldPaths:
- .spec.dnsNames.0
- .spec.dnsNames.1
options:
create: true
delimiter: .
index: 1
select:
group: cert-manager.io
kind: Certificate
version: v1
File renamed without changes.
104 changes: 0 additions & 104 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,114 +1,10 @@
namespace: vm
namePrefix: vm-
resources:
- ../crd/overlay
- ../rbac
- ../manager
- ../webhook
- ../certmanager
- metrics_service.yaml
patches:
- path: manager_webhook_patch.yaml
target:
kind: Deployment
- path: webhookcainjection_patch.yaml
- path: manager_metrics_patch.yaml
target:
kind: Deployment

# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
# - select:
# kind: MutatingWebhookConfiguration
# fieldPaths:
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
# options:
# delimiter: '/'
# index: 0
# create: true
# - select:
# kind: MutatingWebhookConfiguration
# fieldPaths:
# - .metadata.annotations.[cert-manager.io/inject-ca-from]
# options:
# delimiter: '/'
# index: 1
# create: true
replacements:
- source:
fieldPath: .metadata.namespace
group: cert-manager.io
kind: Certificate
name: vm-serving-cert
version: v1
targets:
- fieldPaths:
- .metadata.annotations.[cert-manager.io/inject-ca-from]
options:
create: true
delimiter: /
select:
kind: ValidatingWebhookConfiguration
- fieldPaths:
- .metadata.annotations.[cert-manager.io/inject-ca-from]
options:
create: true
delimiter: /
select:
kind: CustomResourceDefinition
- source:
fieldPath: .metadata.name
group: cert-manager.io
kind: Certificate
name: vm-serving-cert
version: v1
targets:
- fieldPaths:
- .metadata.annotations.[cert-manager.io/inject-ca-from]
options:
create: true
delimiter: /
index: 1
select:
kind: ValidatingWebhookConfiguration
- fieldPaths:
- .metadata.annotations.[cert-manager.io/inject-ca-from]
options:
create: true
delimiter: /
index: 1
select:
kind: CustomResourceDefinition
- source:
fieldPath: .metadata.name
kind: Service
name: webhook-service
version: v1
targets:
- fieldPaths:
- .spec.dnsNames.0
- .spec.dnsNames.1
options:
create: true
delimiter: .
select:
group: cert-manager.io
kind: Certificate
version: v1
- source:
fieldPath: .metadata.namespace
kind: Service
name: webhook-service
version: v1
targets:
- fieldPaths:
- .spec.dnsNames.0
- .spec.dnsNames.1
options:
create: true
delimiter: .
index: 1
select:
group: cert-manager.io
kind: Certificate
version: v1
2 changes: 1 addition & 1 deletion config/kind/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resources:
- ../default
- ../default-with-webhook

patches:
- target:
Expand Down
6 changes: 6 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
resources:
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: manager
newName: docker.io/victoriametrics/operator
newTag: heads-master-0-g593d5237-dirty-81d89e27
Loading

0 comments on commit 90a2369

Please sign in to comment.