Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

nginx-meshctl fails on NGINX Ingress Controller CRDs #79

Open
@darkn3rd

Description

@darkn3rd

When using manual injection with nginx-meshctl inject, there will be an error

STEPS

cat << EOF > manifests.yaml
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: dgraph
    chart: raw-v0.2.5
    component: ratel
    heritage: Helm
    release: ratel
  name: dgraph-ratel
spec:
  ports:
  - name: http-ratel
    port: 80
    targetPort: 8000
  selector:
    app: dgraph
    component: ratel
  type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: raw
    chart: raw-v0.2.5
    heritage: Helm
    release: ratel
  name: dgraph-ratel
spec:
  replicas: 1
  selector:
    matchLabels:
      app: dgraph
      component: ratel
  template:
    metadata:
      labels:
        app: dgraph
        component: ratel
    spec:
      containers:
      - command:
        - dgraph-ratel
        image: docker.io/dgraph/ratel:v21.03.2
        imagePullPolicy: null
        name: dgraph-ratel
        ports:
        - containerPort: 8000
          name: http-ratel
---
apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
  labels:
    app: raw
    chart: raw-v0.2.5
    heritage: Helm
    release: ratel
  name: dgraph-http
spec:
  externalDNS:
    enable: true
  host: ratel.devopsstudio.co
  routes:
  - action:
      pass: ratel
    path: /
  tls:
    cert-manager:
      cluster-issuer: letsencrypt-prod
    secret: tls-secret
  upstreams:
  - name: ratel
    port: 80
    service: dgraph-ratel
EOF 

cat manifest.yaml | nginx-meshctl inject

EXPECT RESULT

There wouldn't be an error for CRDs that are used by NGINX Ingress Controller like VirtualServer

ACTUAL RESULT

Cannot inject NGINX Service Mesh sidecar.
Error: NGINX Service Mesh returned an internal server error: error decoding file into k8s object: no kind "VirtualServer" is registered for version "k8s.nginx.org/v1" in scheme "k8s.io/client-go/kubernetes/scheme/register.go:74

NOTES/CONTEXT

I typically use helm template blah | nginx-meshctl inject or helmfile template | nginx-meshctl inject. These have a variety of resources created. With this limitation, I have to create multiple charts or helmfiles to segregate out the NGINX IC CRDs that cause errors.

NGINX tools should APIs created by NGINX.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions