Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Redhat Openshift support #912

Merged
merged 6 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:latest
FROM gcr.io/distroless/static-debian11:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
ENTRYPOINT ["/manager"]
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ spec:
{{- end }}
ports:
{{- if .Values.webhook.enabled }}
- containerPort: {{ .Values.webhook.serverPort | default 443 }}
- containerPort: {{ .Values.webhook.serverPort | default 9443 }}
name: webhook-server
protocol: TCP
{{- end }}
Expand Down
84 changes: 57 additions & 27 deletions charts/kafka-operator/templates/operator-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,63 @@ rules:
- get
- update
- patch
- apiGroups:
- kafka.banzaicloud.io
resources:
- kafkaclusters/finalizers
verbs:
- create
- delete
- patch
- update
- apiGroups:
- kafka.banzaicloud.io
resources:
- kafkausers/finalizers
verbs:
- create
- delete
- patch
- update
- apiGroups:
- kafka.banzaicloud.io
resources:
- kafkatopics/finalizers
verbs:
- create
- delete
- patch
- update
- apiGroups:
- kafka.banzaicloud.io
resources:
- cruisecontroloperations
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- kafka.banzaicloud.io
resources:
- cruisecontroloperations/status
verbs:
- get
- patch
- update
- apiGroups:
- kafka.banzaicloud.io
resources:
- cruisecontroloperations/finalizers
verbs:
- create
- delete
- patch
- update
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -234,33 +291,6 @@ rules:
- patch
- update
- watch
- apiGroups:
- kafka.banzaicloud.io
resources:
- cruisecontroloperations
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- kafka.banzaicloud.io
resources:
- cruisecontroloperations/finalizers
verbs:
- update
- apiGroups:
- kafka.banzaicloud.io
resources:
- cruisecontroloperations/status
verbs:
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
4 changes: 2 additions & 2 deletions charts/kafka-operator/templates/operator-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ spec:
ports:
- name: https
port: 443
targetPort: {{ (.Values.webhook).serverPort | default 443 }}
targetPort: webhook-server
{{- if and .Values.prometheusMetrics.enabled (not .Values.prometheusMetrics.authProxy.enabled) }}
- name: metrics
port: 8080
targetPort: {{ (.Values.metricEndpoint).port | default 8080 }}
targetPort: metrics
{{- end }}
30 changes: 30 additions & 0 deletions config/base/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ rules:
resources:
- cruisecontroloperations/finalizers
verbs:
- create
- delete
- patch
- update
- apiGroups:
- kafka.banzaicloud.io
Expand All @@ -199,6 +202,15 @@ rules:
- patch
- update
- watch
- apiGroups:
- kafka.banzaicloud.io
resources:
- kafkaclusters/finalizers
verbs:
- create
- delete
- patch
- update
- apiGroups:
- kafka.banzaicloud.io
resources:
Expand All @@ -220,6 +232,15 @@ rules:
- patch
- update
- watch
- apiGroups:
- kafka.banzaicloud.io
resources:
- kafkatopics/finalizers
verbs:
- create
- delete
- patch
- update
- apiGroups:
- kafka.banzaicloud.io
resources:
Expand All @@ -241,6 +262,15 @@ rules:
- patch
- update
- watch
- apiGroups:
- kafka.banzaicloud.io
resources:
- kafkausers/finalizers
verbs:
- create
- delete
- patch
- update
- apiGroups:
- kafka.banzaicloud.io
resources:
Expand Down
2 changes: 1 addition & 1 deletion config/base/webhook/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ metadata:
spec:
ports:
- port: 443
targetPort: 443
targetPort: 9443
selector:
control-plane: controller-manager
2 changes: 1 addition & 1 deletion controllers/cruisecontroloperation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type CruiseControlOperationReconciler struct {

// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=cruisecontroloperations,verbs=get;list;watch;create;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=cruisecontroloperations/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=cruisecontroloperations/finalizers,verbs=update
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=cruisecontroloperations/finalizers,verbs=create;update;patch;delete

//nolint:gocyclo
func (r *CruiseControlOperationReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error) {
Expand Down
1 change: 1 addition & 0 deletions controllers/kafkacluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type KafkaClusterReconciler struct {
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=kafkaclusters,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=kafkaclusters/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=kafkaclusters/finalizers,verbs=create;update;patch;delete
// +kubebuilder:rbac:groups=servicemesh.cisco.com,resources=istiomeshgateways,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=networking.istio.io,resources=*,verbs=*

Expand Down
1 change: 1 addition & 0 deletions controllers/kafkatopic_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type KafkaTopicReconciler struct {

// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=kafkatopics,verbs=get;list;watch;create;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=kafkatopics/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=kafkatopics/finalizers,verbs=create;update;patch;delete

// Reconcile reconciles the kafka topic
func (r *KafkaTopicReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
Expand Down
1 change: 1 addition & 0 deletions controllers/kafkauser_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ type KafkaUserReconciler struct {

// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=kafkausers,verbs=get;list;watch;create;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=kafkausers/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=kafka.banzaicloud.io,resources=kafkausers/finalizers,verbs=create;update;patch;delete
// +kubebuilder:rbac:groups=cert-manager.io,resources=certificates,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=cert-manager.io,resources=issuers,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=cert-manager.io,resources=clusterissuers,verbs=get;list;watch;create;update;patch;delete
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/banzaicloud/istio-client-go v0.0.17
github.com/banzaicloud/istio-operator/api/v2 v2.15.1
github.com/banzaicloud/k8s-objectmatcher v1.8.0
github.com/banzaicloud/koperator/api v0.24.0
github.com/banzaicloud/koperator/api v0.25.0
github.com/banzaicloud/koperator/properties v0.4.1
github.com/cert-manager/cert-manager v1.9.1
github.com/cisco-open/cluster-registry-controller/api v0.2.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ github.com/banzaicloud/istio-operator/api/v2 v2.15.1 h1:BZg8COvoOJtfx/dgN7KpoOnc
github.com/banzaicloud/istio-operator/api/v2 v2.15.1/go.mod h1:5qCpwWlIfxiLvBfTvT2mD2wp5RlFCDEt8Xql4sYPNBc=
github.com/banzaicloud/k8s-objectmatcher v1.8.0 h1:Nugn25elKtPMTA2br+JgHNeSQ04sc05MDPmpJnd1N2A=
github.com/banzaicloud/k8s-objectmatcher v1.8.0/go.mod h1:p2LSNAjlECf07fbhDyebTkPUIYnU05G+WfGgkTmgeMg=
github.com/banzaicloud/koperator/api v0.24.0 h1:RwhKWy8umzpKhKEa0J6xgvv5wOU37ti3A9JqIjCHrDk=
github.com/banzaicloud/koperator/api v0.24.0/go.mod h1:qvpewvjdELAnfO70vg9397CXZ4K4uHxpiWtf5fhKSrQ=
github.com/banzaicloud/koperator/api v0.25.0 h1:cRfoWRUThrAEVnszeeXJkz42gNGezonl3+bGdvbxkNQ=
github.com/banzaicloud/koperator/api v0.25.0/go.mod h1:qvpewvjdELAnfO70vg9397CXZ4K4uHxpiWtf5fhKSrQ=
github.com/banzaicloud/koperator/properties v0.4.1 h1:SB2QgXlcK1Dc7Z1rg65PJifErDa8OQnoWCCJgmC7SGc=
github.com/banzaicloud/koperator/properties v0.4.1/go.mod h1:TcL+llxuhW3UeQtVEDYEXGouFLF2P+LuZZVudSb6jyA=
github.com/banzaicloud/operator-tools v0.28.0 h1:GSfc0qZr6zo7WrNxdgWZE1LcTChPU8QFYOTDirYVtIM=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func main() {
"Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
flag.BoolVar(&webhookDisabled, "disable-webhooks", false, "Disable webhooks used to validate custom resources")
flag.StringVar(&webhookCertDir, "tls-cert-dir", "/etc/webhook/certs", "The directory with a tls.key and tls.crt for serving HTTPS requests")
flag.IntVar(&webhookServerPort, "webhook-server-port", 443, "The port that the webhook server serves at")
flag.IntVar(&webhookServerPort, "webhook-server-port", 9443, "The port that the webhook server serves at")
flag.BoolVar(&developmentLogging, "development", false, "Enable development logging")
flag.BoolVar(&verboseLogging, "verbose", false, "Enable verbose logging")
flag.BoolVar(&certManagerEnabled, "cert-manager-enabled", false, "Enable cert-manager integration")
Expand Down
1 change: 1 addition & 0 deletions pkg/resources/envoy/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (r *Reconciler) deployment(log logr.Logger, extListener v1beta1.ExternalLis
Resources: *ingressConfig.EnvoyConfig.GetResources(),
},
},
SecurityContext: ingressConfig.EnvoyConfig.GetPodSecurityContext(),
Volumes: volumes,
PriorityClassName: ingressConfig.EnvoyConfig.GetPriorityClassName(),
},
Expand Down