-
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 1 commit
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 |
---|---|---|
|
@@ -33,15 +33,15 @@ The operator is now ready to create Jaeger instances! | |
|
||
== Installing the operator on OpenShift | ||
|
||
The instructions from the previous section also work on OpenShift, but make sure to install the RBAC rules, the CRD and the operator as a privileged user, such as `system:admin`. | ||
The instructions from the previous section also work on OpenShift given that the `operator-openshift.yaml` is used instead of `operator.yaml`. Make sure to install the RBAC rules, the CRD and the operator as a privileged user, such as `system:admin`. | ||
|
||
[source,bash] | ||
---- | ||
oc login -u system:admin | ||
|
||
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/rbac.yaml | ||
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/crd.yaml | ||
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/operator.yaml | ||
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/operator-openshift.yaml | ||
---- | ||
|
||
Once the operator is installed, grant the role `jaeger-operator` to users who should be able to install individual Jaeger instances. The following example creates a role binding allowing the user `developer` to create Jaeger instances: | ||
|
@@ -149,18 +149,13 @@ NAME HOSTS ADDRESS PORTS AGE | |
simplest-query * 192.168.122.34 80 3m | ||
---- | ||
|
||
IMPORTANT: an `Ingress` object is *not* created when the operator is started with the `--openshift=true` flag as, such as when using the resource `operator-openshift.yaml`. | ||
|
||
In this example, the Jaeger UI is available at http://192.168.122.34 | ||
|
||
=== OpenShift | ||
|
||
For OpenShift, the preferred approach is to create a `route` object that will expose the UI under a specific address: | ||
|
||
[source,bash] | ||
---- | ||
oc create route edge --service simplest-query --port 16686 | ||
---- | ||
|
||
Check the hostname/port with the following command: | ||
When using the `operator-openshift.yaml` resource, the Operator will automatically create a `Route` object for the query services. Check the hostname/port with the following command: | ||
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. Possibly the route should only be created if |
||
|
||
[source,bash] | ||
---- | ||
|
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", "--openshift=true"] | ||
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 there any way this can be auto-detected? Avoid having separate operator.yaml if possible. 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 have started a discussion in the Operator SDK mailing list about this, but I think we want a flag anyway, to explicitly set a target, bypassing the auto-detection. |
||
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 |
---|---|---|
|
@@ -32,6 +32,7 @@ type JaegerSpec struct { | |
Agent JaegerAgentSpec `json:"agent"` | ||
Storage JaegerStorageSpec `json:"storage"` | ||
Ingress JaegerIngressSpec `json:"ingress"` | ||
Route JaegerRouteSpec `json:"route"` | ||
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. As mentioned above - it would be good if route and ingress could be treated as same concept. If at some point in the future there are reasons to have platform specific "ingress" related options, then these could go in platform specific sub-specs? |
||
} | ||
|
||
// JaegerStatus defines what is to be returned from a status query | ||
|
@@ -52,6 +53,11 @@ type JaegerIngressSpec struct { | |
Enabled *bool `json:"enabled"` | ||
} | ||
|
||
// JaegerRouteSpec defines the options to be used when deploying the query route (OpenShift-specific) | ||
type JaegerRouteSpec struct { | ||
Enabled *bool `json:"enabled"` | ||
} | ||
|
||
// JaegerAllInOneSpec defines the options to be used when deploying the query | ||
type JaegerAllInOneSpec struct { | ||
Image string `json:"image"` | ||
|
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 |
---|---|---|
|
@@ -8,14 +8,15 @@ import ( | |
"syscall" | ||
"time" | ||
|
||
"github.com/jaegertracing/jaeger-operator/pkg/apis/io/v1alpha1" | ||
stub "github.com/jaegertracing/jaeger-operator/pkg/stub" | ||
"github.com/jaegertracing/jaeger-operator/pkg/version" | ||
sdk "github.com/operator-framework/operator-sdk/pkg/sdk" | ||
k8sutil "github.com/operator-framework/operator-sdk/pkg/util/k8sutil" | ||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
|
||
"github.com/jaegertracing/jaeger-operator/pkg/apis/io/v1alpha1" | ||
stub "github.com/jaegertracing/jaeger-operator/pkg/stub" | ||
"github.com/jaegertracing/jaeger-operator/pkg/version" | ||
) | ||
|
||
// NewStartCommand starts the Jaeger Operator | ||
|
@@ -29,24 +30,27 @@ func NewStartCommand() *cobra.Command { | |
}, | ||
} | ||
|
||
cmd.Flags().StringP("jaeger-version", "", version.DefaultJaeger(), "The Jaeger version to use") | ||
cmd.Flags().String("jaeger-version", version.DefaultJaeger(), "The Jaeger version to use") | ||
viper.BindPFlag("jaeger-version", cmd.Flags().Lookup("jaeger-version")) | ||
|
||
cmd.Flags().StringP("jaeger-agent-image", "", "jaegertracing/jaeger-agent", "The Docker image for the Jaeger Agent") | ||
cmd.Flags().String("jaeger-agent-image", "jaegertracing/jaeger-agent", "The Docker image for the Jaeger Agent") | ||
viper.BindPFlag("jaeger-agent-image", cmd.Flags().Lookup("jaeger-agent-image")) | ||
|
||
cmd.Flags().StringP("jaeger-query-image", "", "jaegertracing/jaeger-query", "The Docker image for the Jaeger Query") | ||
cmd.Flags().String("jaeger-query-image", "jaegertracing/jaeger-query", "The Docker image for the Jaeger Query") | ||
viper.BindPFlag("jaeger-query-image", cmd.Flags().Lookup("jaeger-query-image")) | ||
|
||
cmd.Flags().StringP("jaeger-collector-image", "", "jaegertracing/jaeger-collector", "The Docker image for the Jaeger Collector") | ||
cmd.Flags().String("jaeger-collector-image", "jaegertracing/jaeger-collector", "The Docker image for the Jaeger Collector") | ||
viper.BindPFlag("jaeger-collector-image", cmd.Flags().Lookup("jaeger-collector-image")) | ||
|
||
cmd.Flags().StringP("jaeger-all-in-one-image", "", "jaegertracing/all-in-one", "The Docker image for the Jaeger all-in-one") | ||
cmd.Flags().String("jaeger-all-in-one-image", "jaegertracing/all-in-one", "The Docker image for the Jaeger all-in-one") | ||
viper.BindPFlag("jaeger-all-in-one-image", cmd.Flags().Lookup("jaeger-all-in-one-image")) | ||
|
||
cmd.Flags().StringP("jaeger-cassandra-schema-image", "", "jaegertracing/jaeger-cassandra-schema", "The Docker image for the Jaeger Cassandra Schema") | ||
cmd.Flags().String("jaeger-cassandra-schema-image", "jaegertracing/jaeger-cassandra-schema", "The Docker image for the Jaeger Cassandra Schema") | ||
viper.BindPFlag("jaeger-cassandra-schema-image", cmd.Flags().Lookup("jaeger-cassandra-schema-image")) | ||
|
||
cmd.Flags().Bool("openshift", false, "Whether the operator should use OpenShift-specific features, like Routes and OAuth proxy for the UIs") | ||
viper.BindPFlag("openshift", cmd.Flags().Lookup("openshift")) | ||
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. As mentioned before, would be great if this could be auto-detected - but if not easy to do for now, then might be better to have a |
||
|
||
return cmd | ||
} | ||
|
||
|
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.
I think the "as" following flag can be removed?