Comments (5)
Okay, I'll try to be more precise.
When a service definition and the corresponding deployment is in the same YAML file, kube-linter is able to find both.
But if both definitions are split into two separate YAML files (e.g. services.yaml and deployment.yaml), kube-linter prints that the dangling-service
check was not successful for that service, because it can't find a corresponding deployment.
So, it would be a super cool feature, if kube-linter could take care of different YAML files. But I know, this isn't easy.
from kube-linter.
Well, it works. Did some mistake on my side. Can be closed. Thanks for you time.
from kube-linter.
Hi @mstoetzer , I am not exactly sure about what is the request here. Do you mean that we should have a check to make sure we have yaml file per each k8s component in the application? And also to your second point, do you mean that we should make sure all relevant yaml definitions are in the same directory?
It will be the easiest for both of us if you could specify some expected input and output, and what is the current behavior vs/. expected behavior:)
We should probably have a template on filing issues moving forwards, and let me work on that in the mean time.
from kube-linter.
Hi @mstoetzer, kube-linter
actually already does this -- it treats objects found in the same directory as belonging to the same "context", and lints them as a unit. So what you're asking for should already work.
Consider this example. Let's say you have deployment.yaml
with the below:
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
namespace: test-ns
spec:
selector:
matchLabels:
app: test
template:
metadata:
namespace: test-ns
labels:
app: test
spec:
containers:
- name: nginx
image: nginx
ports:
- name: api
containerPort: 8443
and service.yaml
with the below:
apiVersion: v1
kind: Service
metadata:
name: test
namespace: test-ns
spec:
ports:
- name: https
port: 443
targetPort: api
selector:
app: test
type: ClusterIP
in the same directory. If you run kube-linter lint .
or kube-linter lint *
in that directory, you should not see the dangling-service
check fire. I just verified this locally as well.
from kube-linter.
Hi @mstoetzer, just wanted to check in on this. Did the above work for you?
from kube-linter.
Related Issues (20)
- [BUG] Some releases are not published on pkg.go.dev HOT 1
- [BUG]: annotation `ignore-check.kube-linter.io/access-to-secrets` does not work HOT 1
- [BUG] failed to decode: no kind "Pipeline" is registered for version "tekton.dev/v1beta1" HOT 1
- [FEATURE_REQUEST] Support HPA maxReplicas HOT 2
- [FEATURE_REQUEST] Support Restart Policy
- [BUG] Linter reporting a low number of replicas for deployments with PDB and HPA minReplicas HOT 4
- Golang Plugins for kube-linter HOT 5
- [FEATURE_REQUEST] Add OpenShift SecurityContextConstraints
- [FEATURE_REQUEST] Explicit check for `securityContext.allowPrivilegeEscalation=false` on containers
- [Bug] no pods found matching service labels
- [BUG] Release assets name HOT 1
- [FEATURE_REQUEST] Common target platforms (ie: linux/arm64)
- Change unset-cpu-requirements check
- Change unset-memory-requirements check
- [BUG] - since v0.6.6 linting from stdin doesn't work anymore with the command: kube-linter lint -
- [FEATURE_REQUEST] EnvVar ValueFrom checks
- [FEATURE_REQUEST] Merge arbitrary values.yaml when checking a helm chart
- [BUG] - service has no selector specified raised when using Endpoint
- [FEATURE_REQUEST] Expand `run-as-non-root` template to verify `runAsGroup` field is nonzero.
- Include line and column number ranges for errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kube-linter.