planetscale/vitess-operator

Help Finding Docs related to operator arguments and env

Closed this issue · 5 comments

Hi! I comes from vitess sites and currently proof-reading examples operator for Deploy Kubernetes. In short, I find there are some ENV and Args for a vitess-operator deployment in operator.yaml.

I tried to search any API documentation, but those all just related to CRDs, not the operator itself. For arguments, I actually could execute vitess-operator --help in container shell, but I believe this is not a best practice, I also not wish to dig into the code itself. And there are also ENV already defined in the yaml.

containers:
  - args:
      - --logtostderr
      - -v=4
    command:
      - vitess-operator
    env:
      - name: WATCH_NAMESPACE
        valueFrom:
          fieldRef:
            fieldPath: metadata.namespace
      - name: POD_NAME
        valueFrom:
          fieldRef:
            fieldPath: metadata.name
      - name: PS_OPERATOR_POD_NAMESPACE
        valueFrom:
          fieldRef:
            fieldPath: metadata.namespace
      - name: PS_OPERATOR_POD_NAME
        valueFrom:
          fieldRef:
            fieldPath: metadata.name
      - name: OPERATOR_NAME
        value: vitess-operator
    image: planetscale/vitess-operator:v2.13.0

My question, Is there any official documentation regarding vitess-operator arguments and the ENV variables? Or maybe something like types.d.ts but for Go. I mean I don't want to dig it too deeper into the code just to know the Env and Args, and doing --help directly is still not a best practice.

I do not think there is any official documentation regarding its arguments or the ENV variables.

You can always run the following command to get the --help output:

$> docker run --platform="linux/amd64" -it --entrypoint /bin/sh planetscale/vitess-operator:v2.13.0  
sh-4.4$ vitess-operator --help

I still think it is not best practice to knowing about a containerized app directly by executing a binary inside it. But, Alright, I still need to know how to maximize these ENV variables,a dn what others ENV can I used.

Second, I find this in this repository:

# Please refer to the operator documentation for recommendations on

# The following example is minimalist. The security policies
# and resource specifications are not meant to be used in production.
# Please refer to the operator documentation for recommendations on
# production settings.

I believe this repo IS the operator's documentation. So where is it? I expect it looks like an examples file that define "this is exactly why we means by security in production". I know and already read ./doc/api.md and read overall of it, I just by that line, I expect it give some example. I think the operator binary (not CRDs) is lack of documentation.

@FarhanMS123 you can specify any ENV vars. Whether or not those ENV vars are used by the binary executed within the container depends on the binary. For example, mysqld supports a host of ENV variables and you could specify any of those for the tablet pod which would then get passed on to the mysql container. If you want to know what ones the operator itself uses, you can look at the operator.yml source file which you already highlighted.

This is an open source project and any documentation enhancements would be most welcome. I agree that the current documentation is lacking in a variety of ways. Thanks!

This is an open source project and any documentation enhancements would be most welcome. I agree that the current documentation is lacking in a variety of ways. Thanks!

Totally, we are lacking documentation on this project.

Alright. I just need a confirmation. Thankyou for your help. And best regards for this projects. This project is a really big help for me.