-
Notifications
You must be signed in to change notification settings - Fork 385
Add server-acl-init-cleanup job #246
Conversation
66cea28
to
fb36532
Compare
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.
This looks good! I don't think the ACL init role needs access to services, unless you ran into cases when it does.
- apiGroups: [""] | ||
resources: | ||
- services | ||
verbs: | ||
- get |
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.
I'm curious why do we need services here as well?
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.
I totally don't remember adding this so I'll delete it. Good catch. But it's interesting that we actually do make one call for Services:
kubeSvc, err = c.clientset.CoreV1().Services("default").Get("kubernetes", metav1.GetOptions{})
However that must have been working before. Looking that code now, I'm not sure why it doesn't just use kubernetes.default.svc.cluster.local
instead of the IP address (which is the whole reason it's calling this in the first place).
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.
Yep, it's calling it inside the configureConnectInject
function, but the helm chart already adds services
in case connect is enabled.
This job deletes the server-acl-init job when it completes successfully. This keeps things clean and more importantly fixes the issue where if you try to make a change to the helm values that result in updating the spec for the Job that you get an error because the Job spec is immutable. If the Job is deleted then this isn't a problem. Also upgrades consul-k8s to the version with the new delete-completed-job command.
This job deletes the server-acl-init job when it completes successfully.
This keeps things clean and more importantly fixes the issue where if
you try to make a change to the helm values that result in updating the
spec for the Job that you get an error because the Job spec is
immutable. If the Job is deleted then this isn't a problem.
Also upgrades consul-k8s to the version with the new
delete-completed-job command.
Fixes #227
Needs hashicorp/consul-k8s#152