Skip to content

Commit

Permalink
update url and handling restarting of pods better
Browse files Browse the repository at this point in the history
  • Loading branch information
STollenaar committed Apr 27, 2024
1 parent a71cd43 commit 0fd6b73
Show file tree
Hide file tree
Showing 30 changed files with 158 additions and 69 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
uses: sigstore/cosign-installer@v3.5.0 #v3.5.0
with:
cosign-release: 'v2.1.1'
cosign-release: 'v2.2.4'

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
# This variable is used to construct full image tags for bundle and catalog images.
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
# spices.dev/cm-injector-operator-bundle:$VERSION and spices.dev/cm-injector-operator-catalog:$VERSION.
# spicedelver.me/cm-injector-operator-bundle:$VERSION and spicedelver.me/cm-injector-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= public.ecr.aws/x4a1o1q2/cmstate-operator

# BUNDLE_IMG defines the image:tag used for the bundle.
Expand Down
8 changes: 4 additions & 4 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: spices.dev
domain: spicedelver.me
layout:
- go.kubebuilder.io/v3
plugins:
Expand All @@ -15,7 +15,7 @@ resources:
crdVersion: v1
namespaced: true
controller: true
domain: spices.dev
domain: spicedelver.me
group: cache
kind: CMState
path: github.com/stollenaar/cmstate-injector-operator/api/v1alpha1
Expand All @@ -33,7 +33,7 @@ resources:
- api:
crdVersion: v1
namespaced: true
domain: spices.dev
domain: spicedelver.me
group: core
kind: Pod
path: github.com/stollenaar/cmstate-injector-operator/api/v1
Expand All @@ -45,7 +45,7 @@ resources:
crdVersion: v1
namespaced: true
controller: true
domain: spices.dev
domain: spicedelver.me
group: cache
kind: CMTemplate
path: github.com/stollenaar/cmstate-injector-operator/api/v1alpha1
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

- **Reconcile Loop:** The operator performs reconciliation for `CMState` and `CMTemplate` CRDs, ensuring that the ConfigMap state aligns with the desired specifications.

- **Mutating Webhook:** Triggered on Pod creation and deletion, the mutating webhook watches for a specific annotation, `cache.spices.dev/cmtemplate`, targeting a valid and created `CMTemplate`.
- **Mutating Webhook:** Triggered on Pod creation and deletion, the mutating webhook watches for a specific annotation, `cache.spicedelver.me/cmtemplate`, targeting a valid and created `CMTemplate`.

## Getting Started

