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

minIO operator log-search-api lookup error #532

Closed
Jeka-Dem opened this issue Mar 12, 2021 · 0 comments
Closed

minIO operator log-search-api lookup error #532

Jeka-Dem opened this issue Mar 12, 2021 · 0 comments
Assignees

Comments

@Jeka-Dem
Copy link

Jeka-Dem commented Mar 12, 2021

Expected Behavior

I've set

operator:
  clusterDomain: "dev.kuber.int"

to operator deployment and for MinIO pods and prometheus it's works as expected - it change cluster.local to dev.kuber.int, but not for minio-log-search-api

Current Behavior

When MinIO Operator provides Log Search API, it tries to lookup the service by cluster.local ignoring clusterDomain parameter

E0312 13:35:46.120190       1 main-controller.go:721] error syncing 'default/minio-cms': Log Search is not ready
Get "http://minio-cms-log-search-api.default.svc.cluster.local:8080": dial tcp: lookup minio-cms-log-search-api.default.svc.cluster.local on 169.254.25.10:53: no such host

Because it's hard-coded

func (c *Controller) checkLogSearchAPIReady(tenant *miniov2.Tenant) error {
	endpoint := fmt.Sprintf("http://%s.%s.svc.cluster.local:8080", tenant.LogSearchAPIServiceName(), tenant.Namespace)
	client := http.Client{Timeout: 100 * time.Millisecond}
	resp, err := client.Get(endpoint)

and do not use env variable from GetClusterDomain function

func GetClusterDomain() string {
	once.Do(func() {
		k8sClusterDomain = env.Get(clusterDomain, "cluster.local")
	})
	return k8sClusterDomain
}

Possible Solution

Steps to Reproduce (for bugs)

  1. Deploy MinIO Operator from master branch with
operator:
  clusterDomain: "some.damain"
  1. Apply tenant from example with log
log:
    image: minio/logsearchapi:v4.0.2
    audit:
      diskCapacityGB: 10
  1. Wail until it up
  2. Check operators logs

Context

Regression

Your Environment

  • Version used (minio-operator): I use templates from master branch
  • Environment name and version (e.g. kubernetes v1.17.2): v1.18.9
  • Server type and version: bare-metal vSphere version 6.7.0.42000
  • Operating System and version (uname -a): Oracle Linux Server release 7.6/4.14.35-2025.400.9.el7uek.x86_64
  • Link to your deployment file:

MINIO OPERATOR

operator:
  clusterDomain: "dev.kuber.int"
  nsToWatch: "default"
  image:
    repository: minio/operator
    tag: v4.0.2
    pullPolicy: IfNotPresent
  imagePullSecrets: []
  replicaCount: 1
  securityContext:
    runAsUser: 1000
    runAsGroup: 1000
    runAsNonRoot: true
  resources:
    requests:
      cpu: 200m
      memory: 256Mi
      ephemeral-storage: 500Mi

console:
  image:
    repository: minio/console
    tag: v0.6.3
    pullPolicy: IfNotPresent
  replicaCount: 1

MINIO TENANT:

apiVersion: v1
kind: Secret
metadata:
  name: cms-minio-secret
type: Opaque
data:
  accesskey: RWV0
  secretkey: YWh
---
apiVersion: v1
kind: Secret
metadata:
  name: cms-console-secret
type: Opaque
data:
  CONSOLE_PBKDF_PASSPHRASE: Y2h
  CONSOLE_PBKDF_SALT: Y2U1Y
  CONSOLE_ACCESS_KEY: SjA
  CONSOLE_SECRET_KEY: WUxLVVh
---
apiVersion: minio.min.io/v2
kind: Tenant
metadata:
  name: minio-cms
  labels:
    app: minio-cms
  annotations:
    prometheus.io/path: /minio/prometheus/metrics
    prometheus.io/port: "9000"
    prometheus.io/scrape: "true"
spec:
  image: minio/minio:RELEASE.2021-03-01T04-20-55Z
  imagePullPolicy: IfNotPresent
  credsSecret:
    name: cms-minio-secret
  pools:
    - servers: 4
      volumesPerServer: 1
      volumeClaimTemplate:
        metadata:
          name: data
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 1Gi
      resources:
        requests:
          cpu: 250m
          memory: 1Gi
        limits:
          cpu: 500m
          memory: 2Gi
  mountPath: /export
  requestAutoCert: true
  s3:
    bucketDNS: true
  certConfig:
    commonName: "dev.kuber.int"
    organizationName: []
    dnsNames: []
  podManagementPolicy: Parallel
  serviceMetadata:
    minioServiceLabels:
      label: minio-cms-svc
    minioServiceAnnotations:
      v2.min.io: minio-cms-svc
    consoleServiceLabels:
      label: console-cms-svc
    consoleServiceAnnotations:
      v2.min.io: console-cms-svc
  console:
    image: minio/console:v0.6.3
    replicas: 2
    consoleSecret:
      name: cms-console-secret
    securityContext:
      runAsUser: 1000
      runAsGroup: 2000
      runAsNonRoot: true
  log:
    image: minio/logsearchapi:v4.0.2
    audit:
      diskCapacityGB: 10
  prometheus:
    image: "prom/prometheus"
    sidecarimage: "alpine"
    initimage: "busybox"
    diskCapacityGB: 5
donatello added a commit to donatello/operator that referenced this issue May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants