Skip to content

Commit 0b7b865

Browse files
Merge pull request #1708 from stuggi/rbac_proxy_cleanup
Remove KubeRbacProxy references
2 parents 9a923a3 + 6c27ca5 commit 0b7b865

File tree

7 files changed

+4
-80
lines changed

7 files changed

+4
-80
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ bindata: kustomize yq ## Call sync bindata script
157157
sed -i bindata/operator/operator.yaml -e "/envCustom/c\\{{- range .OpenStackOperator.Deployment.Manager.Env }}\n - name: '{{ .Name }}'\n value: '{{ .Value }}'\n{{- end }}"
158158
sed -i bindata/operator/operator.yaml -e "/customLimits/c\\ cpu: {{ .OpenStackOperator.Deployment.Manager.Resources.Limits.CPU }}\n memory: {{ .OpenStackOperator.Deployment.Manager.Resources.Limits.Memory }}"
159159
sed -i bindata/operator/operator.yaml -e "/customRequests/c\\ cpu: {{ .OpenStackOperator.Deployment.Manager.Resources.Requests.CPU }}\n memory: {{ .OpenStackOperator.Deployment.Manager.Resources.Requests.Memory }}"
160-
sed -i bindata/operator/operator.yaml -e "s|kube-rbac-proxy:replace_me.*|'{{ .OpenStackOperator.Deployment.KubeRbacProxy.Image }}'|"
161160
sed -i bindata/operator/operator.yaml -e "/customTolerations/c\\ tolerations:\n{{- range .OpenStackOperator.Deployment.Tolerations }}\n - key: \"{{ .Key }}\"\n{{- if .Operator }}\n operator: \"{{ .Operator }}\"\n{{- end }}\n{{- if .Value }}\n value: \"{{ .Value }}\"\n{{- end }}\n{{- if .Effect }}\n effect: \"{{ .Effect }}\"\n{{- end }}\n{{- if .TolerationSeconds }}\n tolerationSeconds: {{ .TolerationSeconds }}\n{{- end }}\n{{- end }}"
162161
cp config/operator/managers.yaml bindata/operator/
163162
cp config/operator/rabbit.yaml bindata/operator/

