{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/ingress/issues/83","repository_url":"https://api.github.com/repos/kubernetes/ingress","labels_url":"https://api.github.com/repos/kubernetes/ingress/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/ingress/issues/83/comments","events_url":"https://api.github.com/repos/kubernetes/ingress/issues/83/events","html_url":"https://github.com/kubernetes/ingress/issues/83","id":197186126,"number":83,"title":"Adding flags from specific backend implementation","user":{"login":"21stio","id":17232576,"avatar_url":"https://avatars.githubusercontent.com/u/17232576?v=3","gravatar_id":"","url":"https://api.github.com/users/21stio","html_url":"https://github.com/21stio","followers_url":"https://api.github.com/users/21stio/followers","following_url":"https://api.github.com/users/21stio/following{/other_user}","gists_url":"https://api.github.com/users/21stio/gists{/gist_id}","starred_url":"https://api.github.com/users/21stio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/21stio/subscriptions","organizations_url":"https://api.github.com/users/21stio/orgs","repos_url":"https://api.github.com/users/21stio/repos","events_url":"https://api.github.com/users/21stio/events{/privacy}","received_events_url":"https://api.github.com/users/21stio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-22T14:28:08Z","updated_at":"2017-01-24T14:42:25Z","closed_at":null,"body":"Hey, \r\n\r\nwe are implementing our own version of the ingress controller right now. We would like to add some additional flags, but we can't find any way to accomplish it without touching the generic code.\r\n\r\nWe added the `SetFlags` function to the generic launch.go\r\n\r\n```\r\nfunc SetFlags(flags *pflag.FlagSet) {\r\n\tdefaultSvc = flags.String(\"default-backend-service\", \"\",\r\n\t\t`Service used to serve a 404 page for the default backend. Takes the form\r\n    namespace/name. The controller uses the first node port of this Service for\r\n    the default backend.`)\r\n\r\n\tingressClass = flags.String(\"ingress-class\", \"\",\r\n\t\t`Name of the ingress class to route through this controller.`)\r\n\r\n\tconfigMap = flags.String(\"configmap\", \"\",\r\n\t\t`Name of the ConfigMap that contains the custom configuration to use`)\r\n\r\n\tpublishSvc = flags.String(\"publish-service\", \"\",\r\n\t\t`Service fronting the ingress controllers. Takes the form\r\n\t namespace/name. The controller will set the endpoint records on the\r\n\t ingress objects to reflect those on the service.`)\r\n\r\n\ttcpConfigMapName = flags.String(\"tcp-services-configmap\", \"\",\r\n\t\t`Name of the ConfigMap that contains the definition of the TCP services to expose.\r\n\tThe key in the map indicates the external port to be used. The value is the name of the\r\n\tservice with the format namespace/serviceName and the port of the service could be a\r\n\tnumber of the name of the port.\r\n\tThe ports 80 and 443 are not allowed as external ports. This ports are reserved for the backend`)\r\n\r\n\tudpConfigMapName = flags.String(\"udp-services-configmap\", \"\",\r\n\t\t`Name of the ConfigMap that contains the definition of the UDP services to expose.\r\n\tThe key in the map indicates the external port to be used. The value is the name of the\r\n\tservice with the format namespace/serviceName and the port of the service could be a\r\n\tnumber of the name of the port.`)\r\n\r\n\tresyncPeriod = flags.Duration(\"sync-period\", 60*time.Second,\r\n\t\t`Relist and confirm cloud resources this often.`)\r\n\r\n\twatchNamespace = flags.String(\"watch-namespace\", api.NamespaceAll,\r\n\t\t`Namespace to watch for Ingress. Default is to watch all namespaces`)\r\n\r\n\thealthzPort = flags.Int(\"healthz-port\", 10254, \"port for healthz endpoint.\")\r\n\r\n\tprofiling = flags.Bool(\"profiling\", true, `Enable profiling via web interface host:port/debug/pprof/`)\r\n\r\n\tdefSSLCertificate = flags.String(\"default-ssl-certificate\", \"\", `Name of the secret\r\n\t\tthat contains a SSL certificate to be used as default for a HTTPS catch-all server`)\r\n\r\n\tdefHealthzURL = flags.String(\"health-check-path\", \"/healthz\", `Defines\r\n\t\tthe URL to be used as health check inside in the default server in NGINX.`)\r\n\r\n\tk8sClientConfig = kubectl_util.DefaultClientConfig(flags)\r\n}\r\n```\r\n\r\nand call it in our main.go\r\n```go\r\nvar (\r\n\tflags *pflag.FlagSet\r\n\treloadCommand *string\r\n\twebhookEndpoint *string\r\n\ttemplateFile *string\r\n\toutputFile *string\r\n)\r\n\r\n\r\n\r\nfunc init()  {\r\n\tflags = pflag.NewFlagSet(\"\", pflag.ExitOnError)\r\n\treloadCommand = flags.String(\"ReloadCommand\", \"nginx -s reload\", \"Command that will be triggered whenever the nginx configuration changes\")\r\n\twebhookEndpoint = flags.String(\"WebhookEndpoint\", \"http://127.0.0.1:8888/set\", \"Webhook that will be notified whenever new endpoints are added\")\r\n\ttemplateFile = flags.String(\"TemplateFile\", \"/etc/nginx/nginx.tmpl\", \"Template to be rendered\")\r\n\toutputFile = flags.String(\"OutputFile\", \"/etc/nginx/nginx.conf\", \"Location of rendered template\")\r\n\r\n\tcontroller.SetFlags(flags)\r\n\r\n\tflags.AddGoFlagSet(flag.CommandLine)\r\n\tflags.Parse(os.Args)\r\n}\r\n```\r\n\r\nDo you know of any way to do it in a more elegant fashion? We tried a lot things, but I either wipes the generic flags or all..\r\n\r\nAny ideas?\r\n\r\nBest regards"},"comment":{"url":"https://api.github.com/repos/kubernetes/ingress/issues/comments/274821840","html_url":"https://github.com/kubernetes/ingress/issues/83#issuecomment-274821840","issue_url":"https://api.github.com/repos/kubernetes/ingress/issues/83","id":274821840,"user":{"login":"21stio","id":17232576,"avatar_url":"https://avatars.githubusercontent.com/u/17232576?v=3","gravatar_id":"","url":"https://api.github.com/users/21stio","html_url":"https://github.com/21stio","followers_url":"https://api.github.com/users/21stio/followers","following_url":"https://api.github.com/users/21stio/following{/other_user}","gists_url":"https://api.github.com/users/21stio/gists{/gist_id}","starred_url":"https://api.github.com/users/21stio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/21stio/subscriptions","organizations_url":"https://api.github.com/users/21stio/orgs","repos_url":"https://api.github.com/users/21stio/repos","events_url":"https://api.github.com/users/21stio/events{/privacy}","received_events_url":"https://api.github.com/users/21stio/received_events","type":"User","site_admin":false},"created_at":"2017-01-24T14:42:25Z","updated_at":"2017-01-24T14:42:25Z","body":"Still an issue.."}}
{"actor":{"display_login":"21stio"}}