Skip to content
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

prometheus & grafana - fix for usage docs #7361

Merged
merged 1 commit into from
Jul 16, 2021
Merged

prometheus & grafana - fix for usage docs #7361

merged 1 commit into from
Jul 16, 2021

Conversation

longwuyuan
Copy link
Contributor

What this PR does / why we need it:

The documentation for prometheus & grafana installation is not describing how to enable metrics. The kustomization files for prometheus and grafana have hardcoded outdated versions. This PR inserts the instructions to enable metrics and also removes the tag for image from kustomization yaml file, so that latest prometheus and grafana gets installed. There is also instructions added to import the dashboard which was too short before.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Which issue/s this PR fixes

fixes #7197
fixes #7285

How Has This Been Tested?

image

image

__$ k -n ingress-nginx describe deployments.apps prometheus-server 
Name:                   prometheus-server
Namespace:              ingress-nginx
CreationTimestamp:      Sat, 10 Jul 2021 13:11:01 +0530
Labels:                 app.kubernetes.io/name=prometheus
                        app.kubernetes.io/part-of=ingress-nginx
Annotations:            deployment.kubernetes.io/revision: 1
Selector:               app.kubernetes.io/name=prometheus,app.kubernetes.io/part-of=ingress-nginx
Replicas:               1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:           app.kubernetes.io/name=prometheus
                    app.kubernetes.io/part-of=ingress-nginx
  Service Account:  prometheus-server
  Containers:
   prometheus:
    Image:      prom/prometheus
    Port:       9090/TCP
    Host Port:  0/TCP
    Args:
      --config.file=/etc/prometheus/prometheus.yaml
      --storage.tsdb.path=/prometheus/
    Environment:  <none>
    Mounts:
      /etc/prometheus/ from prometheus-config-volume (rw)
      /prometheus/ from prometheus-storage-volume (rw)
  Volumes:
   prometheus-config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      prometheus-configuration-8hk4m6bf76
    Optional:  false
   prometheus-storage-volume:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Progressing    True    NewReplicaSetAvailable
  Available      True    MinimumReplicasAvailable
OldReplicaSets:  <none>
NewReplicaSet:   prometheus-server-779c8d44cf (1/1 replicas created)
Events:          <none>

__$ k -n ingress-nginx describe deployments.apps ingcontroller0-ingress-nginx-controller                                                                                                                      
Name:                   ingcontroller0-ingress-nginx-controller                                                                                                                                               
Namespace:              ingress-nginx                                                                                                                                                                         
CreationTimestamp:      Thu, 08 Jul 2021 06:44:20 +0530                                                                                                                                                       
Labels:                 app.kubernetes.io/component=controller                                                                                                                                                
                        app.kubernetes.io/instance=ingcontroller0                                                                                                                                             
                        app.kubernetes.io/managed-by=Helm                                                                                                                                                     
                        app.kubernetes.io/name=ingress-nginx                                                                                                                                                  
                        app.kubernetes.io/version=0.47.0                                                                                                                                                      
                        helm.sh/chart=ingress-nginx-3.34.0                                                                                                                                                    
Annotations:            deployment.kubernetes.io/revision: 2                                                                                                                                                  
                        meta.helm.sh/release-name: ingcontroller0                                                                                                                                             
                        meta.helm.sh/release-namespace: ingress-nginx                                                                                                                                         
Selector:               app.kubernetes.io/component=controller,app.kubernetes.io/instance=ingcontroller0,app.kubernetes.io/name=ingress-nginx                                                                 
Replicas:               1 desired | 1 updated | 1 total | 1 available | 0 unavailable                                                                                                                         
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:           app.kubernetes.io/component=controller
                    app.kubernetes.io/instance=ingcontroller0
                    app.kubernetes.io/name=ingress-nginx
  Annotations:      prometheus.io/port: 10254
                    prometheus.io/scrape: true
  Service Account:  ingcontroller0-ingress-nginx
  Containers:
   controller:
    Image:       k8s.gcr.io/ingress-nginx/controller:v0.47.0@sha256:a1e4efc107be0bb78f32eaec37bef17d7a0c81bec8066cdf2572508d21351d0b
    Ports:       80/TCP, 443/TCP, 10254/TCP, 8443/TCP
    Host Ports:  0/TCP, 0/TCP, 0/TCP, 0/TCP
    Args:
      /nginx-ingress-controller
      --publish-service=$(POD_NAMESPACE)/ingcontroller0-ingress-nginx-controller
      --election-id=ingress-controller-leader
      --ingress-class=nginx
      --configmap=$(POD_NAMESPACE)/ingcontroller0-ingress-nginx-controller
      --validating-webhook=:8443
      --validating-webhook-certificate=/usr/local/certificates/cert
      --validating-webhook-key=/usr/local/certificates/key
    Requests:
      cpu:      100m
      memory:   90Mi
    Liveness:   http-get http://:10254/healthz delay=10s timeout=1s period=10s #success=1 #failure=5
    Readiness:  http-get http://:10254/healthz delay=10s timeout=1s period=10s #success=1 #failure=3
    Environment:
      POD_NAME:        (v1:metadata.name)
      POD_NAMESPACE:   (v1:metadata.namespace)
      LD_PRELOAD:     /usr/local/lib/libmimalloc.so
    Mounts:
      /usr/local/certificates/ from webhook-cert (ro)
  Volumes:
   webhook-cert:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  ingcontroller0-ingress-nginx-admission
    Optional:    false
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Progressing    True    NewReplicaSetAvailable
  Available      True    MinimumReplicasAvailable
OldReplicaSets:  <none>
NewReplicaSet:   ingcontroller0-ingress-nginx-controller-787ff955fd (1/1 replicas created)
Events:          <none>

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 16, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @longwuyuan. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 16, 2021
@longwuyuan longwuyuan changed the title fix for #7197 & #7285 fix for prometheus & grafana usage docs Jul 16, 2021
@longwuyuan longwuyuan changed the title fix for prometheus & grafana usage docs prometheus & grafana - fix for usage docs Jul 16, 2021
@rikatz
Copy link
Contributor

rikatz commented Jul 16, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 16, 2021
Comment on lines 32 to 38
controller:
metrics:
enabled: true
service:
annotations:
prometheus.io/port: "10254"
prometheus.io/scrape: "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this aligned?

Maybe

Suggested change
controller:
metrics:
enabled: true
service:
annotations:
prometheus.io/port: "10254"
prometheus.io/scrape: "true"
controller:
metrics:
enabled: true
service:
annotations:
prometheus.io/port: "10254"
prometheus.io/scrape: "true"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indented as suggested

@rikatz
Copy link
Contributor

rikatz commented Jul 16, 2021

@longwuyuan this documentation is really good!

Overall LGTM, just that really small nit about yaml alignment

/approve
Once you fix this, we can lgtm

Thanks!

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2021
@longwuyuan
Copy link
Contributor Author

longwuyuan commented Jul 16, 2021 via email

@rikatz
Copy link
Contributor

rikatz commented Jul 16, 2021

/lgtm
Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 16, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: longwuyuan, rikatz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 9e274dd into kubernetes:main Jul 16, 2021
@longwuyuan longwuyuan deleted the 7197-7285 branch July 26, 2021 04:58
@tao12345666333 tao12345666333 mentioned this pull request Aug 26, 2021
8 tasks
rchshld pushed a commit to joomcode/ingress-nginx that referenced this pull request May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
3 participants