Skip to content

Commit 7177140

Browse files
committed
Address minor extraneous config, debug logging, and OpenShift values. (#1063)
* Removed extraneous Transport set. * Bumped configureContainer debug logging to actual Debugf logging. * Reverted helm chart values and added separate adjusted values-openshift.yaml. Signed-off-by: Roddie Kieley <[email protected]>
1 parent 88752f6 commit 7177140

File tree

4 files changed

+189
-13
lines changed

4 files changed

+189
-13
lines changed

cmd/thv-operator/controllers/mcpserver_resource_overrides_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,8 @@ func TestDeploymentNeedsUpdateServiceAccount(t *testing.T) {
378378
Namespace: "default",
379379
},
380380
Spec: mcpv1alpha1.MCPServerSpec{
381-
Image: "test-image",
382-
Port: 8080,
383-
Transport: "stdio",
381+
Image: "test-image",
382+
Port: 8080,
384383
},
385384
}
386385

@@ -639,7 +638,6 @@ func TestDeploymentNeedsUpdateToolsFilter(t *testing.T) {
639638
Spec: mcpv1alpha1.MCPServerSpec{
640639
Image: "test-image",
641640
Port: 8080,
642-
Transport: "stdio",
643641
ToolsFilter: tt.initialToolsFilter,
644642
},
645643
}
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# -- Override the name of the chart
2+
nameOverride: ""
3+
# -- Provide a fully-qualified name override for resources
4+
fullnameOverride: "toolhive-operator"
5+
6+
# -- All values for the operator deployment and associated resources
7+
operator:
8+
9+
# -- Number of replicas for the operator deployment
10+
replicaCount: 1
11+
12+
# -- List of image pull secrets to use
13+
imagePullSecrets: []
14+
# -- Container image for the operator
15+
image: ghcr.io/stacklok/toolhive/operator:v0.2.0
16+
# -- Image pull policy for the operator container
17+
imagePullPolicy: IfNotPresent
18+
19+
# -- Image to use for Toolhive runners
20+
toolhiveRunnerImage: ghcr.io/stacklok/toolhive/proxyrunner:v0.2.0
21+
22+
# -- Host for the proxy deployed by the operator
23+
proxyHost: 0.0.0.0
24+
25+
# -- Environment variables to set in the operator container
26+
env: {}
27+
28+
# -- List of ports to expose from the operator container
29+
ports:
30+
- containerPort: 8080
31+
name: metrics
32+
protocol: TCP
33+
- containerPort: 8081
34+
name: health
35+
protocol: TCP
36+
37+
# -- Annotations to add to the operator pod
38+
podAnnotations: {}
39+
# -- Labels to add to the operator pod
40+
podLabels: {}
41+
42+
# -- Pod security context settings
43+
podSecurityContext:
44+
runAsNonRoot: true
45+
seccompProfile:
46+
type: RuntimeDefault
47+
48+
# -- Container security context settings for the operator
49+
containerSecurityContext:
50+
allowPrivilegeEscalation: false
51+
readOnlyRootFilesystem: true
52+
runAsNonRoot: true
53+
capabilities:
54+
drop:
55+
- ALL
56+
57+
# -- Liveness probe configuration for the operator
58+
livenessProbe:
59+
httpGet:
60+
path: /healthz
61+
port: health
62+
initialDelaySeconds: 15
63+
periodSeconds: 20
64+
# -- Readiness probe configuration for the operator
65+
readinessProbe:
66+
httpGet:
67+
path: /readyz
68+
port: health
69+
initialDelaySeconds: 5
70+
periodSeconds: 10
71+
72+
# -- Configuration for horizontal pod autoscaling
73+
autoscaling:
74+
# -- Enable autoscaling for the operator
75+
enabled: false
76+
# -- Minimum number of replicas
77+
minReplicas: 1
78+
# -- Maximum number of replicas
79+
maxReplicas: 100
80+
# -- Target CPU utilization percentage for autoscaling
81+
targetCPUUtilizationPercentage: 80
82+
# -- Target memory utilization percentage for autoscaling (uncomment to enable)
83+
# targetMemoryUtilizationPercentage: 80
84+
85+
# -- Resource requests and limits for the operator container
86+
resources:
87+
limits:
88+
cpu: 500m
89+
memory: 384Mi
90+
requests:
91+
cpu: 10m
92+
memory: 192Mi
93+
94+
# -- RBAC configuration for the operator
95+
rbac:
96+
# -- Scope of the RBAC configuration.
97+
# - cluster: The operator will have cluster-wide permissions via ClusterRole and ClusterRoleBinding.
98+
# - namespace: The operator will have permissions to manage resources in the namespaces specified in `allowedNamespaces`.
99+
# The operator will have a ClusterRole and RoleBinding for each namespace in `allowedNamespaces`.
100+
scope: cluster
101+
# -- List of namespaces that the operator is allowed to have permissions to manage.
102+
# Only used if scope is set to "namespace".
103+
allowedNamespaces: []
104+
105+
# -- Service account configuration for the operator
106+
serviceAccount:
107+
# -- Specifies whether a service account should be created
108+
create: true
109+
# -- Automatically mount a ServiceAccount's API credentials
110+
automountServiceAccountToken: true
111+
# -- Annotations to add to the service account
112+
annotations: {}
113+
# -- Labels to add to the service account
114+
labels: {}
115+
# -- The name of the service account to use. If not set and create is true, a name is generated.
116+
name: "toolhive-operator"
117+
118+
# -- Leader election role configuration
119+
leaderElectionRole:
120+
# -- Name of the role for leader election
121+
name: toolhive-operator-leader-election-role
122+
binding:
123+
# -- Name of the role binding for leader election
124+
name: toolhive-operator-leader-election-rolebinding
125+
# -- Rules for the leader election role
126+
rules:
127+
- apiGroups:
128+
- ""
129+
resources:
130+
- configmaps
131+
verbs:
132+
- get
133+
- list
134+
- watch
135+
- create
136+
- update
137+
- patch
138+
- delete
139+
- apiGroups:
140+
- coordination.k8s.io
141+
resources:
142+
- leases
143+
verbs:
144+
- get
145+
- list
146+
- watch
147+
- create
148+
- update
149+
- patch
150+
- delete
151+
- apiGroups:
152+
- ""
153+
resources:
154+
- events
155+
verbs:
156+
- create
157+
- patch
158+
159+
# -- Additional volumes to mount on the operator pod
160+
volumes: []
161+
# - name: foo
162+
# secret:
163+
# secretName: mysecret
164+
# optional: false
165+
166+
# -- Additional volume mounts on the operator container
167+
volumeMounts: []
168+
# - name: foo
169+
# mountPath: "/etc/foo"
170+
# readOnly: true
171+
172+
# -- Node selector for the operator pod
173+
nodeSelector: {}
174+
175+
# -- Tolerations for the operator pod
176+
tolerations: []
177+
178+
# -- Affinity settings for the operator pod
179+
affinity: {}

