--- - hosts: "{{ hostname | default('controller') }}" vars: kubectl: "minikube kubectl -- " # Prometheus Operator https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/getting-started/installation.md # To get Prometheus Operator version # curl -s https://api.github.com/repos/prometheus-operator/prometheus-operator/releases/latest | jq -cr .tag_name prometheus_operator: https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.80.1/bundle.yaml tasks: # TODO: remove this when the last stable version doesn't use the prometheus operator - name: Install CRDs ansible.builtin.command: cmd: "{{ kubectl }} create -f {{ prometheus_operator }}" # Note: here we would like to use "apply" so that this playbook is indempotent, # unfortunately the prometheus operator resources are failing with: # "scrapeconfigs.monitoring.coreos.com" is invalid: metadata.annotations: # Too long: may not be more than 262144 bytes - name: Crete sf namespace ansible.builtin.command: cmd: "{{ kubectl }} create ns sf" - name: Set sf as the default namespace ansible.builtin.command: cmd: "{{ kubectl }} config set-context --current --namespace sf"