Expand Down Expand Up @@ -80,7 +80,7 @@ Alternatively, you can deploy the operator using the Helm chart located in the `
1. Define a `CMTemplate` to specify the template for your ConfigMap:

```yaml
apiVersion: cache.spices.dev/v1alpha1
apiVersion: cache.spicedelver.me/v1alpha1
kind: CMTemplate
metadata:
name: cmtemplate-example
Expand All @@ -98,7 +98,7 @@ Alternatively, you can deploy the operator using the Helm chart located in the `
2. Create a `CMState` to track ConfigMap usage:

```yaml
apiVersion: cache.spices.dev/v1alpha1
apiVersion: cache.spicedelver.me/v1alpha1
kind: CMState
metadata:
name: cmstate-example
Expand All @@ -116,7 +116,7 @@ Alternatively, you can deploy the operator using the Helm chart located in the `
```yaml
metadata:
annotations:
cache.spices.dev/cmtemplate: cmtemplate-example
cache.spicedelver.me/cmtemplate: cmtemplate-example
```

## Contributing
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

// Package v1alpha1 contains API Schema definitions for the cache v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=cache.spices.dev
// +groupName=cache.spicedelver.me
package v1alpha1

import (
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "cache.spices.dev", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "cache.spicedelver.me", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
4 changes: 2 additions & 2 deletions charts/cmstate-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.3
version: 0.3.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.3"
appVersion: "0.3.0"
4 changes: 2 additions & 2 deletions charts/cmstate-operator/templates/cmstate-crd.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: cmstates.cache.spices.dev
name: cmstates.cache.spicedelver.me
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
labels:
{{- if or .Values.global.labels }}
{{ toYaml .Values.global.labels | nindent 4 }}
{{- end }}
spec:
group: cache.spices.dev
group: cache.spicedelver.me
names:
kind: CMState
listKind: CMStateList
Expand Down
4 changes: 2 additions & 2 deletions charts/cmstate-operator/templates/cmtemplates-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: cmtemplates.cache.spices.dev
name: cmtemplates.cache.spicedelver.me
spec:
group: cache.spices.dev
group: cache.spicedelver.me
names:
kind: CMTemplate
listKind: CMTemplateList
Expand Down
4 changes: 2 additions & 2 deletions charts/cmstate-operator/templates/mutatingwebhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ metadata:
{{ toYaml .Values.webhook.annotations | nindent 4 }}
{{- end }}
webhooks:
- name: cmstate-operator.spices.dev
- name: cmstate-operator.spicedelver.me
admissionReviewVersions: ["v1"]
sideEffects: None
namespaceSelector:
matchExpressions:
- key: 'cmstate.spices.dev'
- key: 'cmstate.spicedelver.me'
operator: 'NotIn'
values:
- 'opt-out'
Expand Down
10 changes: 5 additions & 5 deletions charts/cmstate-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ rbac:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["create", "delete", "update", "get", "list", "watch"]
- apiGroups: ["cache.spices.dev"]
- apiGroups: ["cache.spicedelver.me"]
resources: ["cmstates"]
verbs: ["create", "delete", "update", "patch", "get", "list", "watch"]
- apiGroups: ["cache.spices.dev"]
- apiGroups: ["cache.spicedelver.me"]
resources: ["cmstates/finalizers"]
verbs: ["update"]
- apiGroups: ["cache.spices.dev"]
- apiGroups: ["cache.spicedelver.me"]
resources: ["cmstates/status"]
verbs: ["get", "patch", "update"]
- apiGroups: ["cache.spices.dev"]
- apiGroups: ["cache.spicedelver.me"]
resources: ["cmtemplates"]
verbs: ["get","list","watch"]
- apiGroups: ["cache.spices.dev"]
- apiGroups: ["cache.spicedelver.me"]
resources: ["cmtemplates/status"]
verbs: ["get"]
4 changes: 2 additions & 2 deletions config/crd/bases/cache.spices.dev_cmstates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: cmstates.cache.spices.dev
name: cmstates.cache.spicedelver.me
spec:
group: cache.spices.dev
group: cache.spicedelver.me
names:
kind: CMState
listKind: CMStateList
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/cache.spices.dev_cmtemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: cmtemplates.cache.spices.dev
name: cmtemplates.cache.spicedelver.me
spec:
group: cache.spices.dev
group: cache.spicedelver.me
names:
kind: CMTemplate
listKind: CMTemplateList
Expand Down
6 changes: 3 additions & 3 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/cache.spices.dev_cmstates.yaml
# - bases/core.spices.dev_pods.yaml
- bases/cache.spices.dev_cmtemplates.yaml
- bases/cache.spicedelver.me_cmstates.yaml
# - bases/core.spicedelver.me_pods.yaml
- bases/cache.spicedelver.me_cmtemplates.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge: []
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_cmstates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: cmstates.cache.spices.dev
name: cmstates.cache.spicedelver.me
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_cmtemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: cmtemplates.cache.spices.dev
name: cmtemplates.cache.spicedelver.me
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_cmtemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: cmstatecreator.cache.spices.dev
name: cmstatecreator.cache.spicedelver.me
spec:
conversion:
strategy: Webhook
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/cmstate_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
name: cmstate-editor-role
rules:
- apiGroups:
- cache.spices.dev
- cache.spicedelver.me
resources:
- cmstates
verbs:
Expand All @@ -24,7 +24,7 @@ rules:
- update
- watch
- apiGroups:
- cache.spices.dev
- cache.spicedelver.me
resources:
- cmstates/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/cmstate_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ metadata:
name: cmstate-viewer-role
rules:
- apiGroups:
- cache.spices.dev
- cache.spicedelver.me
resources:
- cmstates
verbs:
- get
- list
- watch
- apiGroups:
- cache.spices.dev
- cache.spicedelver.me
resources:
- cmstates/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/cmtemplate_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
name: cmtemplate-editor-role
rules:
- apiGroups:
- cache.spices.dev
- cache.spicedelver.me
resources:
- cmtemplates
verbs:
Expand All @@ -24,7 +24,7 @@ rules:
- update
- watch
- apiGroups:
- cache.spices.dev
- cache.spicedelver.me
resources:
- cmtemplates/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/cmtemplate_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ metadata:
name: cmtemplate-viewer-role
rules:
- apiGroups:
- cache.spices.dev
- cache.spicedelver.me
resources:
- cmtemplates
verbs:
- get
- list
- watch
- apiGroups:
- cache.spices.dev
- cache.spicedelver.me
resources:
- cmtemplates/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/pod_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
name: pod-editor-role
rules:
- apiGroups:
- core.spices.dev
- core.spicedelver.me
resources:
- pods
verbs:
Expand All @@ -24,7 +24,7 @@ rules:
- update
- watch
- apiGroups:
- core.spices.dev
- core.spicedelver.me
resources:
- pods/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/pod_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ metadata:
name: pod-viewer-role
rules:
- apiGroups:
- core.spices.dev
- core.spicedelver.me
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- core.spices.dev
- core.spicedelver.me
resources:
- pods/status
verbs:
Expand Down
Loading

0 comments on commit 0fd6b73

Please sign in to comment.