bitwarden-cli-deployment.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {% raw %}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: bitwarden-cli
  6. namespace: bitwarden
  7. labels:
  8. app.kubernetes.io/instance: bitwarden-cli
  9. app.kubernetes.io/name: bitwarden-cli
  10. spec:
  11. replicas: 1
  12. strategy:
  13. type: Recreate
  14. selector:
  15. matchLabels:
  16. app.kubernetes.io/name: bitwarden-cli
  17. app.kubernetes.io/instance: bitwarden-cli
  18. template:
  19. metadata:
  20. labels:
  21. app.kubernetes.io/name: bitwarden-cli
  22. app.kubernetes.io/instance: bitwarden-cli
  23. spec:
  24. containers:
  25. - name: bitwarden-cli
  26. image: YOUR_BITWARDEN_CLI_IMAGE
  27. imagePullPolicy: IfNotPresent
  28. env:
  29. - name: BW_HOST
  30. valueFrom:
  31. secretKeyRef:
  32. name: bitwarden-cli
  33. key: BW_HOST
  34. - name: BW_USER
  35. valueFrom:
  36. secretKeyRef:
  37. name: bitwarden-cli
  38. key: BW_USERNAME
  39. - name: BW_PASSWORD
  40. valueFrom:
  41. secretKeyRef:
  42. name: bitwarden-cli
  43. key: BW_PASSWORD
  44. ports:
  45. - name: http
  46. containerPort: 8087
  47. protocol: TCP
  48. livenessProbe:
  49. exec:
  50. command:
  51. - wget
  52. - -q
  53. - http://127.0.0.1:8087/sync?force=true
  54. - --post-data=''
  55. initialDelaySeconds: 20
  56. failureThreshold: 3
  57. timeoutSeconds: 10
  58. periodSeconds: 120
  59. readinessProbe:
  60. tcpSocket:
  61. port: 8087
  62. initialDelaySeconds: 20
  63. failureThreshold: 3
  64. timeoutSeconds: 1
  65. periodSeconds: 10
  66. startupProbe:
  67. tcpSocket:
  68. port: 8087
  69. initialDelaySeconds: 10
  70. failureThreshold: 30
  71. timeoutSeconds: 1
  72. periodSeconds: 5
  73. ---
  74. apiVersion: v1
  75. kind: Service
  76. metadata:
  77. name: bitwarden-cli
  78. namespace: bitwarden
  79. labels:
  80. app.kubernetes.io/instance: bitwarden-cli
  81. app.kubernetes.io/name: bitwarden-cli
  82. annotations:
  83. spec:
  84. type: ClusterIP
  85. ports:
  86. - port: 8087
  87. targetPort: http
  88. protocol: TCP
  89. name: http
  90. selector:
  91. app.kubernetes.io/name: bitwarden-cli
  92. app.kubernetes.io/instance: bitwarden-cli
  93. ---
  94. kind: NetworkPolicy
  95. apiVersion: networking.k8s.io/v1
  96. metadata:
  97. namespace: bitwarden
  98. name: external-secret-2-bw-cli
  99. spec:
  100. podSelector:
  101. matchLabels:
  102. app.kubernetes.io/instance: bitwarden-cli
  103. app.kubernetes.io/name: bitwarden-cli
  104. ingress:
  105. - from:
  106. - podSelector:
  107. matchLabels:
  108. app.kubernetes.io/instance: external-secrets
  109. app.kubernetes.io/name: external-secrets
  110. {% endraw %}