deploy/charts/operator/values.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ operator:
4242
# -- Pod security context settings
4343
podSecurityContext:
4444
runAsNonRoot: true
45-
seccompProfile:
46-
type: RuntimeDefault
4745

4846
# -- Container security context settings for the operator
4947
containerSecurityContext:
5048
allowPrivilegeEscalation: false
5149
readOnlyRootFilesystem: true
5250
runAsNonRoot: true
51+
runAsUser: 1000
5352
capabilities:
5453
drop:
5554
- ALL
@@ -86,10 +85,10 @@ operator:
8685
resources:
8786
limits:
8887
cpu: 500m
89-
memory: 384Mi
88+
memory: 128Mi
9089
requests:
9190
cpu: 10m
92-
memory: 192Mi
91+
memory: 64Mi
9392

9493
# -- RBAC configuration for the operator
9594
rbac:

pkg/container/kubernetes/client.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,14 +1027,14 @@ func configureContainer(
10271027
envVars []*corev1apply.EnvVarApplyConfiguration,
10281028
platform Platform,
10291029
) {
1030-
logger.Infof("Configuring container %s with image %s", *container.Name, image)
1031-
logger.Infof("Command: ")
1030+
logger.Debugf("Configuring container %s with image %s", *container.Name, image)
1031+
logger.Debugf("Command: ")
10321032
for _, arg := range command {
1033-
logger.Infof("Arg: %s", arg)
1033+
logger.Debugf("Arg: %s", arg)
10341034
}
1035-
logger.Infof("AttachStdio: %v", attachStdio)
1035+
logger.Debugf("AttachStdio: %v", attachStdio)
10361036
for _, envVar := range envVars {
1037-
logger.Infof("EnvVar: %s=%s", *envVar.Name, *envVar.Value)
1037+
logger.Debugf("EnvVar: %s=%s", *envVar.Name, *envVar.Value)
10381038
}
10391039

10401040
container.WithImage(image).

0 commit comments

Comments
 (0)