Cloudformation作为kube2iam角色

时间:2019-03-07 14:02:27

标签: kubernetes amazon-cloudformation amazon-iam

我在为kube2iam创建角色时遇到问题,一切似乎都正常,我使用该角色部署了堆栈,并且pod旋转了,但是每当pod尝试执行授权操作时(在这种情况下,将项目放入dynamo ),我收到一个错误消息,认为未授权的角色。这是创建角色的代码段:

getNumber

该表位于同一堆栈中的其他位置,并且可以很好地部署。我通过舵图部署了kube2iam

我得到的错误是:

iterator

我也曾尝试过这个角色:

import pandas as pd
import datetime as dt
import numpy as np
from numpy import nan as Nan

path = "C://Users//Zemi4//Desktop//csv//A-001.csv"

df = pd.read_csv(path,delimiter=";")

df['ta'] = pd.to_numeric(df['ta'])
df['tw'] = pd.to_numeric(df['tw'])

df["time_str"] = [dt.datetime.strptime(d, "%d.%m.%Y %H:%M:%S") for d in df["time"]]
df["time_str"] = [d.date() for d in df["time_str"]]
df["time_str"] = pd.to_datetime(df["time_str"])
df["time_zaokrouhleny"]=df["time_str"]

def analyza(pozadovane_data):

    new_list = []

    new_df = pd.DataFrame(new_list)

    new_df=df.loc[df["time_str"] == pozadovane_data,["ta","tw", "zone", "time_zaokrouhleny"]]

    counter = new_df.ta.count()

    if counter < 24:
        for i in range(counter,24):
            new_df.loc[i] = [Nan for n in range(4)]
            new_df["ta"]= new_df.ta.fillna(0)
            new_df["tw"] = new_df.tw.fillna(0)
            new_df["zone"] = new_df.zone.fillna(0)
            new_df["time_zaokrouhleny"]=new_df.time_zaokrouhleny.fillna(new_df.time_zaokrouhleny.min())

    elif counter > 24:
        counter_list = list(range(24,counter))
        new_df = new_df.drop(new_df.index[counter_list])

    new_df["time_oprava"] = [dt.datetime.combine(d.date(),dt.time(1,0)) for d in new_df["time_zaokrouhleny"]]

    s = 0
    cas_list = []

    for d in new_df["time_oprava"]:
        d =d + dt.timedelta(hours=s)
        #print(d)
        #print(s)
        cas_list.append(d)
        s = s + 1

    se = pd.Series(cas_list)

    new_df['time_oprava'] = se.values

    new_df['Validace'] = (new_df['ta'] != 0) & (new_df['tw'] != 0)

    new_df['Rozdil'] = new_df['ta'] - new_df['tw']

    new_df.rename(columns={"ta": "Skutecna teplota", "tw": "Pozadovana teplota", "time_oprava": "Cas", "zone": "Mistnost"}, inplace = True)

    new_df.index = new_df['Cas']

    return new_df

start = dt.datetime(2010,10,6)
end = dt.datetime(2010,12,27)

date_range = []
date_range = [start + dt.timedelta(days=x) for x in range(0,(end-start).days)]

new_list = []

vysledek_df =pd.DataFrame(new_list)

for d in date_range:
    pom = analyza(d)
    vysledek_df = vysledek_df.append(pom,ignore_index=True)
    vysledek_df.pop('time_zaokrouhleny')
    vysledek_df.to_csv('C://Users//Zemi4//Desktop//zpr//A-001.csv', encoding='utf-8', index=False)

我仍然遇到相同的错误

0 个答案:

没有答案