需要先创建好pvc,并且把authelia的配置文件安排进去,然后执行deployment应用启动pod
pv
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
apiVersion: v1 kind: PersistentVolume metadata: name: pv0001 spec: capacity: storage: 1Gi volumeMode: Filesystem accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain storageClassName: authelia-config nfs: path: /nfs/pv1 server: 192.168.6.189 |
deployment
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
apiVersion: v1 kind: Service metadata: labels: app: sso-authelia name: sso-authelia namespace: ingress-nginx spec: ports: - name: http port: 9091 protocol: TCP targetPort: 9091 nodePort: 9091 selector: app: sso-authelia type: NodePort --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: authelia-pv-claim spec: storageClassName: authelia-config accessModes: - ReadWriteMany resources: requests: storage: 1Gi --- apiVersion: apps/v1beta2 kind: Deployment metadata: labels: app: sso-authelia name: sso-authelia namespace: ingress-nginx spec: replicas: 1 selector: matchLabels: app: sso-authelia template: metadata: labels: app: sso-authelia spec: containers: - image: authelia/authelia name: sso-authelia #args: #- "--config=/config/config.yml" volumeMounts: - name: authelia-configmap mountPath: /config/ ports: - containerPort: 9091 protocol: TCP imagePullSecrets: - name: IfNotPresent volumes: - name: authelia-configmap persistentVolumeClaim: claimName: authelia-pv-claim |
启动后需要搭配traefik来使用 traefik
- 本文固定链接: https://www.yoyoask.com/?p=4715
- 转载请注明: shooter 于 SHOOTER 发表