Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions hooks/playbooks/cloudkitty-pre_deploy-install_loki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: "Install loki for cloudkitty"
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
gather_facts: true
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig | default(ansible_env.HOME + '/.kube/config') }}"
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
tasks:
- name: Deploy loki operator
ansible.builtin.shell:
cmd: |
oc apply -f deploy-loki-for-ck.yaml
- name: Wait up to 5 minutes until the Loki CSV is Succeeded
ansible.builtin.shell:
cmd: |
oc get csv | grep loki-operator
ignore_errors: true
register: output
until: output.stdout_lines | length == 1 and "Succeeded" in output.stdout
retries: 30
delay: 10
136 changes: 136 additions & 0 deletions hooks/playbooks/deploy-loki-for-ck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: openshift-operators-redhat
labels:
name: openshift-operators-redhat
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: loki-operator
namespace: openshift-operators-redhat
spec:
upgradeStrategy: Default
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: loki-operator
namespace: openshift-operators-redhat
spec:
channel: stable-6.4
name: loki-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
---
# Deploys a new Namespace for the MinIO Pod
apiVersion: v1
kind: Namespace
metadata:
name: minio-dev # Change this value if you want a different namespace name
labels:
name: minio-dev # Change this value to match metadata.name
---
# Deploys a new MinIO Pod into the metadata.namespace Kubernetes namespace
#
apiVersion: v1
kind: Pod
metadata:
labels:
app: minio
name: minio
namespace: minio-dev # Change this value to match the namespace metadata.name
spec:
containers:
- name: minio
image: quay.io/minio/minio:latest
command:
- /bin/bash
- -c
- |
mkdir -p /data/loki && \
minio server /data
env:
- name: MINIO_ACCESS_KEY
value: minio
- name: MINIO_SECRET_KEY
value: minio123
volumeMounts:
- mountPath: /data
name: storage # Corresponds to the `spec.volumes` Persistent Volume
volumes:
- name: storage
persistentVolumeClaim:
claimName: minio-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minio-pvc
namespace: minio-dev
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: lvms-local-storage
---
apiVersion: v1
kind: Service
metadata:
name: minio
namespace: minio-dev
spec:
selector:
app: minio
ports:
- name: api
protocol: TCP
port: 9000
- name: console
protocol: TCP
port: 9090
---
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: minio-console
namespace: minio-dev
spec:
host: console-minio-dev.apps-crc.testing
to:
kind: Service
name: minio
weight: 100
port:
targetPort: console
wildcardPolicy: None
---
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: minio-api
namespace: minio-dev
spec:
host: api-minio-dev.apps-crc.testing
to:
kind: Service
name: minio
weight: 100
port:
targetPort: api
wildcardPolicy: None
---
apiVersion: v1
kind: Secret
metadata:
name: cloudkitty-loki-s3
namespace: openstack
stringData:
access_key_id: minio
access_key_secret: minio123
bucketnames: loki
endpoint: http://minio.minio-dev.svc.cluster.local:9000