mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-31 21:17:43 +09:00 
			
		
		
		
	Move kubernetes to kustomize, since thats what it is
This commit is contained in:
		
							
								
								
									
										76
									
								
								docs/examples/kustomize/postgres/deployment.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								docs/examples/kustomize/postgres/deployment.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,76 @@ | ||||
| apiVersion: apps/v1 | ||||
| kind: Deployment | ||||
| metadata: | ||||
|   name: headscale | ||||
| spec: | ||||
|   replicas: 2 | ||||
|   selector: | ||||
|     matchLabels: | ||||
|       app: headscale | ||||
|   template: | ||||
|     metadata: | ||||
|       labels: | ||||
|         app: headscale | ||||
|     spec: | ||||
|       containers: | ||||
|         - name: headscale | ||||
|           image: "headscale:latest" | ||||
|           imagePullPolicy: IfNotPresent | ||||
|           command: ["/go/bin/headscale", "serve"] | ||||
|           env: | ||||
|             - name: SERVER_URL | ||||
|               value: $(PUBLIC_PROTO)://$(PUBLIC_HOSTNAME) | ||||
|             - name: LISTEN_ADDR | ||||
|               valueFrom: | ||||
|                 configMapKeyRef: | ||||
|                   name: headscale-config | ||||
|                   key: listen_addr | ||||
|             - name: DERP_MAP_PATH | ||||
|               value: /vol/config/derp.yaml | ||||
|             - name: EPHEMERAL_NODE_INACTIVITY_TIMEOUT | ||||
|               valueFrom: | ||||
|                 configMapKeyRef: | ||||
|                   name: headscale-config | ||||
|                   key: ephemeral_node_inactivity_timeout | ||||
|             - name: DB_TYPE | ||||
|               value: postgres | ||||
|             - name: DB_HOST | ||||
|               value: postgres.headscale.svc.cluster.local | ||||
|             - name: DB_PORT | ||||
|               value: "5432" | ||||
|             - name: DB_USER | ||||
|               value: headscale | ||||
|             - name: DB_PASS | ||||
|               valueFrom: | ||||
|                 secretKeyRef: | ||||
|                   name: postgresql | ||||
|                   key: password | ||||
|             - name: DB_NAME | ||||
|               value: headscale | ||||
|           ports: | ||||
|             - name: http | ||||
|               protocol: TCP | ||||
|               containerPort: 8080 | ||||
|           livenessProbe: | ||||
|             tcpSocket: | ||||
|               port: http | ||||
|             initialDelaySeconds: 30 | ||||
|             timeoutSeconds: 5 | ||||
|             periodSeconds: 15 | ||||
|           volumeMounts: | ||||
|             - name: config | ||||
|               mountPath: /vol/config | ||||
|             - name: secret | ||||
|               mountPath: /vol/secret | ||||
|             - name: etc | ||||
|               mountPath: /etc/headscale | ||||
|       volumes: | ||||
|         - name: config | ||||
|           configMap: | ||||
|             name: headscale-site | ||||
|         - name: etc | ||||
|           configMap: | ||||
|             name: headscale-etc | ||||
|         - name: secret | ||||
|           secret: | ||||
|             secretName: headscale | ||||
							
								
								
									
										13
									
								
								docs/examples/kustomize/postgres/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								docs/examples/kustomize/postgres/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| namespace: headscale | ||||
| bases: | ||||
|   - ../base | ||||
| resources: | ||||
|   - deployment.yaml | ||||
|   - postgres-service.yaml | ||||
|   - postgres-statefulset.yaml | ||||
| generatorOptions: | ||||
|   disableNameSuffixHash: true | ||||
| secretGenerator: | ||||
|   - name: postgresql | ||||
|     files: | ||||
|       - secrets/password | ||||
							
								
								
									
										13
									
								
								docs/examples/kustomize/postgres/postgres-service.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								docs/examples/kustomize/postgres/postgres-service.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| apiVersion: v1 | ||||
| kind: Service | ||||
| metadata: | ||||
|   name: postgres | ||||
|   labels: | ||||
|     app: postgres | ||||
| spec: | ||||
|   selector: | ||||
|     app: postgres | ||||
|   ports: | ||||
|     - name: postgres | ||||
|       targetPort: postgres | ||||
|       port: 5432 | ||||
							
								
								
									
										49
									
								
								docs/examples/kustomize/postgres/postgres-statefulset.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								docs/examples/kustomize/postgres/postgres-statefulset.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| apiVersion: apps/v1 | ||||
| kind: StatefulSet | ||||
| metadata: | ||||
|   name: postgres | ||||
| spec: | ||||
|   serviceName: postgres | ||||
|   replicas: 1 | ||||
|   selector: | ||||
|     matchLabels: | ||||
|       app: postgres | ||||
|   template: | ||||
|     metadata: | ||||
|       labels: | ||||
|         app: postgres | ||||
|     spec: | ||||
|       containers: | ||||
|         - name: postgres | ||||
|           image: "postgres:13" | ||||
|           imagePullPolicy: IfNotPresent | ||||
|           env: | ||||
|             - name: POSTGRES_PASSWORD | ||||
|               valueFrom: | ||||
|                 secretKeyRef: | ||||
|                   name: postgresql | ||||
|                   key: password | ||||
|             - name: POSTGRES_USER | ||||
|               value: headscale | ||||
|           ports: | ||||
|             - name: postgres | ||||
|               protocol: TCP | ||||
|               containerPort: 5432 | ||||
|           livenessProbe: | ||||
|             tcpSocket: | ||||
|               port: 5432 | ||||
|             initialDelaySeconds: 30 | ||||
|             timeoutSeconds: 5 | ||||
|             periodSeconds: 15 | ||||
|           volumeMounts: | ||||
|             - name: pgdata | ||||
|               mountPath: /var/lib/postgresql/data | ||||
|   volumeClaimTemplates: | ||||
|     - metadata: | ||||
|         name: pgdata | ||||
|       spec: | ||||
|         storageClassName: local-path | ||||
|         accessModes: ["ReadWriteOnce"] | ||||
|         resources: | ||||
|           requests: | ||||
|             storage: 1Gi | ||||
		Reference in New Issue
	
	Block a user