-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
external: create a configmap for the command line args #14354
Conversation
I have only added the arguments that has some value
|
adeffaa
to
d5cafa2
Compare
d5cafa2
to
ec53413
Compare
@BlaineEXE For the command output in config map, Which way we should output: Lets say command is: python3 a.py --abc 123 --pqr 456
"abc": 123 |
In order to facilitate user ease of use, I think it makes most sense to store things in a format that is immediately usable without users having to do anything. For storing configs based on CLI flags, I think it makes the most sense to store them in flag form like Assuming work is completed to implement config file support, we can instead output a generated config file, which might be more legible like your second example but still easily usable. |
8b59879
to
9560cdf
Compare
Output: {"name": "external-cluster-user-command", "kind": "ConfigMap", "data": {"data": "--rbd-data-pool-name replicapool"}} |
Do we need any upstream doc updates for this? |
9560cdf
to
feaf661
Compare
@BlaineEXE that was a good reminder, So I even created the configmap in the import script that upstream uses. And then I realised we haven't document on, if we need to upgrade and utilise new feature we need to re-run the script, so I need to draw a attention first on how to utilise new flag on a brow field cluster, so I am creating a new issue in which I will document the same and also add about the command line args configmap |
"$EXTERNAL_COMMAND_CONFIGMAP_NAME" \ | ||
--from-literal=command="$EXTERNAL_CLUSTER_USER_COMMAND" \ | ||
else | ||
echo "configmap $EXTERNAL_COMMAND_CONFIGMAP_NAME already exists" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it already exists, should we assume that this is a re-run with an update? In that case I think the tool should update the existing cm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That correct we need to patch it, thanks
feaf661
to
6ab769b
Compare
"$EXTERNAL_COMMAND_CONFIGMAP_NAME" \ | ||
--from-literal=command="$EXTERNAL_CLUSTER_USER_COMMAND" | ||
else | ||
echo "configmap $EXTERNAL_COMMAND_CONFIGMAP_NAME already exists, update it" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users may interpret "update it" to mean that they need to take action.
echo "configmap $EXTERNAL_COMMAND_CONFIGMAP_NAME already exists, update it" | |
echo "configmap $EXTERNAL_COMMAND_CONFIGMAP_NAME already exists, updating it" |
$KUBECTL -n "$NAMESPACE" patch configmap "$EXTERNAL_COMMAND_CONFIGMAP_NAME" \ | ||
-p "{'data':{'command':$EXTERNAL_COMMAND_CONFIGMAP_NAME}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to be consistent with formatting. The $KUBECTL create X Y --vals
commands elsewhere all use the format below. Let's do the same for this patch
command to keep consistency.
$KUBECTL -n "$NAMESPACE" \
create \
X \
Y \
--vals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
user can look back to there configurations by looking at the configmap created with command line arguments This will be useful for them during upgrades when they need to re run the python script with the same flags Signed-off-by: parth-gr <partharora1010@gmail.com>
6ab769b
to
951c683
Compare
@parth-gr What upstream documentation can we update so users will be aware of this new feature? |
user can look back to there configurations by
looking at the configmap created with command
line arguments
This will be useful for them during upgrades when they need to re run the python script with the same flags
Checklist: