alpine-docker / k8s

All-In-One Kubernetes tools (kubectl, helm, iam-authenticator, eksctl, etc)
MIT License
211 stars 89 forks source link

Add kubeconform #70

Closed caleb-devops closed 1 year ago

caleb-devops commented 1 year ago

Closes #69

ozbillwang commented 1 year ago

@caleb-devops

I have built the image locally, any commands with kubeconform I can run for a quick test?

updates

let me try the script validate.sh

update 2

looks fine to me

$ docker run -ti --rm alpine/k8s:1.28.4 bash
bash-5.1# git clone https://github.com/fluxcd/flux2-kustomize-helm-example.git
bash-5.1# cd flux2-kustomize-helm-example/
bash-5.1# ./scripts/validate.sh
INFO - Downloading Flux OpenAPI schemas
INFO - Validating ./.github/workflows/e2e.yaml
INFO - Validating ./.github/workflows/test.yaml
INFO - Validating ./apps/base/podinfo/kustomization.yaml
INFO - Validating ./apps/base/podinfo/release.yaml
INFO - Validating ./apps/base/podinfo/namespace.yaml
INFO - Validating ./apps/base/podinfo/repository.yaml
INFO - Validating ./apps/staging/kustomization.yaml
INFO - Validating ./apps/staging/podinfo-values.yaml
INFO - Validating ./apps/production/kustomization.yaml
INFO - Validating ./apps/production/podinfo-values.yaml
INFO - Validating ./clusters/staging/flux-system/kustomization.yaml
INFO - Validating ./clusters/staging/flux-system/gotk-sync.yaml
INFO - Validating ./clusters/staging/flux-system/gotk-components.yaml
INFO - Validating ./clusters/staging/infrastructure.yaml
INFO - Validating ./clusters/staging/apps.yaml
INFO - Validating ./clusters/production/flux-system/kustomization.yaml
INFO - Validating ./clusters/production/flux-system/gotk-sync.yaml
INFO - Validating ./clusters/production/flux-system/gotk-components.yaml
INFO - Validating ./clusters/production/infrastructure.yaml
INFO - Validating ./clusters/production/apps.yaml
INFO - Validating ./infrastructure/controllers/kustomization.yaml
INFO - Validating ./infrastructure/controllers/ingress-nginx.yaml
INFO - Validating ./infrastructure/controllers/weave-gitops.yaml
INFO - Validating ./infrastructure/controllers/cert-manager.yaml
INFO - Validating ./infrastructure/configs/kustomization.yaml
INFO - Validating ./infrastructure/configs/network-policies.yaml
INFO - Validating ./infrastructure/configs/cluster-issuers.yaml
INFO - Validating clusters
./clusters/staging/infrastructure.yaml - Kustomization infra-controllers is valid
./clusters/staging/infrastructure.yaml - Kustomization infra-configs is valid
./clusters/staging/apps.yaml - Kustomization apps is valid
./clusters/production/infrastructure.yaml - Kustomization infra-controllers is valid
./clusters/production/infrastructure.yaml - Kustomization infra-configs is valid
./clusters/production/apps.yaml - Kustomization apps is valid
INFO - Validating kustomize overlays
INFO - Validating kustomization ./apps/base/podinfo/
stdin - HelmRepository podinfo is valid
stdin - HelmRelease podinfo is valid
stdin - Namespace podinfo is valid
INFO - Validating kustomization ./apps/staging/
stdin - HelmRepository podinfo is valid
stdin - HelmRelease podinfo is valid
stdin - Namespace podinfo is valid
INFO - Validating kustomization ./apps/production/
stdin - HelmRepository podinfo is valid
stdin - HelmRelease podinfo is valid
stdin - Namespace podinfo is valid
INFO - Validating kustomization ./clusters/staging/flux-system/
INFO - Validating kustomization ./clusters/production/flux-system/
INFO - Validating kustomization ./infrastructure/controllers/
stdin - HelmRelease cert-manager is valid
stdin - HelmRelease ingress-nginx is valid
stdin - HelmRelease weave-gitops is valid
stdin - Namespace ingress-nginx is valid
stdin - Namespace cert-manager is valid
stdin - HelmRepository cert-manager is valid
stdin - HelmRepository ingress-nginx is valid
stdin - HelmRepository weave-gitops is valid
INFO - Validating kustomization ./infrastructure/configs/
stdin - letsencrypt ClusterIssuer skipped
stdin - NetworkPolicy weave-gitops-ingress is valid
bash-5.1#