-
Notifications
You must be signed in to change notification settings - Fork 344
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 support for OpenShift routes #93
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: jaeger-operator | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: jaeger-operator | ||
template: | ||
metadata: | ||
labels: | ||
name: jaeger-operator | ||
spec: | ||
containers: | ||
- name: jaeger-operator | ||
image: jaegertracing/jaeger-operator:1.7.0 | ||
ports: | ||
- containerPort: 60000 | ||
name: metrics | ||
args: ["start", "--platform=openshift"] | ||
imagePullPolicy: Always | ||
env: | ||
- name: WATCH_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: OPERATOR_NAME | ||
value: "jaeger-operator" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,14 @@ import ( | |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
// FlagPlatformKubernetes represents the value for the 'platform' flag for Kubernetes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: move kubernetes up as the first option - don't want to show favouritism :) |
||
FlagPlatformKubernetes = "kubernetes" | ||
|
||
// FlagPlatformOpenShift represents the value for the 'platform' flag for OpenShift | ||
FlagPlatformOpenShift = "openshift" | ||
) | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// JaegerList is a list of Jaeger structs | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,15 @@ package controller | |
import ( | ||
"context" | ||
|
||
"github.com/jaegertracing/jaeger-operator/pkg/ingress" | ||
|
||
"github.com/operator-framework/operator-sdk/pkg/sdk" | ||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/viper" | ||
batchv1 "k8s.io/api/batch/v1" | ||
|
||
"github.com/jaegertracing/jaeger-operator/pkg/apis/io/v1alpha1" | ||
"github.com/jaegertracing/jaeger-operator/pkg/deployment" | ||
"github.com/jaegertracing/jaeger-operator/pkg/ingress" | ||
"github.com/jaegertracing/jaeger-operator/pkg/route" | ||
"github.com/jaegertracing/jaeger-operator/pkg/storage" | ||
) | ||
|
||
|
@@ -41,9 +42,16 @@ func (c *allInOneController) Create() []sdk.Object { | |
os = append(os, svc) | ||
} | ||
|
||
qi := ingress.NewQueryIngress(c.jaeger).Get() | ||
if nil != qi { | ||
os = append(os, qi) | ||
if viper.GetString("platform") == v1alpha1.FlagPlatformOpenShift { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth moving this platform specific difference into the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this kind of logic actually belongs to the controller, as it's the part that decides what should get created (as opposed to the "how", which is inside the specific object packages). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok sounds reasonable. |
||
qr := route.NewQueryRoute(c.jaeger).Get() | ||
if nil != qr { | ||
os = append(os, qr) | ||
} | ||
} else { | ||
qi := ingress.NewQueryIngress(c.jaeger).Get() | ||
if nil != qi { | ||
os = append(os, qi) | ||
} | ||
} | ||
|
||
return os | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly the route should only be created if
ingress.enabled
is true? So it has similar behaviour but just has a platform specific outcome.