Skip to content
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

Confluence DC depends on RBAC to work #1

Open
hoeghh opened this issue Mar 2, 2020 · 0 comments
Open

Confluence DC depends on RBAC to work #1

hoeghh opened this issue Mar 2, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@hoeghh
Copy link
Contributor

hoeghh commented Mar 2, 2020

When using Confluence DC the entry point script depends on RBAC to be enabled. If its not possible to implement without, this is ok, but there is a way that doesnt depend on RBAC.

I've tested it with multitool.

kubectl create deployment multitool --image=praqma/network-multitool 
kubectl scale deployment multitool --replicas=3

echo "apiVersion: v1
kind: Service
metadata:
  labels:
    app: multitool
  name: multitool
  namespace: default
spec:
  clusterIP: "None"
  selector:
    app: multitool
  type: ClusterIP
status:
  loadBalancer: {}
" > multitool-service.yaml

kubectl apply -f multitool-service.yaml

kubectl exec -it multitool-7885b5f94f-6kjll bash

host multitool | grep has | cut -d " " -f 4 | tr "\n" "," | sed -e 's/,$//'

The above will give us

10.42.1.32,10.42.1.31,10.42.0.27

If we scale it down again to 1, and run the host command, it still works

10.42.0.27

In the file docker-entrypoint.sh at line 149 we use curl to get healthy endpoints from the api server, though this requires rabc permissions to do so.

CLUSTER_PEER_IPS=$(curl -sSk -H "Authorization: Bearer $KUBE_TOKEN" https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/${CONFLUENCE_NAMESPACE}/endpoints/${CONFLUENCE_SERVICE_NAME} | jq -r .subsets[].addresses[].ip | paste -sd "," -)

It could be replaced with something like

host $CONFLUENCE_SERVICE_NAME | grep has | cut -d " " -f 4 | tr "\n" "," | sed -e 's/,$//'

Much more elegant, and with not RBAC needed.

@hoeghh hoeghh added the enhancement New feature or request label Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants