mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +00:00
fix elasticsearch
This commit is contained in:
parent
d19490d572
commit
40eb1599dd
@ -20,7 +20,7 @@ spec:
|
|||||||
kubernetes.io/cluster-service: "true"
|
kubernetes.io/cluster-service: "true"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: gcr.io/google_containers/elasticsearch:1.3
|
- image: gcr.io/google_containers/elasticsearch:1.4
|
||||||
name: elasticsearch-logging
|
name: elasticsearch-logging
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9200
|
- containerPort: 9200
|
||||||
@ -30,14 +30,8 @@ spec:
|
|||||||
name: es-transport-port
|
name: es-transport-port
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: token-system-logging
|
|
||||||
mountPath: /etc/token-system-logging
|
|
||||||
readOnly: true
|
|
||||||
- name: es-persistent-storage
|
- name: es-persistent-storage
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
volumes:
|
volumes:
|
||||||
- name: token-system-logging
|
|
||||||
secret:
|
|
||||||
secretName: token-system-logging
|
|
||||||
- name: es-persistent-storage
|
- name: es-persistent-storage
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
.PHONY: elasticsearch_logging_discovery build push
|
.PHONY: elasticsearch_logging_discovery build push
|
||||||
|
|
||||||
TAG = 1.3
|
# Keep this one version ahead to help prevent accidental pushes.
|
||||||
|
TAG = 1.4
|
||||||
|
|
||||||
build: elasticsearch_logging_discovery
|
build: elasticsearch_logging_discovery
|
||||||
docker build -t gcr.io/google_containers/elasticsearch:$(TAG) .
|
docker build -t gcr.io/google_containers/elasticsearch:$(TAG) .
|
||||||
|
|
||||||
push:
|
push:
|
||||||
gcloud preview docker push gcr.io/google_containers/elasticsearch:$(TAG)
|
gcloud preview docker push gcr.io/google_containers/elasticsearch:$(TAG)
|
||||||
|
|
||||||
elasticsearch_logging_discovery:
|
elasticsearch_logging_discovery:
|
||||||
go build elasticsearch_logging_discovery.go
|
go build elasticsearch_logging_discovery.go
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm elasticsearch_logging_discovery
|
||||||
|
@ -24,14 +24,9 @@ import (
|
|||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/clientcmd"
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
kubeconfig = flag.String("kubeconfig", "/etc/token-system-logging/kubeconfig", "kubeconfig file for access")
|
|
||||||
)
|
|
||||||
|
|
||||||
func flattenSubsets(subsets []api.EndpointSubset) []string {
|
func flattenSubsets(subsets []api.EndpointSubset) []string {
|
||||||
ips := []string{}
|
ips := []string{}
|
||||||
for _, ss := range subsets {
|
for _, ss := range subsets {
|
||||||
@ -46,17 +41,7 @@ func main() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
glog.Info("Kubernetes Elasticsearch logging discovery")
|
glog.Info("Kubernetes Elasticsearch logging discovery")
|
||||||
|
|
||||||
settings, err := clientcmd.LoadFromFile(*kubeconfig)
|
c, err := client.NewInCluster()
|
||||||
if err != nil {
|
|
||||||
glog.Fatalf("Error loading configuration from %s: %v", *kubeconfig, err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
config, err := clientcmd.NewDefaultClientConfig(*settings, &clientcmd.ConfigOverrides{}).ClientConfig()
|
|
||||||
if err != nil {
|
|
||||||
glog.Fatalf("Failed to construct config: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
c, err := client.New(config)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("Failed to make client: %v", err)
|
glog.Fatalf("Failed to make client: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user