I’m tried to deploy Opensearch and Opensearch dashboards on K8s.
Here’s the Deployment file for Opensearch
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
service: opensearch-node1
name: opensearch-node1
spec:
replicas: 1
selector:
matchLabels:
service: opensearch-node1
strategy:
type: Recreate
template:
metadata:
labels:
network/opensearch-net: "true"
service: opensearch-node1
spec:
containers:
- env:
- name: OPENSEARCH_JAVA_OPTS
value: -Xms512m -Xmx512m
- name: bootstrap.memory_lock
value: "true"
- name: cluster.initial_master_nodes
value: opensearch-node1
- name: cluster.name
value: opensearch-cluster
- name: discovery.seed_hosts
value: opensearch-node1
- name: node.name
value: opensearch-node1
image: opensearchproject/opensearch:1.0.0-rc1
name: opensearch-node1
ports:
- containerPort: 9200
- containerPort: 9600
readinessProbe:
tcpSocket:
port: 9200
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 60
resources: {}
restartPolicy: Always
status: {}
---
apiVersion: v1
kind: Service
metadata:
labels:
service: opensearch-node1
name: opensearch-node1
spec:
ports:
- name: "9200"
port: 9200
targetPort: 9200
- name: "9600"
port: 9600
targetPort: 9600
selector:
service: opensearch-node1
status:
loadBalancer: {}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
creationTimestamp: null
name: opensearch-net
spec:
ingress:
- from:
- podSelector:
matchLabels:
network/opensearch-net: "true"
podSelector:
matchLabels:
network/opensearch-net: "true
I deployed Successfully Opensearch but it doesn’t spin up and then the pod is continuously going to CrashLoopBack. So when I describe the deployment it shows be like
Name: opensearch-node1
amespace: opensearch
CreationTimestamp: Thu, 27 Apr 2023 05:11:00 +0000
Labels: service=opensearch-node1
Annotations: deployment.kubernetes.io/revision: 1
Selector: service=opensearch-node1
Replicas: 1 desired | 1 updated | 1 total | 0 available | 1 unavailable
StrategyType: Recreate
MinReadySeconds: 0
Pod Template:
Labels: network/opensearch-net=true
service=opensearch-node1
Containers:
opensearch-node1:
Image: opensearchproject/opensearch:1.0.0-rc1
Ports: 9200/TCP, 9600/TCP
Host Ports: 0/TCP, 0/TCP
Readiness: tcp-socket :9200 delay=5s timeout=60s period=10s #success=1 #failure=3
Environment:
OPENSEARCH_JAVA_OPTS: -Xms512m -Xmx512m
bootstrap.memory_lock: true
cluster.initial_master_nodes: opensearch-node1
cluster.name: opensearch-cluster
discovery.seed_hosts: opensearch-node1
node.name: opensearch-node1
Mounts: <none>
Volumes: <none>
Conditions:
Type Status Reason
---- ------ ------
Available False MinimumReplicasUnavailable
Progressing False ProgressDeadlineExceeded
OldReplicaSets: <none>
NewReplicaSet: opensearch-node1-64886d7bdd (1/1 replicas created)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 35m deployment-controller Scaled up replica set opensearch-node1-64886d7bdd to 1
Then i describe the pod
Namespace: opensearch
Priority: 0
Service Account: default
Node: gke-opsh-cluster-default-pool-a1d855e0-r3gb/10.0.0.10
Start Time: Thu, 27 Apr 2023 05:11:00 +0000
Labels: network/opensearch-net=true
pod-template-hash=64886d7bdd
service=opensearch-node1
Annotations: <none>
Status: Running
IP: 10.216.1.28
IPs:
IP: 10.216.1.28
Controlled By: ReplicaSet/opensearch-node1-64886d7bdd
Containers:
opensearch-node1:
Container ID: containerd://610c0a40e461b1107c4eab99ca473d9c7cc4c05e4c936bfc463e9a30923ef934
Image: opensearchproject/opensearch:1.0.0-rc1
Image ID: docker.io/opensearchproject/opensearch@sha256:8fb2491185079b249e1e4542430e49ece25dce7a40ff2df91a0a6ba80708347b
Ports: 9200/TCP, 9600/TCP
Host Ports: 0/TCP, 0/TCP
State: Running
Started: Thu, 27 Apr 2023 05:52:15 +0000
Ready: False
Restart Count: 12
Readiness: tcp-socket :9200 delay=5s timeout=60s period=10s #success=1 #failure=3
Environment:
OPENSEARCH_JAVA_OPTS: -Xms512m -Xmx512m
bootstrap.memory_lock: true
cluster.initial_master_nodes: opensearch-node1
cluster.name: opensearch-cluster
discovery.seed_hosts: opensearch-node1
node.name: opensearch-node1
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-vqstv (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
kube-api-access-vqstv:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 41m default-scheduler Successfully assigned opensearch/opensearch-node1-64886d7bdd-z642z to gke-opsh-cluster-default-pool-a1d855e0-r3gb
Normal Created 39m (x4 over 41m) kubelet Created container opensearch-node1
Normal Started 39m (x4 over 41m) kubelet Started container opensearch-node1
Warning Unhealthy 36m (x12 over 41m) kubelet Readiness probe failed: dial tcp 10.216.1.28:9200: connect: connection refused
Normal Pulled 11m (x11 over 41m) kubelet Container image "opensearchproject/opensearch:1.0.0-rc1" already present on machine
Warning BackOff 67s (x164 over 40m) kubelet Back-off restarting failed container
So anyone can help on this