当前位置:网站首页>K8s running Oracle
K8s running Oracle
2022-07-07 06:13:00 【Drunken Xiaobai】
1、 Create a namespace
alias k='kubectl'
k create ns oracle-server
k get ns
2、 establish .yaml file
K8S install Oracle11g
remarks : port 1521 -> 31521
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: oracle-server
name: oracle-server
namespace: oracle-server
spec:
selector:
matchLabels:
app: oracle-server
template:
metadata:
labels:
app: oracle-server
spec:
containers:
- image: registry.cn-hangzhou.aliyuncs.com/liyusoft/tool-oracle:v1.0.1
imagePullPolicy: IfNotPresent
name: oracle-server
ports:
- containerPort: 31521
command: ['/assets/entrypoint.sh']
env:
- name: ORACLE_HOME
value: "/opt/oracle/app/product/11.2.0/dbhome_1"
- name: ORACLE_SID
value: "orcl"
volumeMounts: # Mount persistent storage volumes
- name: oracle-volume # The name of the mounted device , And volumes[*].name Need corresponding
mountPath: /opt/oracle/dpdump/1/dump_dir # Mount to a path of the container
readOnly: true
volumes: # Define a set of Mount Devices
- name: oracle-volume # Define the name of a mounted device
hostPath:
path: /opt/ # The mounted device type is hostPath, The path is under the host /opt, There are many types of devices here
3、 function pod
k apply -f oracle.yaml
alias ko='k -n oracle-server'
4、 Get into pod
problem :
Error from server (BadRequest): container "oracle-server" in pod "oracle-server" is waiting to start: trying and failing to pull image.
Normal Pulling 3m5s kubelet Pulling image "registry.cn-hangzhou.aliyuncs.com/liyusoft/tool-oracle:v1.0.1"
Solution :
Need to wait about 10 minute , Pulling image
ko get pod
NAME READY STATUS RESTARTS AGE
oracle-server-56c657455b-7kfj6 1/1 Running 0 4h21m
kubectl exec -it oracle-server-56c657455b-7kfj6 bash
5、 see pod
ko describe pod oracle-server-56c657455b-7kfj6
Name: oracle-server-56c657455b-7kfj6
Namespace: oracle-server
Priority: 0
Node: */**** Start Time: Wed, 06 Jul 2022 18:06:36 +0800 Labels: app=oracle-server pod-template-hash=56c657455b Annotations: <none> Status: Running IP: 10.244.0.105 IPs: IP: 10.244.0.105 Controlled By: ReplicaSet/oracle-server-56c657455b Containers: oracle-server: Container ID: docker://d001f4097d165fcb11203cd87df50308a9c4eb335ec9edb1f05373bbff7b9269 Image: registry.cn-hangzhou.aliyuncs.com/liyusoft/tool-oracle:v1.0.1 Image ID: docker-pullable://registry.cn-hangzhou.aliyuncs.com/liyusoft/[email protected]:660da6cea178223432e406b95435bf0cd62d6ccc7a637f9f51d32e87a4fb54c7 Port: 31525/TCP Host Port: 0/TCP Command: /assets/entrypoint.sh State: Running Started: Wed, 06 Jul 2022 18:15:41 +0800 Ready: True Restart Count: 0 Environment: ORACLE_HOME: /opt/oracle/app/product/11.2.0/dbhome_1 ORACLE_SID: orcl Mounts: /opt/oracle/dpdump/1/dump_dir from oracle-volume (ro) /var/run/secrets/kubernetes.io/serviceaccount from default-token-kzhg5 (ro) Conditions: Type Status Initialized True Ready True ContainersReady True PodScheduled True Volumes: oracle-volume: Type: HostPath (bare host directory volume) Path: /opt/dump_dir HostPathType: default-token-kzhg5: Type: Secret (a volume populated by a Secret) SecretName: default-token-kzhg5 Optional: false QoS Class: BestEffort Node-Selectors: <none> Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s node.kubernetes.io/unreachable:NoExecute for 300s Events: <none>
6、 Check the log
ko logs -f oracle-server-56c657455b-7kfj6
7、 Delete pod
ko delete pod oracle-server-56c657455b-7kfj6
pod "oracle-server-56c657455b-7kfj6" deleted
problem : After deletion, I restarted myself
ko get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
oracle-server 1/1 1 1 4h44m
Solution 1: no way !
ko delete pod oracle-server-56c657455b-lffbf --force --grace-period=0
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod "oracle-server-56c657455b-lffbf" force deleted
ko get pod
Unable to connect to the server: net/http: TLS handshake timeout
ko get pod
Error from server (Timeout): the server was unable to return a response in the time allotted, but may still be processing the request (get pods)
You have new mail in /var/spool/mail/root
ko get pod
NAME READY STATUS RESTARTS AGE
oracle-server-56c657455b-cwcnt 1/1 Running 0 3m48s
Solution 2: Delete namespace
ko delete --all pods
Error from server (Timeout): the server was unable to return a response in the time allotted, but may still be processing the request (get pods)
kubectl delete ns oracle-server
namespace "oracle-server" deleted
You have new mail in /var/spool/mail/root
边栏推荐
- 职场经历反馈给初入职场的程序员
- Qtthread, one of many methods of QT multithreading
- [daily training -- Tencent selected 50] 292 Nim games
- 当我们谈论不可变基础设施时,我们在谈论什么
- QT console output in GUI applications- Console output in a Qt GUI app?
- [daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
- If you don't know these four caching modes, dare you say you understand caching?
- [InstallShield] Introduction
- 从“跑分神器”到数据平台,鲁大师开启演进之路
- Check point: the core element for enterprises to deploy zero trust network (ztna)
猜你喜欢
Apple CMS V10 template /mxone Pro adaptive film and television website template
window下面如何安装swoole
mac版php装xdebug环境(m1版)
Peripheral driver library development notes 43: GPIO simulation SPI driver
Question 102: sequence traversal of binary tree
DC-7靶机
3428. 放苹果
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用shap决策图结合LightGBM模型实现异常值检测案例之详细攻略
Rk3399 platform development series explanation (WiFi) 5.53, hostapd (WiFi AP mode) configuration file description
Say sqlyog deceived me!
随机推荐
980. Different path III DFS
Deep clustering: joint optimization of depth representation learning and clustering
Flask1.1.4 Werkzeug1.0.1 源码分析:启动流程
软件测试知识储备:关于「登录安全」的基础知识,你了解多少?
You don't know the complete collection of recruitment slang of Internet companies
Interview skills of software testing
window下面如何安装swoole
【FPGA教程案例14】基于vivado核的FIR滤波器设计与实现
Flask1.1.4 Werkzeug1.0.1 源碼分析:啟動流程
软件测试的几个关键步骤,你需要知道
PTA ladder game exercise set l2-002 linked list de duplication
Markdown 并排显示图片
基于ADAU1452的DSP及DAC音频失真分析
Bypass open_ basedir
[cloud native] what is the microservice architecture?
JVM命令之 jstat:查看JVM統計信息
Subghz, lorawan, Nb IOT, Internet of things
Understand the deserialization principle of fastjson for generics
云加速,帮助您有效解决攻击问题!
QT console output in GUI applications- Console output in a Qt GUI app?