-
Notifications
You must be signed in to change notification settings - Fork 20
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
remove coreos-operator dependancy #19
Merged
objectiser
merged 6 commits into
objectiser:master
from
krasi-georgiev:remove-coreos-operator
Nov 14, 2017
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b87aeb9
remove coreos-operator for the kubernetes examples
krasi-georgiev c11b748
replace the matching label for service scraping
krasi-georgiev bdc26d2
updated the readme files
krasi-georgiev 101c5eb
change the scrape match based on an annotation to be consistent with …
krasi-georgiev d5c7390
scrape pods instead of services to get pod related metrics
krasi-georgiev 60e94a1
nit
krasi-georgiev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,9 @@ This example will use [minishift](https://docs.openshift.org/latest/minishift/ge | |
First step is to start this environment: | ||
|
||
``` | ||
minishift start --openshift-version=v3.6.0-alpha.2 | ||
minishift start | ||
``` | ||
|
||
You can use a more [recent version](https://github.com/openshift/origin/releases) if available. | ||
|
||
NOTE: The alpha version is currently required, as the previous stable version does not include Kubernetes RBAC authorizaion | ||
support. | ||
|
||
When fully started, then launch the dashboard using the link displayed following `The server is accessible via web console at: | ||
`. Log in using the credentials `developer/developer` and navigate to the `New Project` overview page. | ||
|
||
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. The next line contains "Kubernetes", could you change this to "OpenShift" - looks like I missed that (copy/paste) :) |
||
|
@@ -20,31 +15,16 @@ is fully running before moving onto the next step. | |
|
||
## Prometheus | ||
|
||
To obtain metrics from the deployed services, we will use the | ||
[coreos prometheus operator](https://coreos.com/operators/prometheus/docs/latest/user-guides/getting-started.html) | ||
project. To install, use the following command: | ||
Add configuration to locate service monitors based on label "scrape: 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. same as above (for k8s) |
||
|
||
``` | ||
oc login -u system:admin | ||
|
||
oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:myproject:default | ||
oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:myproject:prometheus-operator | ||
|
||
oc create -f https://raw.githubusercontent.com/coreos/prometheus-operator/v0.11.0/bundle.yaml | ||
``` | ||
|
||
Add configuration to locate service monitors based on label "team: frontend": | ||
|
||
``` | ||
oc create -f prometheus-kubernetes.yml | ||
``` | ||
|
||
The actual service monitors will be configured with the deployed services. | ||
|
||
TODO: Currently there is one service monitor per service - using the label associated with the app. However | ||
it may be good to try having a single service monitor with a more generic label, which the services can | ||
be associated with. | ||
|
||
The next step is to create a route to make the Prometheus UI URL accessible: | ||
|
||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,75 @@ | ||
apiVersion: monitoring.coreos.com/v1alpha1 | ||
kind: Prometheus | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: prometheus | ||
spec: | ||
serviceMonitorSelector: | ||
matchLabels: | ||
team: frontend | ||
version: v1.6.3 | ||
resources: | ||
requests: | ||
memory: 400Mi | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: prometheus | ||
spec: | ||
containers: | ||
- image: prom/prometheus:v2.0.0 | ||
name: prometheus | ||
command: | ||
- "/bin/prometheus" | ||
args: | ||
- "--config.file=/etc/prometheus/prometheus.yml" | ||
- "--storage.tsdb.path=/prometheus" | ||
- "--storage.tsdb.retention=24h" | ||
ports: | ||
- name: web | ||
containerPort: 9090 | ||
protocol: TCP | ||
volumeMounts: | ||
- mountPath: "/prometheus" | ||
name: data | ||
- mountPath: "/etc/prometheus" | ||
name: config | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
limits: | ||
cpu: 500m | ||
memory: 2500Mi | ||
volumes: | ||
- emptyDir: {} | ||
name: data | ||
- configMap: | ||
name: prometheus | ||
name: config | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: prometheus | ||
data: | ||
prometheus.yml: | | ||
global: | ||
scrape_interval: 15s | ||
scrape_configs: | ||
- job_name: 'kubernetes-pods' | ||
kubernetes_sd_configs: | ||
- role: service | ||
relabel_configs: | ||
- source_labels: [__meta_kubernetes_service_label_scrape] | ||
action: keep | ||
regex: true | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: prometheus | ||
spec: | ||
type: NodePort | ||
type: LoadBalancer | ||
ports: | ||
- name: web | ||
nodePort: 30900 | ||
port: 9090 | ||
protocol: TCP | ||
targetPort: web | ||
selector: | ||
prometheus: prometheus | ||
|
||
app: prometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: "locate services to be monitored based..."