{"action":"closed","issue":{"url":"https://api.github.com/repos/F5Networks/k8s-bigip-ctlr/issues/353","repository_url":"https://api.github.com/repos/F5Networks/k8s-bigip-ctlr","labels_url":"https://api.github.com/repos/F5Networks/k8s-bigip-ctlr/issues/353/labels{/name}","comments_url":"https://api.github.com/repos/F5Networks/k8s-bigip-ctlr/issues/353/comments","events_url":"https://api.github.com/repos/F5Networks/k8s-bigip-ctlr/issues/353/events","html_url":"https://github.com/F5Networks/k8s-bigip-ctlr/issues/353","id":260769212,"number":353,"title":"Invalid YAML crashes k8s-bigip-ctlr?","user":{"login":"hickey","id":39609,"avatar_url":"https://avatars3.githubusercontent.com/u/39609?v=4","gravatar_id":"","url":"https://api.github.com/users/hickey","html_url":"https://github.com/hickey","followers_url":"https://api.github.com/users/hickey/followers","following_url":"https://api.github.com/users/hickey/following{/other_user}","gists_url":"https://api.github.com/users/hickey/gists{/gist_id}","starred_url":"https://api.github.com/users/hickey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hickey/subscriptions","organizations_url":"https://api.github.com/users/hickey/orgs","repos_url":"https://api.github.com/users/hickey/repos","events_url":"https://api.github.com/users/hickey/events{/privacy}","received_events_url":"https://api.github.com/users/hickey/received_events","type":"User","site_admin":false},"labels":[{"id":557051582,"url":"https://api.github.com/repos/F5Networks/k8s-bigip-ctlr/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":{"login":"f5gary","id":17933949,"avatar_url":"https://avatars0.githubusercontent.com/u/17933949?v=4","gravatar_id":"","url":"https://api.github.com/users/f5gary","html_url":"https://github.com/f5gary","followers_url":"https://api.github.com/users/f5gary/followers","following_url":"https://api.github.com/users/f5gary/following{/other_user}","gists_url":"https://api.github.com/users/f5gary/gists{/gist_id}","starred_url":"https://api.github.com/users/f5gary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f5gary/subscriptions","organizations_url":"https://api.github.com/users/f5gary/orgs","repos_url":"https://api.github.com/users/f5gary/repos","events_url":"https://api.github.com/users/f5gary/events{/privacy}","received_events_url":"https://api.github.com/users/f5gary/received_events","type":"User","site_admin":false},"assignees":[{"login":"f5gary","id":17933949,"avatar_url":"https://avatars0.githubusercontent.com/u/17933949?v=4","gravatar_id":"","url":"https://api.github.com/users/f5gary","html_url":"https://github.com/f5gary","followers_url":"https://api.github.com/users/f5gary/followers","following_url":"https://api.github.com/users/f5gary/following{/other_user}","gists_url":"https://api.github.com/users/f5gary/gists{/gist_id}","starred_url":"https://api.github.com/users/f5gary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f5gary/subscriptions","organizations_url":"https://api.github.com/users/f5gary/orgs","repos_url":"https://api.github.com/users/f5gary/repos","events_url":"https://api.github.com/users/f5gary/events{/privacy}","received_events_url":"https://api.github.com/users/f5gary/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2017-09-26T21:02:33Z","updated_at":"2017-10-27T18:43:33Z","closed_at":"2017-10-27T18:43:33Z","author_association":"NONE","body":"In the process of working with the Container Connector, I just applied a new YAML definition and had the k8s-bigip-ctlr container exit out. Below is the log output that was generated when applying the updated YAML definition for an existing job was updated. \r\n\r\n````\r\n2017/09/26 20:29:42 [INFO] Wrote 6 Virtual Server configs\r\n2017/09/26 20:30:00 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:30:30 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:31:00 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:31:30 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:32:00 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:32:30 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:33:00 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:33:30 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:34:00 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:34:30 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:35:00 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:35:22 [INFO] Wrote 5 Virtual Server configs\r\n2017/09/26 20:35:30 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:35:53 [INFO] Ports for service 'znc-irc' have not been found.\r\n2017/09/26 20:35:53 [INFO] Service 'znc-irc' has not been found.\r\n2017/09/26 20:36:00 [WARNING] Could not get config for ConfigMap: znc-https-lb - configMap is not valid, errors: [\"method: Additional property method is not allowed\"]\r\n2017/09/26 20:36:00 [INFO] Ports for service 'znc-irc' have not been found.\r\n2017/09/26 20:36:00 [INFO] Service 'znc-irc' has not been found.\r\nE0926 20:36:00.214036       7 runtime.go:66] Observed a panic: \"index out of range\" (runtime error: index out of range)\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:72\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:65\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:51\r\n/usr/local/go/src/runtime/asm_amd64.s:479\r\n/usr/local/go/src/runtime/panic.go:458\r\n/usr/local/go/src/runtime/panic.go:27\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:1027\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:708\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:625\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:613\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:566\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:96\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:97\r\n/build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:52\r\n/usr/local/go/src/runtime/asm_amd64.s:2086\r\npanic: runtime error: index out of range [recovered]\r\n        panic: runtime error: index out of range\r\n\r\ngoroutine 85 [running]:\r\npanic(0x12603a0, 0xc4200180a0)\r\n        /usr/local/go/src/runtime/panic.go:500 +0x1a1\r\ngithub.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:58 +0x126\r\npanic(0x12603a0, 0xc4200180a0)\r\n        /usr/local/go/src/runtime/panic.go:458 +0x243\r\ngithub.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager.(*Manager).handleConfigForType(0xc4200ee2d0, 0xc420300d80, 0xc42085a120, 0x7, 0xc42085a0fa, 0x3, 0xc4204fac60, 0xc4209027a0, 0x12, 0xc4208e9b20, ...)\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:1027 +0xa25\r\ngithub.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager.(*Manager).syncVirtualServer(0xc4200ee2d0, 0xc42085a120, 0x7, 0xc42085a0fa, 0x3, 0x0, 0x0)\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:708 +0x675\r\ngithub.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager.(*Manager).processNextVirtualServer(0xc4200ee2d0, 0xc420545600)\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:625 +0x147\r\ngithub.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager.(*Manager).virtualServerWorker(0xc4200ee2d0)\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:613 +0x2b\r\ngithub.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager.(*Manager).(github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager.virtualServerWorker)-fm()\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:566 +0x2a\r\ngithub.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc42046e4b0)\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:96 +0x5e\r\ngithub.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc42046e4b0, 0x3b9aca00, 0x0, 0x1, 0xc42000ca80)\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:97 +0xad\r\ngithub.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait.Until(0xc42046e4b0, 0x3b9aca00, 0xc42000ca80)\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:52 +0x4d\r\ncreated by github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager.(*Manager).runImpl\r\n        /build/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:566 +0x150\r\n````\r\n\r\nThe following is the updated YAML that was being applied. The major different here being that the 443 port was being added to the Deployment, Service and the second ConfigMap was being created. \r\n\r\n````yaml\r\n---\r\napiVersion: apps/v1beta1\r\nkind: Deployment\r\nmetadata:\r\n  name: znc-deployment\r\n  namespace: default\r\nspec:\r\n  replicas: 1\r\n  strategy:\r\n    type: Recreate\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: znc\r\n    spec:\r\n      containers:\r\n      - name: znc\r\n        image: hickey/znc:latest\r\n        ports:\r\n        - name: znc-irc\r\n          containerPort: 6697\r\n          protocol: TCP\r\n        - name: znc-https\r\n          containerPort: 443\r\n          protocol: TCP\r\n        volumeMounts:\r\n        - name: znc-config-volume\r\n          mountPath: /znc-data\r\n      volumes:\r\n      - name: znc-config-volume\r\n        persistentVolumeClaim:\r\n          claimName: znc-config-claim\r\n---\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: znc\r\nspec:\r\n  type: NodePort\r\n  ports:\r\n  - name: znc-irc\r\n    port: 6697\r\n    protocol: TCP\r\n    targetPort: 6697\r\n  - name: znc-https\r\n    port: 443\r\n    protocol: TCP\r\n    targetPort: 443\r\n  selector:\r\n    app: znc\r\n---\r\nkind: ConfigMap\r\napiVersion: v1\r\nmetadata:\r\n  name: znc-irc-lb\r\n  namespace: default\r\n  labels:\r\n    f5type: virtual-server\r\ndata:\r\n  schema: \"f5schemadb://bigip-virtual-server_v0.1.3.json\"\r\n  data: |-\r\n    {\r\n      \"virtualServer\": {\r\n        \"frontend\": {\r\n          \"balance\": \"round-robin\",\r\n          \"mode\": \"tcp\",\r\n          \"partition\": \"kubernetes\",\r\n          \"virtualAddress\": {\r\n            \"bindAddr\": \"10.4.7.32\",\r\n            \"port\": 6697\r\n          }\r\n        },\r\n        \"backend\": {\r\n          \"serviceName\": \"znc-irc\",\r\n          \"servicePort\": 6697,\r\n          \"healthMonitors\": [{\r\n            \"interval\": 30,\r\n            \"protocol\": \"tcp\"\r\n          }]\r\n        }\r\n      }\r\n    }\r\n---\r\nkind: ConfigMap\r\napiVersion: v1\r\nmetadata:\r\n  name: znc-https-lb\r\n  namespace: default\r\n  labels:\r\n    f5type: virtual-server\r\ndata:\r\n  schema: \"f5schemadb://bigip-virtual-server_v0.1.3.json\"\r\n  data: |-\r\n    {\r\n      \"virtualServer\": {\r\n        \"frontend\": {\r\n          \"balance\": \"round-robin\",\r\n          \"mode\": \"http\",\r\n          \"partition\": \"kubernetes\",\r\n          \"virtualAddress\": {\r\n            \"bindAddr\": \"10.4.7.32\",\r\n            \"port\": 443\r\n          }\r\n        },\r\n        \"backend\": {\r\n          \"serviceName\": \"znc-https\",\r\n          \"servicePort\": 443,\r\n          \"healthMonitors\": [{\r\n            \"interval\": 30,\r\n            \"protocol\": \"http\",\r\n            \"method\": \"GET\"\r\n          }]\r\n        }\r\n      }\r\n    }\r\n````\r\n\r\nAdmittedly there is a problem with the health check on port 443 that needs to be corrected, but invalid YAML should not take down the k8s-bigip-ctlr container. At the same time errors that cause a panic should be caught and meaningful error messages should be emitted. "}}
{"actor":{"display_login":"hickey"}}