api/operator/v1beta1/openstack_types.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ var (
6464
DefaultManagerMemoryLimit resource.Quantity = resource.MustParse("512Mi")
6565
// DefaultManagerMemoryRequests - Default controller manager container memory requests
6666
DefaultManagerMemoryRequests resource.Quantity = resource.MustParse("256Mi")
67-
// DefaultRbacProxyCPULimit - Default kube rbac proxy container CPU limit
68-
DefaultRbacProxyCPULimit resource.Quantity = resource.MustParse("500m")
69-
// DefaultRbacProxyCPURequests - Default kube rbac proxy container CPU requests
70-
DefaultRbacProxyCPURequests resource.Quantity = resource.MustParse("5m")
71-
// DefaultRbacProxyMemoryLimit - Default kube rbac proxy container memory limit
72-
DefaultRbacProxyMemoryLimit resource.Quantity = resource.MustParse("128Mi")
73-
// DefaultRbacProxyMemoryRequests - Default kube rbac proxy container memory requests
74-
DefaultRbacProxyMemoryRequests resource.Quantity = resource.MustParse("64Mi")
7567

7668
// DefaultTolerations - Default tolerations for all operators
7769
DefaultTolerations = []corev1.Toleration{

bindata/operator/managers.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -77,28 +77,6 @@ spec:
7777
- mountPath: /tmp/k8s-metrics-server/metrics-certs
7878
name: metrics-certs
7979
readOnly: true
80-
{{- end }}
81-
{{- if isEnvVarFalse .Deployment.Manager.Env "METRICS_CERTS" }}
82-
- args:
83-
- --secure-listen-address=0.0.0.0:8443
84-
- --upstream=http://127.0.0.1:8080/
85-
- --logtostderr=true
86-
- --v=0
87-
image: {{ .Deployment.KubeRbacProxy.Image }}
88-
name: kube-rbac-proxy
89-
ports:
90-
- containerPort: 8443
91-
name: https
92-
protocol: TCP
93-
resources:
94-
limits:
95-
cpu: {{ .Deployment.KubeRbacProxy.Resources.Limits.CPU }}
96-
memory: {{ .Deployment.KubeRbacProxy.Resources.Limits.Memory }}
97-
requests:
98-
cpu: {{ .Deployment.KubeRbacProxy.Resources.Requests.CPU }}
99-
memory: {{ .Deployment.KubeRbacProxy.Resources.Requests.Memory }}
100-
securityContext:
101-
allowPrivilegeEscalation: false
10280
{{- end }}
10381
securityContext:
10482
runAsNonRoot: true

config/operator/default_images.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,3 @@ spec:
200200
value: quay.io/podified-antelope-centos9/openstack-horizontest:current-podified
201201
- name: RELATED_IMAGE_OPENSTACK_MUST_GATHER_DEFAULT
202202
value: quay.io/openstack-k8s-operators/openstack-must-gather:latest
203-
# will already be part of relatedImages as it is also directly set in the deployment in the
204-
# bundle CSV. We also need an environment variable here to propagate this to the
205-
# controller-manager and to other operators that require the same image to be set
206-
- name: KUBE_RBAC_PROXY
207-
value: quay.io/openstack-k8s-operators/kube-rbac-proxy:v0.16.0

config/operator/managers.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -77,28 +77,6 @@ spec:
7777
- mountPath: /tmp/k8s-metrics-server/metrics-certs
7878
name: metrics-certs
7979
readOnly: true
80-
{{- end }}
81-
{{- if isEnvVarFalse .Deployment.Manager.Env "METRICS_CERTS" }}
82-
- args:
83-
- --secure-listen-address=0.0.0.0:8443
84-
- --upstream=http://127.0.0.1:8080/
85-
- --logtostderr=true
86-
- --v=0
87-
image: {{ .Deployment.KubeRbacProxy.Image }}
88-
name: kube-rbac-proxy
89-
ports:
90-
- containerPort: 8443
91-
name: https
92-
protocol: TCP
93-
resources:
94-
limits:
95-
cpu: {{ .Deployment.KubeRbacProxy.Resources.Limits.CPU }}
96-
memory: {{ .Deployment.KubeRbacProxy.Resources.Limits.Memory }}
97-
requests:
98-
cpu: {{ .Deployment.KubeRbacProxy.Resources.Requests.CPU }}
99-
memory: {{ .Deployment.KubeRbacProxy.Resources.Requests.Memory }}
100-
securityContext:
101-
allowPrivilegeEscalation: false
10280
{{- end }}
10381
securityContext:
10482
runAsNonRoot: true

internal/controller/operator/openstack_controller.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ var (
6969
envRelatedOperatorImages (map[string]*string) // operatorName -> image
7070
envRelatedOpenStackServiceImages (map[string]*string) // full_related_image_name -> image
7171
operatorImage string
72-
kubeRbacProxyImage string
7372
openstackReleaseVersion string
7473
leaseDuration string
7574
renewDeadline string
@@ -92,8 +91,6 @@ func SetupEnv() {
9291
log.Log.Info("Found operator related image", "operator", operatorName, "image", envArr[1])
9392
} else if strings.HasPrefix(envArr[0], "RELATED_IMAGE_") {
9493
envRelatedOpenStackServiceImages[envArr[0]] = &envArr[1]
95-
} else if envArr[0] == "KUBE_RBAC_PROXY" {
96-
kubeRbacProxyImage = envArr[1]
9794
} else if envArr[0] == "OPERATOR_IMAGE_URL" {
9895
operatorImage = envArr[1]
9996
envRelatedOperatorImages[operatorv1beta1.OpenStackOperatorName] = &operatorImage
@@ -495,19 +492,6 @@ func (r *OpenStackReconciler) applyRBAC(ctx context.Context, instance *operatorv
495492
}
496493

497494
func (r *OpenStackReconciler) applyOperator(ctx context.Context, instance *operatorv1beta1.OpenStack) error {
498-
kubeRbacProxyContainer := operator.Container{
499-
Image: kubeRbacProxyImage,
500-
Resources: operator.Resource{
501-
Limits: &operator.ResourceList{
502-
CPU: operatorv1beta1.DefaultRbacProxyCPULimit.String(),
503-
Memory: operatorv1beta1.DefaultRbacProxyMemoryLimit.String(),
504-
},
505-
Requests: &operator.ResourceList{
506-
CPU: operatorv1beta1.DefaultRbacProxyCPURequests.String(),
507-
Memory: operatorv1beta1.DefaultRbacProxyMemoryRequests.String(),
508-
},
509-
},
510-
}
511495
defaultEnv := []corev1.EnvVar{
512496
{
513497
Name: "LEASE_DURATION",
@@ -566,8 +550,7 @@ func (r *OpenStackReconciler) applyOperator(ctx context.Context, instance *opera
566550
},
567551
},
568552
},
569-
KubeRbacProxy: kubeRbacProxyContainer,
570-
Tolerations: operatorv1beta1.DefaultTolerations,
553+
Tolerations: operatorv1beta1.DefaultTolerations,
571554
},
572555
}
573556

internal/operator/override.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ type Operator struct {
3636

3737
// Deployment -
3838
type Deployment struct {
39-
Replicas *int32
40-
Manager Container
41-
KubeRbacProxy Container
42-
Tolerations []corev1.Toleration
39+
Replicas *int32
40+
Manager Container
41+
Tolerations []corev1.Toleration
4342
}
4443

4544
// Container -

0 commit comments

Comments
 (0)