Skip to content

Commit 15b60c7

Browse files
committed
Merge remote-tracking branch 'origin/master' into spassky
2 parents 5bb3e6b + c8b1a39 commit 15b60c7

File tree

9 files changed

+121
-92
lines changed

9 files changed

+121
-92
lines changed

.github/workflows/build_pods.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Notify manageiq on pods build
29-
uses: peter-evans/repository-dispatch@v3
29+
uses: peter-evans/repository-dispatch@v4
3030
with:
3131
token: ${{ secrets.BUILD_TOKEN }}
3232
repository: ManageIQ/manageiq

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
- name: Set up Go
2727
uses: actions/setup-go@v6
2828
with:
29-
cache-dependency-path: 'manageiq-operator/go.sum'
29+
cache-dependency-path: manageiq-operator/go.sum
3030
check-latest: true
31-
go-version: 'stable'
31+
go-version: stable
3232
- name: Run ruby tests
3333
run: bundle exec rake
3434
- name: Run golang tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Deploy ManageIQ on OpenShift
22

3-
[![CI](https://github.com/ManageIQ/manageiq-pods/actions/workflows/ci.yaml/badge.svg?branch=spassky)](https://github.com/ManageIQ/manageiq-pods/actions/workflows/ci.yaml)
3+
[![CI](https://github.com/ManageIQ/manageiq-pods/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/ManageIQ/manageiq-pods/actions/workflows/ci.yaml)
44
[![Join the chat at https://gitter.im/ManageIQ/manageiq-pods](https://badges.gitter.im/ManageIQ/manageiq-pods.svg)](https://gitter.im/ManageIQ/manageiq-pods?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
55

66
**This guide will demo deploying ManageIQ in OpenShift as its example use-case but this method could actually be used in a different container cluster environment**

manageiq-operator/api/v1alpha1/helpers/miq-components/httpd.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ func HttpdConfigMap(cr *miqv1alpha1.ManageIQ, scheme *runtime.Scheme, client cli
188188

189189
configMap.Data["application.conf"] = httpdApplicationConf(cr.Spec.ApplicationDomain, uiHttpProtocol, uiWebSocketProtocol, apiHttpProtocol)
190190
configMap.Data["authentication.conf"] = httpdAuthenticationConf(&cr.Spec)
191+
configMap.Data["health.conf"] = httpdHealthConf()
191192

192193
if certSecret := InternalCertificatesSecret(cr, client); certSecret.Data["httpd_crt"] != nil && certSecret.Data["httpd_key"] != nil {
193194
configMap.Data["ssl_config"] = httpdSslConfig()
@@ -357,21 +358,21 @@ func initializeHttpdContainer(spec *miqv1alpha1.ManageIQSpec, privileged bool, c
357358
c.Name = "httpd"
358359
c.Image = spec.HttpdImage
359360
c.ImagePullPolicy = corev1.PullIfNotPresent
360-
if privileged {
361-
c.LivenessProbe = &corev1.Probe{
362-
ProbeHandler: corev1.ProbeHandler{
363-
Exec: &corev1.ExecAction{
364-
Command: []string{"pidof", "httpd"},
365-
},
361+
c.LivenessProbe = &corev1.Probe{
362+
ProbeHandler: corev1.ProbeHandler{
363+
HTTPGet: &corev1.HTTPGetAction{
364+
Path: "/health/healthz",
365+
Port: intstr.FromInt(8081),
366366
},
367-
InitialDelaySeconds: 10,
368-
TimeoutSeconds: 3,
369-
}
367+
},
368+
InitialDelaySeconds: 10,
369+
TimeoutSeconds: 3,
370370
}
371371
c.ReadinessProbe = &corev1.Probe{
372372
ProbeHandler: corev1.ProbeHandler{
373-
TCPSocket: &corev1.TCPSocketAction{
374-
Port: intstr.FromInt(8080),
373+
HTTPGet: &corev1.HTTPGetAction{
374+
Path: "/health/healthz",
375+
Port: intstr.FromInt(8081),
375376
},
376377
},
377378
InitialDelaySeconds: 10,

manageiq-operator/api/v1alpha1/helpers/miq-components/httpd_conf.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@ func httpdAuthenticationConf(spec *miqv1alpha1.ManageIQSpec) string {
9292
}
9393
}
9494

95+
func httpdHealthConf() string {
96+
s := `
97+
Listen 8081
98+
99+
<VirtualHost *:8081>
100+
ServerPath /health/
101+
DocumentRoot /var/www/health/
102+
<Directory /var/www/health>
103+
AllowOverride None
104+
Options FollowSymLinks
105+
Require all granted
106+
</Directory>
107+
</VirtualHost>
108+
`
109+
return s
110+
}
111+
95112
func httpdExternalAuthConf(enableLocalLogin bool) string {
96113
s := `
97114
%s

manageiq-operator/api/v1alpha1/helpers/miq-components/network_policies.go

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package miqtools
22

33
import (
4+
"context"
45
miqv1alpha1 "github.com/ManageIQ/manageiq-pods/manageiq-operator/api/v1alpha1"
6+
routev1 "github.com/openshift/api/route/v1"
57
corev1 "k8s.io/api/core/v1"
68
networkingv1 "k8s.io/api/networking/v1"
79
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -29,9 +31,15 @@ func NetworkPolicyDefaultDeny(cr *miqv1alpha1.ManageIQ, scheme *runtime.Scheme)
2931
return networkPolicy, f
3032
}
3133

32-
func NetworkPolicyAllowInboundHttpd(cr *miqv1alpha1.ManageIQ, scheme *runtime.Scheme) (*networkingv1.NetworkPolicy, controllerutil.MutateFn) {
34+
func NetworkPolicyAllowInboundHttpd(cr *miqv1alpha1.ManageIQ, scheme *runtime.Scheme, client client.Client) (*networkingv1.NetworkPolicy, controllerutil.MutateFn) {
3335
networkPolicy := newNetworkPolicy(cr, "allow-inbound-httpd")
3436

37+
// Check if we're running in OpenShift
38+
openshift := false
39+
if err := client.List(context.TODO(), &routev1.RouteList{}); err == nil {
40+
openshift = true
41+
}
42+
3543
f := func() error {
3644
if err := controllerutil.SetControllerReference(cr, networkPolicy, scheme); err != nil {
3745
return err
@@ -48,8 +56,16 @@ func NetworkPolicyAllowInboundHttpd(cr *miqv1alpha1.ManageIQ, scheme *runtime.Sc
4856
networkingv1.NetworkPolicyPeer{},
4957
}
5058
}
51-
networkPolicy.Spec.Ingress[0].From[0].IPBlock = &networkingv1.IPBlock{}
52-
networkPolicy.Spec.Ingress[0].From[0].IPBlock.CIDR = "0.0.0.0/0"
59+
if openshift == true {
60+
networkPolicy.Spec.Ingress[0].From[0].NamespaceSelector = &metav1.LabelSelector{
61+
MatchLabels: map[string]string{
62+
"network.openshift.io/policy-group": "ingress",
63+
},
64+
}
65+
} else {
66+
networkPolicy.Spec.Ingress[0].From[0].IPBlock = &networkingv1.IPBlock{}
67+
networkPolicy.Spec.Ingress[0].From[0].IPBlock.CIDR = "0.0.0.0/0"
68+
}
5369

5470
return nil
5571
}

manageiq-operator/go.mod

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ module github.com/ManageIQ/manageiq-pods/manageiq-operator
33
go 1.25.0
44

55
require (
6-
github.com/onsi/ginkgo/v2 v2.26.0
6+
github.com/onsi/ginkgo/v2 v2.27.2
77
github.com/onsi/gomega v1.38.2
8-
github.com/openshift/api v0.0.0-20251002150504-230d0e045316
9-
github.com/operator-framework/api v0.35.0
8+
github.com/openshift/api v0.0.0-20251104141128-d13e8c65d30f
9+
github.com/operator-framework/api v0.36.0
1010
k8s.io/api v0.34.1
1111
k8s.io/apimachinery v0.34.1
1212
k8s.io/client-go v0.34.1
13-
sigs.k8s.io/controller-runtime v0.22.1
13+
sigs.k8s.io/controller-runtime v0.22.4
1414
)
1515

1616
require (
17-
cel.dev/expr v0.24.0 // indirect
17+
cel.dev/expr v0.25.0 // indirect
1818
github.com/Masterminds/semver/v3 v3.4.0 // indirect
1919
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
2020
github.com/beorn7/perks v1.0.1 // indirect
@@ -50,7 +50,7 @@ require (
5050
github.com/google/cel-go v0.26.1 // indirect
5151
github.com/google/gnostic-models v0.7.0 // indirect
5252
github.com/google/go-cmp v0.7.0 // indirect
53-
github.com/google/pprof v0.0.0-20251002213607-436353cc1ee6 // indirect
53+
github.com/google/pprof v0.0.0-20251007162407-5df77e3f7d1d // indirect
5454
github.com/google/uuid v1.6.0 // indirect
5555
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
5656
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -61,8 +61,8 @@ require (
6161
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
6262
github.com/prometheus/client_golang v1.23.2 // indirect
6363
github.com/prometheus/client_model v0.6.2 // indirect
64-
github.com/prometheus/common v0.66.1 // indirect
65-
github.com/prometheus/procfs v0.17.0 // indirect
64+
github.com/prometheus/common v0.67.2 // indirect
65+
github.com/prometheus/procfs v0.19.2 // indirect
6666
github.com/sirupsen/logrus v1.9.3 // indirect
6767
github.com/spf13/cobra v1.10.1 // indirect
6868
github.com/spf13/pflag v1.0.10 // indirect
@@ -76,26 +76,25 @@ require (
7676
go.opentelemetry.io/otel/metric v1.38.0 // indirect
7777
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
7878
go.opentelemetry.io/otel/trace v1.38.0 // indirect
79-
go.opentelemetry.io/proto/otlp v1.8.0 // indirect
80-
go.uber.org/automaxprocs v1.6.0 // indirect
79+
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
8180
go.uber.org/multierr v1.11.0 // indirect
8281
go.uber.org/zap v1.27.0 // indirect
8382
go.yaml.in/yaml/v2 v2.4.3 // indirect
8483
go.yaml.in/yaml/v3 v3.0.4 // indirect
85-
golang.org/x/exp v0.0.0-20251002181428-27f1f14c8bb9 // indirect
86-
golang.org/x/mod v0.28.0 // indirect
87-
golang.org/x/net v0.44.0 // indirect
88-
golang.org/x/oauth2 v0.31.0 // indirect
84+
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect
85+
golang.org/x/mod v0.29.0 // indirect
86+
golang.org/x/net v0.46.0 // indirect
87+
golang.org/x/oauth2 v0.32.0 // indirect
8988
golang.org/x/sync v0.17.0 // indirect
90-
golang.org/x/sys v0.36.0 // indirect
91-
golang.org/x/term v0.35.0 // indirect
92-
golang.org/x/text v0.29.0 // indirect
93-
golang.org/x/time v0.13.0 // indirect
94-
golang.org/x/tools v0.37.0 // indirect
89+
golang.org/x/sys v0.37.0 // indirect
90+
golang.org/x/term v0.36.0 // indirect
91+
golang.org/x/text v0.30.0 // indirect
92+
golang.org/x/time v0.14.0 // indirect
93+
golang.org/x/tools v0.38.0 // indirect
9594
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
96-
google.golang.org/genproto/googleapis/api v0.0.0-20251002232023-7c0ddcbb5797 // indirect
97-
google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797 // indirect
98-
google.golang.org/grpc v1.75.1 // indirect
95+
google.golang.org/genproto/googleapis/api v0.0.0-20251103181224-f26f9409b101 // indirect
96+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251103181224-f26f9409b101 // indirect
97+
google.golang.org/grpc v1.76.0 // indirect
9998
google.golang.org/protobuf v1.36.10 // indirect
10099
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
101100
gopkg.in/inf.v0 v0.9.1 // indirect
@@ -105,7 +104,7 @@ require (
105104
k8s.io/klog/v2 v2.130.1 // indirect
106105
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
107106
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
108-
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0 // indirect
107+
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0 // indirect
109108
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
110109
sigs.k8s.io/randfill v1.0.0 // indirect
111110
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect

0 commit comments

Comments
 (0)