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

*: Generate all manifests #908

Merged
merged 1 commit into from
Oct 2, 2019
Merged

Conversation

brancz
Copy link
Member

@brancz brancz commented Oct 1, 2019

What this PR does / why we need it:

Sharding and autosharding introduced a number of manifests that are
very similar, but not identical to the standard manifests. This
introduces generating all manifests using jsonnet and moves them to
the explicit /examples directory.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes #903

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 1, 2019
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 1, 2019
Copy link
Member

@lilic lilic left a comment

Choose a reason for hiding this comment

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

We should update the RELEASE.md as well, to include steps to generate the manifests.

README.md Outdated
@@ -214,7 +214,7 @@ service account token that has read-only access to the Kubernetes cluster.

#### Kubernetes Deployment

To deploy this project, you can simply run `kubectl apply -f kubernetes` and a
To deploy this project, you can simply run `kubectl apply -f kubernetes/standard` and a
Copy link
Member

Choose a reason for hiding this comment

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

standard? Hmm we can come up with a better name I think here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Any suggestions? I haven't been able to come up with anything better, and this is the standard way to deploy kube-state-metrics.

Copy link
Member

Choose a reason for hiding this comment

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

We said we want to also since we moving it, rename the directory to examples.

@@ -1,21 +1,19 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: v1.8.0-rc.0
Copy link
Member

Choose a reason for hiding this comment

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

Should not all be v1.8.0-rc.1?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's whatever is in the VERSION file

Copy link
Member

Choose a reason for hiding this comment

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

Not true, in the file above its v1.8.0-rc.1.

@@ -1,53 +1,58 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: v1.8.0-rc.0
Copy link
Member

Choose a reason for hiding this comment

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

v1.8.0-rc.1?

"name": "kube-state-metrics",
"source": {
"local": {
"directory": "../jsonnet/kube-state-metrics"
Copy link
Member

Choose a reason for hiding this comment

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

Where is this directory? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

/jsonnet is in the root of the repo

"directory": "../jsonnet/kube-state-metrics"
}
},
"version": ""
Copy link
Member

Choose a reason for hiding this comment

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

Should we pin this to master?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's a directory based package so it will always do whatever is currently in the directory

@brancz brancz force-pushed the generate branch 4 times, most recently from f811c00 to 8754347 Compare October 1, 2019 12:06
@brancz
Copy link
Member Author

brancz commented Oct 1, 2019

Added a note to the release doc, and I believe I addressed all comments, if you have a suggestion for the name of the "standard" deployment, then I'm happy to adapt it.

Copy link
Member

@lilic lilic left a comment

Choose a reason for hiding this comment

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

When I run make examples I get some files leftover which should not be generated IMO:

	examples/autosharding/cluster-LRole-LBinding.yaml
	examples/autosharding/cluster-LRole.yaml
	examples/autosharding/role-LBinding.yaml
	examples/autosharding/service-LAccount.yaml
	examples/standard/cluster-LRole-LBinding.yaml
	examples/standard/cluster-LRole.yaml
	examples/standard/service-LAccount.yaml

- kubernetes/kube-state-metrics-deployment.yaml
- kubernetes/kube-state-metrics-service-account.yaml
- kubernetes/kube-state-metrics-service.yaml
- kubernetes/cluster-role-binding.yaml
Copy link
Member

Choose a reason for hiding this comment

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

Should this be examples?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, forgot about this one

tests/e2e.sh Outdated

trap finish EXIT

# set up kube-state-metrics manifests
kubectl create -f ./kubernetes/kube-state-metrics-service-account.yaml
kubectl create -f ./kubernetes/standard/service-account.yaml
Copy link
Member

Choose a reason for hiding this comment

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

This should be examples now here as well.

@brancz brancz force-pushed the generate branch 5 times, most recently from 1734188 to 84202ec Compare October 1, 2019 14:06
Copy link
Member

@lilic lilic left a comment

Choose a reason for hiding this comment

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

This works and looks good to me. Will let @tariq1890 do a final 👍

Sharding and autosharding introduced a number of manifests that are
very similar, but not identical to the standard manifests. This
introduces generating all manifests using jsonnet and moves them to
the explicit `/examples` directory.
Copy link
Contributor

@tariq1890 tariq1890 left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks @brancz

kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: v1.8.0-rc.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on adding this? Since these are best practices labels, it would be nice to add this to set a good example for others.

Suggested change
app.kubernetes.io/version: v1.8.0-rc.1
app.kubernetes.io/version: v1.8.0-rc.1
app.kubernetes.io/component: monitoring

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brancz, tariq1890

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 51f0b2e into kubernetes:master Oct 2, 2019
@brancz brancz deleted the generate branch October 2, 2019 12:00
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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autogenerate manifests
4 participants